From deaf273b25601991fc16712cc03820207125554f Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 31 Jan 2018 09:23:28 +0100 Subject: [PATCH] syntax: change local_action syntax Use a nicer syntax for `local_action` tasks. We used to have oneliner like this: ``` local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }} ``` The usual syntax: ``` local_action: module: wait_for port: 22 host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}" state: started delay: 10 timeout: 500 ``` is nicer and kind of way to keep consistency regarding the whole playbook. This also fix a potential issue about missing quotation : ``` Traceback (most recent call last): File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in main() File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin) File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command File "/usr/lib64/python2.7/shlex.py", line 279, in split return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next token = self.get_token() File "/usr/lib64/python2.7/shlex.py", line 96, in get_token raw = self.read_token() File "/usr/lib64/python2.7/shlex.py", line 172, in read_token raise ValueError, "No closing quotation" ValueError: No closing quotation ``` writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf` can cause trouble because it's complaining with missing quotes, this fix solves this issue. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555 Signed-off-by: Guillaume Abrioux --- infrastructure-playbooks/purge-cluster.yml | 8 +- .../untested-by-ci/cluster-maintenance.yml | 20 ++-- .../untested-by-ci/cluster-os-migration.yml | 98 +++++++++---------- .../ceph-common-coreos/tasks/install_pip.yml | 14 ++- .../ceph-common-coreos/tasks/install_pypy.yml | 14 ++- .../tasks/checks/check_firewall.yml | 20 +++- roles/ceph-common/tasks/facts_mon_fsid.yml | 4 +- roles/ceph-config/tasks/main.yml | 22 +++-- roles/ceph-defaults/tasks/facts.yml | 27 +++-- .../ceph-docker-common/tasks/fetch_image.yml | 4 +- .../tasks/stat_ceph_files.yml | 4 +- roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml | 4 +- roles/ceph-mds/tasks/containerized.yml | 4 +- roles/ceph-mgr/tasks/docker/copy_configs.yml | 4 +- roles/ceph-mon/tasks/deploy_monitors.yml | 12 ++- roles/ceph-mon/tasks/docker/copy_configs.yml | 4 +- .../tasks/pre_requisite_container.yml | 4 +- roles/ceph-osd/tasks/copy_configs.yml | 8 +- .../tasks/docker/copy_configs.yml | 4 +- .../tasks/docker/copy_configs.yml | 4 +- roles/ceph-rgw/tasks/docker/copy_configs.yml | 4 +- tests/functional/reboot.yml | 8 +- 22 files changed, 193 insertions(+), 102 deletions(-) diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index c04c408a5..c142525e5 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -213,7 +213,13 @@ - name: wait for server to boot become: false - local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 + local_action: + module: wait_for + port: 22 + host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}" + state: started + delay: 10 + timeout: 500 - name: remove data file: diff --git a/infrastructure-playbooks/untested-by-ci/cluster-maintenance.yml b/infrastructure-playbooks/untested-by-ci/cluster-maintenance.yml index c559ed62f..3d8b8afe7 100644 --- a/infrastructure-playbooks/untested-by-ci/cluster-maintenance.yml +++ b/infrastructure-playbooks/untested-by-ci/cluster-maintenance.yml @@ -20,17 +20,19 @@ command: poweroff - name: Wait for the server to go down - local_action: > - wait_for host= - port=22 - state=stopped + local_action: + module: wait_for + host: + port: 22 + state: stopped - name: Wait for the server to come up - local_action: > - wait_for host= - port=22 - delay=10 - timeout=3600 + local_action: + module: wait_for + host: + port: 22 + delay: 10 + timeout: 3600 - name: Unset the noout flag command: ceph osd unset noout diff --git a/infrastructure-playbooks/untested-by-ci/cluster-os-migration.yml b/infrastructure-playbooks/untested-by-ci/cluster-os-migration.yml index 843056f64..e09d85bfc 100644 --- a/infrastructure-playbooks/untested-by-ci/cluster-os-migration.yml +++ b/infrastructure-playbooks/untested-by-ci/cluster-os-migration.yml @@ -81,11 +81,11 @@ when: monsysvinit.stat.exists == True and migration_completed.stat.exists == False - name: Wait for the monitor to be up again - local_action: > - wait_for - host={{ ansible_ssh_host | default(inventory_hostname) }} - port=6789 - timeout=10 + local_action: + module: wait_for + host: "{{ ansible_ssh_host | default(inventory_hostname) }}" + port: 6789 + timeout: 10 when: migration_completed.stat.exists == False - name: Stop the monitor (Upstart) @@ -103,12 +103,12 @@ when: monsysvinit.stat.exists == True and migration_completed.stat.exists == False - name: Wait for the monitor to be down - local_action: > - wait_for - host={{ ansible_ssh_host | default(inventory_hostname) }} - port=6789 - timeout=10 - state=stopped + local_action: + module: wait_for + host: "{{ ansible_ssh_host | default(inventory_hostname) }}" + port: 6789 + timeout: 10 + state: stopped when: migration_completed.stat.exists == False - name: Create a backup directory @@ -142,11 +142,11 @@ when: migration_completed.stat.exists == False - name: Wait for the server to come up - local_action: > - wait_for - port=22 - delay=10 - timeout=3600 + local_action: + module: wait_for + port: 22 + delay: 10 + timeout: 3600 when: migration_completed.stat.exists == False - name: Wait a bit more to be sure that the server is ready @@ -209,11 +209,11 @@ when: migration_completed.stat.exists == False - name: Wait for the Monitor to be up again - local_action: > - wait_for - host={{ ansible_ssh_host | default(inventory_hostname) }} - port=6789 - timeout=10 + local_action: + module: wait_for + host: "{{ ansible_ssh_host | default(inventory_hostname) }}" + port: 6789 + timeout: 10 when: migration_completed.stat.exists == False - name: Waiting for the monitor to join the quorum... @@ -339,12 +339,12 @@ when: osdsysvinit.rc == 0 and migration_completed.stat.exists == False - name: Wait for the OSDs to be down - local_action: > - wait_for - host={{ ansible_ssh_host | default(inventory_hostname) }} - port={{ item }} - timeout=10 - state=stopped + local_action: + module: wait_for + host: "{{ ansible_ssh_host | default(inventory_hostname) }}" + port: {{ item }} + timeout: 10 + state: stopped with_items: "{{ osd_ports.stdout_lines }}" when: migration_completed.stat.exists == False @@ -357,11 +357,11 @@ when: migration_completed.stat.exists == False - name: Wait for the server to come up - local_action: > - wait_for - port=22 - delay=10 - timeout=3600 + local_action: + module: wait_for + port: 22 + delay: 10 + timeout: 3600 when: migration_completed.stat.exists == False - name: Wait a bit to be sure that the server is ready for scp @@ -486,12 +486,12 @@ when: migration_completed.stat.exists == False - name: Wait for radosgw to be down - local_action: > - wait_for - host={{ ansible_ssh_host | default(inventory_hostname) }} - path=/tmp/radosgw.sock - state=absent - timeout=30 + local_action: + module: wait_for + host: "{{ ansible_ssh_host | default(inventory_hostname) }}" + path: /tmp/radosgw.sock + state: absent + timeout: 30 when: migration_completed.stat.exists == False - name: Reboot the server @@ -499,11 +499,11 @@ when: migration_completed.stat.exists == False - name: Wait for the server to come up - local_action: > - wait_for - port=22 - delay=10 - timeout=3600 + local_action: + module: wait_for + port: 22 + delay: 10 + timeout: 3600 when: migration_completed.stat.exists == False - name: Wait a bit to be sure that the server is ready for scp @@ -537,12 +537,12 @@ when: migration_completed.stat.exists == False - name: Wait for radosgw to be up again - local_action: > - wait_for - host={{ ansible_ssh_host | default(inventory_hostname) }} - path=/tmp/radosgw.sock - state=present - timeout=30 + local_action: + module: wait_for + host: "{{ ansible_ssh_host | default(inventory_hostname) }}" + path: /tmp/radosgw.sock + state: present + timeout: 30 when: migration_completed.stat.exists == False - name: Done moving to the next rados gateway diff --git a/roles/ceph-common-coreos/tasks/install_pip.yml b/roles/ceph-common-coreos/tasks/install_pip.yml index a7b759d42..c2c85bb28 100644 --- a/roles/ceph-common-coreos/tasks/install_pip.yml +++ b/roles/ceph-common-coreos/tasks/install_pip.yml @@ -6,11 +6,16 @@ raw: "{{pypy_binary_directory}}/python $HOME/get-pip.py --proxy='{{ lookup('env', 'https_proxy') }}'" - name: create local temp directory - local_action: raw mkdir -p {{local_temp_directory}} + local_action: + module: raw + mkdir -p {{local_temp_directory}} become: no - name: prepare install_pip.sh - local_action: template src=install_pip.sh.j2 dest={{local_temp_directory}}/install_pip.sh + local_action: + module: template + src: install_pip.sh.j2 + dest: "{{local_temp_directory}}/install_pip.sh" become: no - name: run pip.sh @@ -29,5 +34,8 @@ raw: touch $HOME/.pip - name: remove pip.sh - local_action: file path="{{local_temp_directory}}/pip.sh" state=absent + local_action: + module: file + path: "{{local_temp_directory}}/pip.sh" + state: absent become: no diff --git a/roles/ceph-common-coreos/tasks/install_pypy.yml b/roles/ceph-common-coreos/tasks/install_pypy.yml index c49c80d10..41b6e6fd1 100644 --- a/roles/ceph-common-coreos/tasks/install_pypy.yml +++ b/roles/ceph-common-coreos/tasks/install_pypy.yml @@ -9,11 +9,16 @@ raw: mv $HOME/pypy-{{coreos_pypy_version}}-{{coreos_pypy_arch}} {{pypy_directory}} - name: create local temp directory - local_action: raw mkdir -p {{local_temp_directory}} + local_action: + module: raw + mkdir -p {{local_temp_directory}} become: no - name: prepare python executable - local_action: template src=install_python.sh.j2 dest={{local_temp_directory}}/install_python.sh + local_action: + module: template + src: install_python.sh.j2 + dest: "{{local_temp_directory}}/install_python.sh" become: no - name: fix library @@ -32,5 +37,8 @@ raw: touch $HOME/.python - name: remove install_python.sh - local_action: file path="{{local_temp_directory}}/install_python.sh" state=absent + local_action: + module: file + path: "{{local_temp_directory}}/install_python.sh" + state: absent become: no diff --git a/roles/ceph-common/tasks/checks/check_firewall.yml b/roles/ceph-common/tasks/checks/check_firewall.yml index f52d612f4..f5ed17638 100644 --- a/roles/ceph-common/tasks/checks/check_firewall.yml +++ b/roles/ceph-common/tasks/checks/check_firewall.yml @@ -15,7 +15,9 @@ - nmapexist.rc != 0 - name: check if monitor port is not filtered - local_action: shell set -o pipefail && nmap -p 6789 {{ hostvars[inventory_hostname]['ansible_' + monitor_interface]['ipv4']['address'] if hostvars[inventory_hostname]['ansible_' + monitor_interface] is defined else hostvars[inventory_hostname]['monitor_address'] }} | grep -sqo -e filtered -e '0 hosts up' + local_action: + module: shell + set -o pipefail && nmap -p 6789 {{ hostvars[inventory_hostname]['ansible_' + monitor_interface]['ipv4']['address'] if hostvars[inventory_hostname]['ansible_' + monitor_interface] is defined else hostvars[inventory_hostname]['monitor_address'] }} | grep -sqo -e filtered -e '0 hosts up' changed_when: false failed_when: false register: monportstate @@ -33,7 +35,9 @@ - monportstate.rc == 0 - name: check if osd and mds range is not filtered (osd hosts) - local_action: shell set -o pipefail && nmap -p 6800-7300 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up' + local_action: + module: shell + set -o pipefail && nmap -p 6800-7300 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up' changed_when: false failed_when: false register: osdrangestate @@ -51,7 +55,9 @@ - osdrangestate.rc == 0 - name: check if osd and mds range is not filtered (mds hosts) - local_action: shell set -o pipefail && nmap -p 6800-7300 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up' + local_action: + module: shell + set -o pipefail && nmap -p 6800-7300 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up' changed_when: false failed_when: false register: mdsrangestate @@ -69,7 +75,9 @@ - mdsrangestate.rc == 0 - name: check if rados gateway port is not filtered - local_action: shell set -o pipefail && nmap -p {{ radosgw_civetweb_port }} {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up' + local_action: + module: shell + set -o pipefail && nmap -p {{ radosgw_civetweb_port }} {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up' changed_when: false failed_when: false register: rgwportstate @@ -87,7 +95,9 @@ - rgwportstate.rc == 0 - name: check if NFS ports are not filtered - local_action: shell set -o pipefail && nmap -p 111,2049 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up' + local_action: + module: shell + set -o pipefail && nmap -p 111,2049 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up' changed_when: false failed_when: false register: nfsportstate diff --git a/roles/ceph-common/tasks/facts_mon_fsid.yml b/roles/ceph-common/tasks/facts_mon_fsid.yml index 683ff0cf6..f1038426e 100644 --- a/roles/ceph-common/tasks/facts_mon_fsid.yml +++ b/roles/ceph-common/tasks/facts_mon_fsid.yml @@ -31,7 +31,9 @@ - test_initial_monitor_keyring.rc != 0 - name: write initial mon keyring in {{ fetch_directory }}/monitor_keyring.conf if it doesn't exist - local_action: shell echo {{ monitor_keyring.stdout }} | tee {{ fetch_directory }}/monitor_keyring.conf + local_action: + module: shell + echo {{ monitor_keyring.stdout }} | tee {{ fetch_directory }}/monitor_keyring.conf become: false when: - test_initial_monitor_keyring.rc == 0 diff --git a/roles/ceph-config/tasks/main.yml b/roles/ceph-config/tasks/main.yml index 284a9ef40..570db49b0 100644 --- a/roles/ceph-config/tasks/main.yml +++ b/roles/ceph-config/tasks/main.yml @@ -33,7 +33,10 @@ state: absent - name: remove tmp template file for ceph_conf_overrides (localhost) - local_action: file path="{{ fetch_directory }}/{{ fsid }}/ceph_conf_overrides_temp_{{ ansible_hostname }}" state=absent + local_action: + module: file + path: "{{ fetch_directory }}/{{ fsid }}/ceph_conf_overrides_temp_{{ ansible_hostname }}" + state: absent become: false - name: "generate ceph configuration file: {{ cluster }}.conf" @@ -72,7 +75,10 @@ # we are not population kv_store with default ceph.conf AND there at least 1 nfs in nfs group AND host is the first nfs - block: - name: create a local fetch directory if it does not exist - local_action: file path={{ fetch_directory }} state=directory + local_action: + module: file + path: "{{ fetch_directory }}" + state: directory changed_when: false become: false run_once: true @@ -85,16 +91,20 @@ and (inventory_hostname == groups.get(nfs_group_name, [])[0]))) - name: generate cluster uuid - local_action: shell python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf - creates="{{ fetch_directory }}/ceph_cluster_uuid.conf" + local_action: + module: shell + python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf + creates: "{{ fetch_directory }}/ceph_cluster_uuid.conf" register: cluster_uuid become: false when: - generate_fsid - name: read cluster uuid if it already exists - local_action: command cat {{ fetch_directory }}/ceph_cluster_uuid.conf - removes="{{ fetch_directory }}/ceph_cluster_uuid.conf" + local_action: + module: command + cat {{ fetch_directory }}/ceph_cluster_uuid.conf + removes: "{{ fetch_directory }}/ceph_cluster_uuid.conf" changed_when: false register: cluster_uuid check_mode: no diff --git a/roles/ceph-defaults/tasks/facts.yml b/roles/ceph-defaults/tasks/facts.yml index 040c88c7a..120e6b486 100644 --- a/roles/ceph-defaults/tasks/facts.yml +++ b/roles/ceph-defaults/tasks/facts.yml @@ -34,7 +34,9 @@ # We want this check to be run only on the first node - name: check if {{ fetch_directory }} directory exists - local_action: stat path="{{ fetch_directory }}/monitor_keyring.conf" + local_action: + module: stat + path: "{{ fetch_directory }}/monitor_keyring.conf" become: false register: monitor_keyring_conf run_once: true @@ -49,7 +51,10 @@ - rolling_update or groups.get(mon_group_name, []) | length == 0 - name: create a local fetch directory if it does not exist - local_action: file path={{ fetch_directory }} state=directory + local_action: + module: file + path: "{{ fetch_directory }}" + state: directory changed_when: false become: false run_once: true @@ -68,8 +73,10 @@ ceph_release: "{{ ceph_stable_release }}" - name: generate cluster fsid - local_action: shell python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf - creates="{{ fetch_directory }}/ceph_cluster_uuid.conf" + local_action: + module: shell + python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf + creates: "{{ fetch_directory }}/ceph_cluster_uuid.conf" register: cluster_uuid become: false when: @@ -77,15 +84,19 @@ - ceph_current_fsid.rc != 0 - name: reuse cluster fsid when cluster is already running - local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf - creates="{{ fetch_directory }}/ceph_cluster_uuid.conf" + local_action: + module: shell + echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf + creates: "{{ fetch_directory }}/ceph_cluster_uuid.conf" become: false when: - ceph_current_fsid.rc == 0 - name: read cluster fsid if it already exists - local_action: command cat {{ fetch_directory }}/ceph_cluster_uuid.conf - removes="{{ fetch_directory }}/ceph_cluster_uuid.conf" + local_action: + module: command + cat {{ fetch_directory }}/ceph_cluster_uuid.conf + removes: "{{ fetch_directory }}/ceph_cluster_uuid.conf" changed_when: false register: cluster_uuid become: false diff --git a/roles/ceph-docker-common/tasks/fetch_image.yml b/roles/ceph-docker-common/tasks/fetch_image.yml index 77b3d9008..d357ab83f 100644 --- a/roles/ceph-docker-common/tasks/fetch_image.yml +++ b/roles/ceph-docker-common/tasks/fetch_image.yml @@ -49,7 +49,9 @@ - repodigest_before_pulling == repodigest_after_pulling - name: export local ceph dev image - local_action: command docker save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar" "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}" + local_action: + module: command + docker save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar" "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}" when: - (ceph_docker_dev_image is defined and ceph_docker_dev_image) run_once: true diff --git a/roles/ceph-docker-common/tasks/stat_ceph_files.yml b/roles/ceph-docker-common/tasks/stat_ceph_files.yml index add07fcc4..c92315592 100644 --- a/roles/ceph-docker-common/tasks/stat_ceph_files.yml +++ b/roles/ceph-docker-common/tasks/stat_ceph_files.yml @@ -28,7 +28,9 @@ when: groups.get(mgr_group_name, []) | length > 0 - name: stat for ceph config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml b/roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml index 1b3a05d5d..fe5b4f8df 100644 --- a/roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml +++ b/roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml @@ -8,7 +8,9 @@ - "/etc/ceph/iscsi-gateway-pub.key" - name: stat for crt file(s) - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ crt_files }}" changed_when: false failed_when: false diff --git a/roles/ceph-mds/tasks/containerized.yml b/roles/ceph-mds/tasks/containerized.yml index e928bd786..7be1b7dfd 100644 --- a/roles/ceph-mds/tasks/containerized.yml +++ b/roles/ceph-mds/tasks/containerized.yml @@ -9,7 +9,9 @@ - /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring - name: stat for ceph config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/roles/ceph-mgr/tasks/docker/copy_configs.yml b/roles/ceph-mgr/tasks/docker/copy_configs.yml index 024acca18..db446b7fb 100644 --- a/roles/ceph-mgr/tasks/docker/copy_configs.yml +++ b/roles/ceph-mgr/tasks/docker/copy_configs.yml @@ -6,7 +6,9 @@ - /etc/ceph/{{ cluster }}.client.admin.keyring - name: stat for ceph config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/roles/ceph-mon/tasks/deploy_monitors.yml b/roles/ceph-mon/tasks/deploy_monitors.yml index a35150b86..f9e34a69b 100644 --- a/roles/ceph-mon/tasks/deploy_monitors.yml +++ b/roles/ceph-mon/tasks/deploy_monitors.yml @@ -1,14 +1,18 @@ --- - name: generate monitor initial keyring - local_action: shell python2 -c "import os ; import struct ; import time; import base64 ; key = os.urandom(16) ; header = struct.pack(' 0 - name: stat for ceph config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/roles/ceph-nfs/tasks/pre_requisite_container.yml b/roles/ceph-nfs/tasks/pre_requisite_container.yml index 50e5f264c..b7deb56cc 100644 --- a/roles/ceph-nfs/tasks/pre_requisite_container.yml +++ b/roles/ceph-nfs/tasks/pre_requisite_container.yml @@ -5,7 +5,9 @@ - /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring - name: stat for config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/roles/ceph-osd/tasks/copy_configs.yml b/roles/ceph-osd/tasks/copy_configs.yml index da98e7729..71af13065 100644 --- a/roles/ceph-osd/tasks/copy_configs.yml +++ b/roles/ceph-osd/tasks/copy_configs.yml @@ -5,12 +5,16 @@ - /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring - name: wait for ceph.conf and keys - local_action: wait_for path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: wait_for + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" become: false with_items: "{{ ceph_config_keys }}" - name: stat for ceph config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml b/roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml index 42740b762..0741895e2 100644 --- a/roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml +++ b/roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml @@ -12,7 +12,9 @@ - "{{ bootstrap_rbd_keyring | default('') }}" - name: stat for ceph config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/roles/ceph-restapi/tasks/docker/copy_configs.yml b/roles/ceph-restapi/tasks/docker/copy_configs.yml index cec96182c..f3da4fce3 100644 --- a/roles/ceph-restapi/tasks/docker/copy_configs.yml +++ b/roles/ceph-restapi/tasks/docker/copy_configs.yml @@ -5,7 +5,9 @@ - /etc/ceph/{{ cluster }}.client.admin.keyring - name: stat for ceph config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/roles/ceph-rgw/tasks/docker/copy_configs.yml b/roles/ceph-rgw/tasks/docker/copy_configs.yml index a5500f52a..c22e24d49 100644 --- a/roles/ceph-rgw/tasks/docker/copy_configs.yml +++ b/roles/ceph-rgw/tasks/docker/copy_configs.yml @@ -5,7 +5,9 @@ - /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring - name: stat for ceph config and keys - local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }} + local_action: + module: stat + path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" with_items: "{{ ceph_config_keys }}" changed_when: false become: false diff --git a/tests/functional/reboot.yml b/tests/functional/reboot.yml index dbefdef4c..50b6dc8ca 100644 --- a/tests/functional/reboot.yml +++ b/tests/functional/reboot.yml @@ -10,7 +10,13 @@ poll: 0 - name: waiting 3 minutes for the machines to come back - local_action: wait_for host={{ ansible_default_ipv4.address }} port=22 state=started delay=30 timeout=180 + local_action: + module: wait_for + host: "{{ ansible_default_ipv4.address }}" + port: 22 + state: started + delay: 30 + timeout: 180 - name: uptime command: uptime -- 2.39.5