b51eeed89e
include is marked as deprecated since ansible 2.4[0] [0] https://docs.ansible.com/ansible/2.4/include_module.html#deprecated Co-Authored-By: confi-surya <singh.surya64mnnit@gmail.com> Change-Id: Ic9d71e1865d1c728890625aeddf424a5734c0a8a
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
---
|
|
- name: Cleaning up temp file on localhost
|
|
local_action: file path=/tmp/kolla_ceph_cluster state=absent
|
|
changed_when: False
|
|
check_mode: no
|
|
run_once: True
|
|
|
|
- name: Creating temp file on localhost
|
|
local_action: copy content=None dest=/tmp/kolla_ceph_cluster mode=0644
|
|
changed_when: False
|
|
check_mode: no
|
|
run_once: True
|
|
|
|
- name: Creating ceph_mon_config volume
|
|
become: true
|
|
kolla_docker:
|
|
action: "create_volume"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "ceph_mon_config"
|
|
register: ceph_mon_config_volume
|
|
|
|
- name: Writing hostname of host with existing cluster files to temp file
|
|
local_action: copy content="{{ inventory_hostname }}" dest=/tmp/kolla_ceph_cluster mode=0644
|
|
changed_when: False
|
|
check_mode: no
|
|
when: not ceph_mon_config_volume.changed
|
|
|
|
- name: Registering host from temp file
|
|
set_fact:
|
|
delegate_host: "{{ lookup('file', '/tmp/kolla_ceph_cluster') }}"
|
|
|
|
- name: Cleaning up temp file on localhost
|
|
local_action: file path=/tmp/kolla_ceph_cluster state=absent
|
|
changed_when: False
|
|
check_mode: no
|
|
run_once: True
|
|
|
|
- include_tasks: generate_cluster.yml
|
|
when: delegate_host == 'None' and inventory_hostname == groups['ceph-mon'][0]
|