Skip to content

Commit

Permalink
Fixed ansible lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tedgin committed Nov 5, 2023
1 parent 066d2aa commit 0290146
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion tasks/client.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: client | create client version of irods_environment.json
- name: Client | create client version of irods_environment.json
ansible.builtin.include_tasks: irods_environment.yml
vars:
_for_server: false
9 changes: 4 additions & 5 deletions tasks/hosts_config.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---
- name: Hosts_config | validate address type
- name: Hosts config | validate address type
when: _validate | bool
with_items: "{{ _host_entries }}"
ansible.builtin.assert:
that:
- item.address_type == 'local' or item.address_type == 'remote'
that: item.address_type == 'local' or item.address_type == 'remote'
failed_when: false

- name: hosts_config | generate file
- name: Hosts config | generate file
ansible.builtin.include_tasks: _cfg_template.yml
vars:
_cfg_template_dest_file: etc/irods/hosts_config.json

- name: Hosts_config | ensure known that changes were made
- name: Hosts config | ensure known that changes were made
ansible.builtin.meta: flush_handlers
12 changes: 6 additions & 6 deletions tasks/irods_environment.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
- name: Irods_environment | load variable values
- name: IRODS environment | load variable values
ansible.builtin.include_vars: >-
{{ 'irods_environment_server.yml' if _for_server | bool else 'irods_environment_client.yml' }}
- name: Irods_environment | validate if required
- name: IRODS environment | validate if required
when: _validate | bool
block:
- name: Irods_environment | validate core variables
- name: Validate core variables
ansible.builtin.assert:
that:
- _zone_port|int >= 1 and _zone_port|int <= 65535

- name: Irods_environment | validate variables
- name: Validate variables
when: _for_server | bool
ansible.builtin.assert:
that:
Expand Down Expand Up @@ -40,11 +40,11 @@
and _client_xmsg_port|int != _server_control_plane_port|int )
- not _zone_auth_scheme or _zone_auth_scheme in ['gsi', 'krb', 'native', 'pam']

- name: irods_environment | generate file
- name: IRODS environment | generate file
ansible.builtin.include_tasks: _cfg_template.yml
vars:
_cfg_template_dest_file: "{{ _environment_file }}"
_cfg_template_name: irods_environment.json.j2

- name: Irods_environment | ensure known that changes were made
- name: IRODS environment | ensure known that changes were made
ansible.builtin.meta: flush_handlers
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
- name: main | configure server
- name: Configure server
ansible.builtin.import_tasks: server.yml
10 changes: 5 additions & 5 deletions tasks/server.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
- name: server | generate host_access_control_config.json
- name: Server | generate host_access_control_config.json
ansible.builtin.import_tasks: host_access_control_config.yml

- name: server | generate hosts_config.json
- name: Server | generate hosts_config.json
ansible.builtin.import_tasks: hosts_config.yml

- name: server | generate server version of irods_environment.json
- name: Server | generate server version of irods_environment.json
ansible.builtin.include_tasks: irods_environment.yml
vars:
_for_server: true

- name: server | generate server_config.json
- name: Server | generate server_config.json
ansible.builtin.import_tasks: server_config.yml

- name: server | generate service_account.config
- name: Server | generate service_account.config
ansible.builtin.import_tasks: service_account.yml
18 changes: 9 additions & 9 deletions tasks/server_config.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
---
- name: Server_config | include variables
- name: Server config | include variables
ansible.builtin.include_vars: server_config.yml

- name: Server_config | validate ICAT vars if requested
- name: Server config | validate ICAT vars if requested
when: _icat is mapping
block:
- name: Server_config | validate database params
- name: Server config | validate database params
when: _validate | bool
ansible.builtin.assert:
that:
- _icat.catalog_database_type in ('mysql', 'oracle', 'postgres')
- _icat.db_port|int >= 1 and _icat.db_port|int <= 65535

- name: Server_config | load vars for chosen database type
- name: Server config | load vars for chosen database type
ansible.builtin.include_vars: "{{ _icat.catalog_database_type }}.yml"

- name: Server_config | validate rest if requested
- name: Server config | validate rest if requested
when: _validate | bool
block:
- name: Server_config | validate federation
- name: Validate federation
with_items: "{{ _federation }}"
ansible.builtin.assert:
that:
- item.zone_name != _zone_name
- item.negotiation_key|length == 32

- name: Server_config | validate parameters
- name: Validate parameters
ansible.builtin.assert:
that:
- _catalog_provider_hosts|length >= 1
Expand Down Expand Up @@ -83,10 +83,10 @@
or _zone_port|int > _server_port_range_end|int)
and _zone_port != _xmsg_port
- name: server_config | generate file
- name: Server config | generate file
ansible.builtin.include_tasks: _cfg_template.yml
vars:
_cfg_template_dest_file: etc/irods/server_config.json

- name: Server_config | ensure known that changes were made
- name: Server config | ensure known that changes were made
ansible.builtin.meta: flush_handlers
4 changes: 2 additions & 2 deletions tasks/service_account.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: service_account | generate file
- name: Service account | generate file
ansible.builtin.include_tasks: _cfg_template.yml
vars:
_cfg_template_dest_file: etc/irods/service_account.config

- name: Service_account | ensure known that changes were made
- name: Service account | ensure known that changes were made
ansible.builtin.meta: flush_handlers
16 changes: 8 additions & 8 deletions tasks/setup_irods.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
---
- name: setup_irods | Initialize ICAT schema if needed
- name: Setup iRODS | Initialize ICAT schema if needed
when: _catalog_service_role == 'provider'
block:
- name: setup_irods | determine if ICAT schema initialized
- name: Determine if ICAT schema initialized
ansible.builtin.stat:
path: "{{ _root_dir }}/var/lib/irods/.odbc.ini"
register: odbc

- name: setup_irods | load vars for chosen database type
- name: Load vars for chosen database type
when: not odbc.stat.exists
ansible.builtin.include_vars: "{{ _icat.catalog_database_type }}.yml"

- name: setup_irods | load variable values
- name: Load variable values
when: not odbc.stat.exists
ansible.builtin.include_vars: irods_environment_server.yml

- name: setup_irods | create setup configuration file
- name: Create setup configuration file
when: not odbc.stat.exists
ansible.builtin.template:
src: setup_configuration.json.j2
dest: /tmp/setup_configuration.json
mode: u+rw

- name: setup_irods | initialize ICAT schema
- name: Initialize ICAT schema
when: not odbc.stat.exists
ansible.builtin.shell: |
set -e
Expand All @@ -35,10 +35,10 @@
- not response.stdout is search('Attempting test put')
changed_when: not response.stderr is search('Database specified already in use by iRODS')
rescue:
- name: setup_irods | ensure .odbc.ini missing on failure
- name: Ensure .odbc.ini missing on failure
ansible.builtin.file:
path: "{{ _root_dir }}/var/lib/irods/.odbc.ini"
state: absent

- name: setup_irods | configure server
- name: Setup iRODS | configure server
ansible.builtin.import_tasks: server.yml

0 comments on commit 0290146

Please sign in to comment.