From 99c6fb28355553e1d42ed1dfc8ec2e98fe077f8c Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Mon, 17 Jul 2023 11:45:20 +0200 Subject: [PATCH] Fix linters and metadata With update of ansible-lint to version >=6.0.0 a lot of new linters were added, that enabled by default. In order to comply with linter rules we're applying changes to the role. With that we also update metdata to reflect current state. Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/888223 Change-Id: I6bbb97cd2f1daac42269a335014eb6cf7f28d24e --- defaults/main.yml | 57 ++++++++++++++----- meta/main.yml | 12 ++-- tasks/main.yml | 41 ++++++++----- tasks/swift_check_hashes.yml | 2 + tasks/swift_install.yml | 4 +- tasks/swift_key_populate.yml | 2 +- tasks/swift_key_setup.yml | 6 +- tasks/swift_pre_install.yml | 8 +-- tasks/swift_proxy_hosts.yml | 2 +- tasks/swift_pypy_setup.yml | 8 ++- tasks/swift_rings.yml | 18 ++++-- tasks/swift_rings_build.yml | 12 +++- tasks/swift_rings_post_distribution_check.yml | 5 +- tasks/swift_storage_hosts.yml | 12 ++-- tasks/swift_storage_hosts_setup.yml | 3 +- vars/main.yml | 9 ++- 16 files changed, 137 insertions(+), 64 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0c74c262..4d7932ea 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,7 +23,11 @@ debug: False # for the service setup. The host must already have # clouds.yaml properly configured. swift_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" -swift_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((swift_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" +swift_service_setup_host_python_interpreter: >- + {{ + openstack_service_setup_host_python_interpreter | default( + (swift_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) + }} # Set the package install state for distribution packages # Options are 'present' and 'latest' @@ -37,7 +41,8 @@ swift_venv_python_executable: "{{ openstack_venv_python_executable | default('py swift_git_repo: https://opendev.org/openstack/swift swift_git_install_branch: master -swift_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}" +swift_upper_constraints_url: >- + {{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }} swift_git_constraints: - "--constraint {{ swift_upper_constraints_url }}" @@ -159,7 +164,8 @@ swift_operator_role: swiftoperator swift_allow_versions: True # This will allow all users to create containers and upload to swift if set to True swift_allow_all_users: False -# If you want to regenerate the swift keys, on a run, for rsync purposes set this var to True otherwise keys will be generated on the first run and not regenerated each run. +# If you want to regenerate the swift keys, on a run, for rsync purposes set this var to True +# otherwise keys will be generated on the first run and not regenerated each run. swift_recreate_keys: False swift_sorting_method: shuffle # Set the fallocate_reserve value which will reserve space and fail on PUTs above this value in bytes (Default 10GB) @@ -231,8 +237,8 @@ swift_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') } # value at 16 if the swift proxy is in a container and user did not define # this variable. swift_proxy_server_workers_max: 16 -swift_proxy_server_workers_not_capped: "{{ [(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2 }}" -swift_proxy_server_workers_capped: "{{ [swift_proxy_server_workers_max, swift_proxy_server_workers_not_capped|int] | min }}" +swift_proxy_server_workers_not_capped: "{{ [(ansible_facts['processor_vcpus'] // ansible_facts['processor_threads_per_core']) | default(1), 1] | max * 2 }}" +swift_proxy_server_workers_capped: "{{ [swift_proxy_server_workers_max, swift_proxy_server_workers_not_capped | int] | min }}" swift_proxy_server_workers: "{{ (inventory_hostname == physical_host) | ternary(swift_proxy_server_workers_not_capped, swift_proxy_server_workers_capped) }}" # These are the storage addresses used to define the networks for swift storage and replication @@ -405,7 +411,10 @@ swift_services: swift-account-auditor: group: swift_acc service_name: swift-account-auditor - execstarts: "{{ swift_bin }}/swift-account-auditor {{ swift_dedicated_replication | ternary('/etc/swift/account-server/account-server-replicator.conf', '/etc/swift/account-server/account-server.conf') }}" + execstarts: >- + {{ swift_bin }}/swift-account-auditor {{ swift_dedicated_replication | ternary( + '/etc/swift/account-server/account-server-replicator.conf', '/etc/swift/account-server/account-server.conf' + ) }} init_config_overrides: "{{ swift_account_auditor_init_overrides }}" start_order: 8 swift-account-reaper: @@ -417,14 +426,20 @@ swift_services: swift-account-replicator: group: swift_acc service_name: swift-account-replicator - execstarts: "{{ swift_bin }}/swift-account-replicator {{ swift_dedicated_replication | ternary('/etc/swift/account-server/account-server-replicator.conf', '/etc/swift/account-server/account-server.conf') }}" + execstarts: >- + {{ swift_bin }}/swift-account-replicator {{ swift_dedicated_replication | ternary( + '/etc/swift/account-server/account-server-replicator.conf', '/etc/swift/account-server/account-server.conf' + ) }} init_config_overrides: "{{ swift_account_replicator_init_overrides }}" start_order: 10 swift-container-auditor: group: swift_cont service_name: "swift-container-auditor" - execstarts: "{{ swift_bin }}/swift-container-auditor {{ swift_dedicated_replication | ternary('/etc/swift/container-server/container-server-replicator.conf', '/etc/swift/container-server/container-server.conf') }}" + execstarts: >- + {{ swift_bin }}/swift-container-auditor {{ swift_dedicated_replication | ternary( + '/etc/swift/container-server/container-server-replicator.conf', '/etc/swift/container-server/container-server.conf' + ) }} init_config_overrides: "{{ swift_container_auditor_init_overrides }}" start_order: 11 swift-container-reconciler: @@ -436,7 +451,10 @@ swift_services: swift-container-replicator: group: swift_cont service_name: "swift-container-replicator" - execstarts: "{{ swift_bin }}/swift-container-replicator {{ swift_dedicated_replication | ternary('/etc/swift/container-server/container-server-replicator.conf', '/etc/swift/container-server/container-server.conf') }}" + execstarts: >- + {{ swift_bin }}/swift-container-replicator {{ swift_dedicated_replication | ternary( + '/etc/swift/container-server/container-server-replicator.conf', '/etc/swift/container-server/container-server.conf' + ) }} init_config_overrides: "{{ swift_container_replicator_init_overrides }}" start_order: 13 swift-container-sync: @@ -455,7 +473,10 @@ swift_services: swift-object-auditor: group: swift_obj service_name: "swift-object-auditor" - execstarts: "{{ swift_bin }}/swift-object-auditor {{ swift_dedicated_replication | ternary('/etc/swift/object-server/object-server-replicator.conf', '/etc/swift/object-server/object-server.conf') }}" + execstarts: >- + {{ swift_bin }}/swift-object-auditor {{ swift_dedicated_replication | ternary( + '/etc/swift/object-server/object-server-replicator.conf', '/etc/swift/object-server/object-server.conf' + ) }} init_config_overrides: "{{ swift_object_auditor_init_overrides }}" start_order: 16 swift-object-expirer: @@ -467,13 +488,19 @@ swift_services: swift-object-reconstructor: group: swift_obj service_name: "swift-object-reconstructor" - execstarts: "{{ swift_bin }}/swift-object-reconstructor {{ swift_dedicated_replication | ternary('/etc/swift/object-server/object-server-replicator.conf', '/etc/swift/object-server/object-server.conf') }}" + execstarts: >- + {{ swift_bin }}/swift-object-reconstructor {{ swift_dedicated_replication | ternary( + '/etc/swift/object-server/object-server-replicator.conf', '/etc/swift/object-server/object-server.conf' + ) }} init_config_overrides: "{{ swift_object_reconstructor_init_overrides }}" start_order: 18 swift-object-replicator: group: swift_obj service_name: "swift-object-replicator" - execstarts: "{{ swift_bin }}/swift-object-replicator {{ swift_dedicated_replication | ternary('/etc/swift/object-server/object-server-replicator.conf', '/etc/swift/object-server/object-server.conf') }}" + execstarts: >- + {{ swift_bin }}/swift-object-replicator {{ swift_dedicated_replication | ternary( + '/etc/swift/object-server/object-server-replicator.conf', '/etc/swift/object-server/object-server.conf' + ) }} init_config_overrides: "{{ swift_object_replicator_init_overrides }}" start_order: 19 swift-object-updater: @@ -495,7 +522,7 @@ swift_pretend_min_part_hours_passed: False swift_pypy_enabled: false swift_pypy_archive: url: "https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.9.0-linux64.tar.bz2" - sha256: "790febd4f09e22d6e2f81154efc7dc4b2feec72712aaf4f82aa91b550abb4b48" + checksum: "sha256:790febd4f09e22d6e2f81154efc7dc4b2feec72712aaf4f82aa91b550abb4b48" swift_pypy_version: "{{ swift_pypy_archive['url'] | basename | replace('.tar.bz2', '') }}" swift_pypy_env: "/opt/pypy-runtime/{{ swift_pypy_version }}/bin/pypy" # Set the Garbage Collection (GC) options for pypy if you would like to tune these @@ -569,5 +596,5 @@ swift_pki_install_certificates: mode: "0600" # Define user-provided SSL certificates -#swift_user_ssl_cert: -#swift_user_ssl_key: +# swift_user_ssl_cert: +# swift_user_ssl_key: diff --git a/meta/main.yml b/meta/main.yml index d0d2798b..4800b542 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -18,19 +18,21 @@ galaxy_info: description: Installation and setup of swift company: Rackspace license: Apache2 - min_ansible_version: 2.4 + role_name: os_swift + namespace: openstack + min_ansible_version: "2.10" platforms: - name: Debian versions: - - buster + - bullseye - name: Ubuntu versions: - - bionic - focal + - jammy - name: EL versions: - - 8 - categories: + - "9" + galaxy_tags: - cloud - python - swift diff --git a/tasks/main.yml b/tasks/main.yml index e7bdae92..5b7871ed 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,60 +44,69 @@ - always # Check the swift_hash_path_* variables haven't changed -- import_tasks: swift_check_hashes.yml +- name: Importing swift_check_hashes tasks + import_tasks: swift_check_hashes.yml when: - "not swift_force_change_hashes | bool" tags: - swift-config -- import_tasks: swift_pre_install.yml +- name: Importing swift_pre_install tasks + import_tasks: swift_pre_install.yml when: - "swift_do_setup | bool" - "'swift_all' in group_names" tags: - swift-install -- import_tasks: swift_install.yml +- name: Importing swift_install tasks + import_tasks: swift_install.yml when: - "swift_do_setup | bool" - "'swift_all' in group_names" tags: - swift-install -- import_tasks: swift_post_install.yml +- name: Importing swift_post_install tasks + import_tasks: swift_post_install.yml when: - "swift_do_setup | bool" - "'swift_all' in group_names" tags: - swift-config -- import_tasks: swift_calculate_addresses.yml +- name: Importing swift_calculate_addresses tasks + import_tasks: swift_calculate_addresses.yml when: - "'swift_hosts' in group_names" tags: - always -- import_tasks: swift_storage_hosts.yml +- name: Importing swift_storage_hosts tasks + import_tasks: swift_storage_hosts.yml when: - "swift_do_setup | bool" - "'swift_hosts' in group_names" tags: - swift-config -- import_tasks: swift_proxy_hosts.yml +- name: Importing swift_proxy_hosts tasks + import_tasks: swift_proxy_hosts.yml when: - "swift_do_setup | bool" - "'swift_proxy' in group_names" tags: - swift-config -- import_tasks: swift_key_setup.yml +- name: Importing swift_key_setup tasks + import_tasks: swift_key_setup.yml when: - "swift_do_sync | bool" tags: - swift-config -- import_tasks: swift_rings.yml +- name: Importing swift_rings tasks + import_tasks: swift_rings.yml when: - "swift_do_sync | bool" tags: @@ -113,10 +122,10 @@ systemd_tempd_prefix: openstack systemd_slice_name: "{{ swift_system_slice_name }}" systemd_lock_dir: "{{ swift_lock_dir }}" - systemd_CPUAccounting: true - systemd_BlockIOAccounting: true - systemd_MemoryAccounting: true - systemd_TasksAccounting: true + systemd_service_cpu_accounting: true + systemd_service_block_io_accounting: true + systemd_service_memory_accounting: true + systemd_service_tasks_accounting: true systemd_services: |- {% set services = [] %} {% for service in filtered_swift_services %} @@ -137,7 +146,8 @@ - swift-config - systemd-service -- include_role: +- name: Including osa.mq_setup role + include_role: name: openstack.osa.mq_setup apply: tags: @@ -155,7 +165,8 @@ tags: - always -- include_role: +- name: Including osa.service_setup roled + include_role: name: openstack.osa.service_setup apply: tags: diff --git a/tasks/swift_check_hashes.yml b/tasks/swift_check_hashes.yml index 37a7afc2..89ad86c4 100644 --- a/tasks/swift_check_hashes.yml +++ b/tasks/swift_check_hashes.yml @@ -20,6 +20,7 @@ - name: Get value of swift_hash_path_suffix from file command: "awk '/swift_hash_path_suffix/{ print $3 }' /etc/swift/swift.conf" + changed_when: false register: swift_conf_hash_path_suffix when: - swift_conf.stat.exists | bool @@ -38,6 +39,7 @@ - name: Get value of swift_hash_path_prefix from file command: "awk '/swift_hash_path_prefix/{ print $3 }' /etc/swift/swift.conf" + changed_when: false register: swift_conf_hash_path_prefix when: - swift_conf.stat.exists | bool diff --git a/tasks/swift_install.yml b/tasks/swift_install.yml index c24d6e79..5146b051 100644 --- a/tasks/swift_install.yml +++ b/tasks/swift_install.yml @@ -19,6 +19,7 @@ section: "swift" option: "install_method" value: "{{ swift_install_method }}" + mode: "0644" - name: Refresh local facts to ensure the swift section is present setup: @@ -52,5 +53,6 @@ value: "{{ swift_venv_tag }}" when: swift_install_method == 'source' -- include_tasks: swift_pypy_setup.yml +- name: Including swift_pypy_setup tasks + include_tasks: swift_pypy_setup.yml when: swift_pypy_enabled | bool diff --git a/tasks/swift_key_populate.yml b/tasks/swift_key_populate.yml index 6cdd1efb..26383817 100644 --- a/tasks/swift_key_populate.yml +++ b/tasks/swift_key_populate.yml @@ -21,4 +21,4 @@ - name: Register a fact for the swift pub key set_fact: - swift_pubkey: "{{ swift_pub.content }}" + swift_pubkey: "{{ swift_pub.content }}" diff --git a/tasks/swift_key_setup.yml b/tasks/swift_key_setup.yml index 57b01313..97c4e74d 100644 --- a/tasks/swift_key_setup.yml +++ b/tasks/swift_key_setup.yml @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include_tasks: swift_key_populate.yml +- name: Including swift_key_populate tasks + include_tasks: swift_key_populate.yml -- include_tasks: swift_key_distribute.yml +- name: Including swift_key_distribute tasks + include_tasks: swift_key_distribute.yml diff --git a/tasks/swift_pre_install.yml b/tasks/swift_pre_install.yml index ef7a31ce..d44e381e 100644 --- a/tasks/swift_pre_install.yml +++ b/tasks/swift_pre_install.yml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: create the system group +- name: Create the system group group: name: "{{ swift_system_group_name }}" state: "present" @@ -44,9 +44,9 @@ file: path: "{{ item.path }}" state: directory - owner: "{{ item.owner|default(swift_system_user_name) }}" - group: "{{ item.group|default(swift_system_group_name) }}" - mode: "{{ item.mode|default('0755') }}" + owner: "{{ item.owner | default(swift_system_user_name) }}" + group: "{{ item.group | default(swift_system_group_name) }}" + mode: "{{ item.mode | default('0755') }}" with_items: - { path: "/openstack/venvs", owner: "root", group: "root" } - { path: "/etc/swift" } diff --git a/tasks/swift_proxy_hosts.yml b/tasks/swift_proxy_hosts.yml index f479e780..10abf657 100644 --- a/tasks/swift_proxy_hosts.yml +++ b/tasks/swift_proxy_hosts.yml @@ -33,7 +33,7 @@ tags: - always -- name: swift proxy server configuration +- name: Swift proxy server configuration openstack.config_template.config_template: src: "proxy-server.conf.j2" dest: "/etc/swift/proxy-server/proxy-server.conf" diff --git a/tasks/swift_pypy_setup.yml b/tasks/swift_pypy_setup.yml index 5c65cbae..1cbf7f69 100644 --- a/tasks/swift_pypy_setup.yml +++ b/tasks/swift_pypy_setup.yml @@ -16,14 +16,16 @@ - name: Download pre-built pypy get_url: url: "{{ swift_pypy_archive['url'] }}" - sha256sum: "{{ swift_pypy_archive['sha256'] }}" + checksum: "{{ swift_pypy_archive['checksum'] }}" dest: "/var/cache/{{ swift_pypy_archive['url'] | basename }}" force: yes + mode: "0644" - name: Create pypy dir file: path: "/opt/pypy-runtime" state: directory + mode: "0755" - name: Unarchive pre-built pypy unarchive: @@ -35,6 +37,7 @@ - name: Setup local pypy command: "{{ item }}" + changed_when: false with_items: - "{{ swift_pypy_env }} /opt/get-pip.py" - "{{ swift_pypy_env | dirname }}/pip install --upgrade virtualenv" @@ -62,7 +65,7 @@ virtualenv_command: "{{ swift_pypy_env | dirname }}/virtualenv" extra_args: >- {{ swift_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }} - {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} + {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''), '') }} {{ pip_install_options | default('') }} register: install_packages until: install_packages is success @@ -75,3 +78,4 @@ file: path: "{{ swift_bin | dirname }}/{{ swift_pypy_version }}-inuse" state: "touch" + mode: "0644" diff --git a/tasks/swift_rings.yml b/tasks/swift_rings.yml index aa71236f..85762356 100644 --- a/tasks/swift_rings.yml +++ b/tasks/swift_rings.yml @@ -13,17 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include_tasks: swift_rings_md5sum.yml +- name: Including swift_rings_md5sum tasks + include_tasks: swift_rings_md5sum.yml -- include_tasks: swift_rings_check.yml +- name: Including swift_rings_check tasks + include_tasks: swift_rings_check.yml when: _swift_is_first_play_host -- include_tasks: swift_rings_build.yml +- name: Including swift_rings_build tasks + include_tasks: swift_rings_build.yml when: _swift_is_first_play_host -- include_tasks: swift_rings_distribute.yml +- name: Including swift_rings_distribute tasks + include_tasks: swift_rings_distribute.yml -- include_tasks: swift_rings_md5sum.yml +- name: Including swift_rings_md5sum tasks + include_tasks: swift_rings_md5sum.yml -- include_tasks: swift_rings_post_distribution_check.yml +- name: Including swift_rings_post_distribution_check tasks + include_tasks: swift_rings_post_distribution_check.yml when: _swift_is_first_play_host diff --git a/tasks/swift_rings_build.yml b/tasks/swift_rings_build.yml index 94a1b795..94c099d5 100644 --- a/tasks/swift_rings_build.yml +++ b/tasks/swift_rings_build.yml @@ -29,6 +29,7 @@ dest: "/etc/swift/scripts/{{ item.type }}.contents" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" + mode: "0640" with_items: - { item: "{{ swift.account | default({}) }}", port: "{{ swift_account_port }}", type: "account" } - { item: "{{ swift.container | default({}) }}", port: "{{ swift_container_port }}", type: "container" } @@ -39,6 +40,7 @@ dest: "/etc/swift/scripts/object-{{ item[0].policy.index }}.contents" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" + mode: "0640" with_nested: - "{{ swift.storage_policies }}" - [{ type: 'object', port: "{{ swift_object_port }}" }] @@ -53,9 +55,11 @@ when: swift_install_method == 'distro' - name: "Build rings for account/container from contents files" - command: "/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/{{ item[0] }}.contents{% if item[1] %} -r {{ item[1] }}{% endif %}{{ (swift_pretend_min_part_hours_passed | bool) | ternary(' -p', '') }}" + command: >- + /etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/{{ item[0] }}.contents{% if item[1] %} -r {{ item[1] }}{% endif %}{{ + (swift_pretend_min_part_hours_passed | bool) | ternary(' -p', '') }} with_nested: - - [ 'account', 'container' ] + - ['account', 'container'] - "{{ swift_managed_regions | default([None]) }}" register: swift_rings_create become: yes @@ -66,7 +70,9 @@ chdir: /etc/swift/ring_build_files/ - name: "Build rings for storage policies from contents files" - command: "/etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents{% if item[1] %} -r {{ item[1] }}{% endif %}{{ (swift_pretend_min_part_hours_passed | bool) | ternary(' -p', '') }}" + command: >- + /etc/swift/scripts/swift_rings.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents{% + if item[1] %} -r {{ item[1] }}{% endif %}{{ (swift_pretend_min_part_hours_passed | bool) | ternary(' -p', '') }} with_nested: - "{{ swift.storage_policies }}" - "{{ swift_managed_regions | default([None]) }}" diff --git a/tasks/swift_rings_post_distribution_check.yml b/tasks/swift_rings_post_distribution_check.yml index e8f160fb..f112f5e6 100644 --- a/tasks/swift_rings_post_distribution_check.yml +++ b/tasks/swift_rings_post_distribution_check.yml @@ -43,7 +43,7 @@ command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/{{ item[0] }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}" changed_when: false with_nested: - - [ 'account', 'container' ] + - ['account', 'container'] - "{{ swift_managed_regions | default([None]) }}" become: yes become_user: "{{ swift_system_user_name }}" @@ -51,7 +51,8 @@ chdir: /etc/swift/ring_build_files/ - name: "Ensure contents file matches ring after ring sync for storage policies" - command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}" + command: >- + /etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %} changed_when: false with_nested: - "{{ swift.storage_policies }}" diff --git a/tasks/swift_storage_hosts.yml b/tasks/swift_storage_hosts.yml index 6c887bff..74ce33d1 100644 --- a/tasks/swift_storage_hosts.yml +++ b/tasks/swift_storage_hosts.yml @@ -13,7 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include_tasks: swift_storage_hosts_setup.yml -- include_tasks: swift_storage_hosts_object.yml -- include_tasks: swift_storage_hosts_account.yml -- include_tasks: swift_storage_hosts_container.yml +- name: Including swift_storage_hosts_setup tasks + include_tasks: swift_storage_hosts_setup.yml +- name: Including swift_storage_hosts_object tasks + include_tasks: swift_storage_hosts_object.yml +- name: Including swift_storage_hosts_account tasks + include_tasks: swift_storage_hosts_account.yml +- name: Including swift_storage_hosts_container tasks + include_tasks: swift_storage_hosts_container.yml diff --git a/tasks/swift_storage_hosts_setup.yml b/tasks/swift_storage_hosts_setup.yml index aa7f86bb..a46519de 100644 --- a/tasks/swift_storage_hosts_setup.yml +++ b/tasks/swift_storage_hosts_setup.yml @@ -66,4 +66,5 @@ owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" state: "directory" - with_items: "{{ swift_vars.drives| default(swift.drives) | default([]) }}" + mode: "0755" + with_items: "{{ swift_vars.drives | default(swift.drives) | default([]) }}" diff --git a/vars/main.yml b/vars/main.yml index b127cfcc..bf742a91 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -13,8 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -_swift_proxy_is_first_play_host: "{{ (swift_services['swift-proxy-server']['group'] in group_names and inventory_hostname == (groups[swift_services['swift-proxy-server']['group']] | intersect(ansible_play_hosts)) | first) | bool }}" -_swift_is_first_play_host: "{{ ('swift_hosts' in group_names and inventory_hostname == (groups['swift_hosts'] | intersect(ansible_play_hosts)) | first) | bool }}" +_swift_proxy_is_first_play_host: >- + {{ + (swift_services['swift-proxy-server']['group'] in group_names and + inventory_hostname == (groups[swift_services['swift-proxy-server']['group']] | intersect(ansible_play_hosts)) | first) | bool + }} +_swift_is_first_play_host: >- + {{ ('swift_hosts' in group_names and inventory_hostname == (groups['swift_hosts'] | intersect(ansible_play_hosts)) | first) | bool }} filtered_swift_services: |- {% set services = [] %}