41686edba9
always_run is deprecated and removed in Ansible 2.4 check_mode is introduced in Ansible 2.2 and Kolla-ansible bump Ansible to 2.2.0 so it's safe to replace always_run by check_mode now. Change-Id: Id1028d38b7bde30a6afe17b319dcdc77907914ab Closes-Bug: #1643633 Implements: blueprint migrate-to-ansible-2-2-0
36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
---
|
|
- name: Cleaning up temp file on localhost
|
|
local_action: file path=/tmp/kolla_mariadb_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_mariadb_cluster mode=0644
|
|
changed_when: False
|
|
check_mode: no
|
|
run_once: True
|
|
|
|
- name: Creating mariadb volume
|
|
kolla_docker:
|
|
action: "create_volume"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "mariadb"
|
|
register: mariadb_volume
|
|
|
|
- name: Writing hostname of host with existing cluster files to temp file
|
|
local_action: copy content={{ ansible_hostname }} dest=/tmp/kolla_mariadb_cluster mode=0644
|
|
changed_when: False
|
|
check_mode: no
|
|
when: not mariadb_volume | changed
|
|
|
|
- name: Registering host from temp file
|
|
set_fact:
|
|
delegate_host: "{{ lookup('file', '/tmp/kolla_mariadb_cluster') }}"
|
|
|
|
- name: Cleaning up temp file on localhost
|
|
local_action: file path=/tmp/kolla_mariadb_cluster state=absent
|
|
changed_when: False
|
|
check_mode: no
|
|
run_once: True
|