]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
syntax: change local_action syntax v3.0.22
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 31 Jan 2018 08:23:28 +0000 (09:23 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 31 Jan 2018 11:32:26 +0000 (12:32 +0100)
commit79aecde4d59d80ac74a8d01a520bbb5dce9e63c2
tree1de18164e06f4e37b2756cec20f81de254b8588f
parent4e2ca4dcfcdc80c5fdbfa622ad7cb094dd1c281d
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 <module>
    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 <gabrioux@redhat.com>
(cherry picked from commit deaf273b25601991fc16712cc03820207125554f)
Signed-off-by: Sébastien Han <seb@redhat.com>
22 files changed:
infrastructure-playbooks/purge-cluster.yml
infrastructure-playbooks/untested-by-ci/cluster-maintenance.yml
infrastructure-playbooks/untested-by-ci/cluster-os-migration.yml
roles/ceph-common-coreos/tasks/install_pip.yml
roles/ceph-common-coreos/tasks/install_pypy.yml
roles/ceph-common/tasks/checks/check_firewall.yml
roles/ceph-common/tasks/facts_mon_fsid.yml
roles/ceph-config/tasks/main.yml
roles/ceph-defaults/tasks/facts.yml
roles/ceph-docker-common/tasks/fetch_image.yml
roles/ceph-docker-common/tasks/stat_ceph_files.yml
roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml
roles/ceph-mds/tasks/containerized.yml
roles/ceph-mgr/tasks/docker/copy_configs.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-mon/tasks/docker/copy_configs.yml
roles/ceph-nfs/tasks/pre_requisite_container.yml
roles/ceph-osd/tasks/copy_configs.yml
roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml
roles/ceph-restapi/tasks/docker/copy_configs.yml
roles/ceph-rgw/tasks/docker/copy_configs.yml
tests/functional/reboot.yml [new file with mode: 0644]