kolla-ansible/ansible/roles/mariadb/tasks/lookup_cluster.yml
Eduardo Gonzalez f56d8e58ba Revert "updating-deprecated-ansible-modules"
check_mode option is included in Ansible 2.2.
Using in our playbooks mean that any other version before
Ansible 2.2 can be used

This reverts commit 529f202d00.

Change-Id: I3af96290443d760346264e6d994fd2a44de65543
Closes-Bug: #1644828
2016-11-25 14:41:38 +00:00

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
always_run: True
run_once: True
- name: Creating temp file on localhost
local_action: copy content=None dest=/tmp/kolla_mariadb_cluster mode=0644
changed_when: False
always_run: True
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
always_run: True
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
always_run: True
run_once: True