kolla-ansible/ansible/roles/ceph/tasks/bootstrap_mons.yml
Christian Berendt 924fbb6f7a Fix permissions of tmp files
When running kolla-ansible as non-root users the tmp files will
be created with become user as owner and mode 0600. This way the user
running kolla-ansible is not able to read the generated files. This
is necessary because of the use of the lookup method, which will
not run as become user.

TrivialFix

Change-Id: If86d114c05a9b2e7fa240718611d78e93100ebdf
2016-09-13 13:30:25 +02:00

39 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
always_run: True
run_once: True
- name: Creating temp file on localhost
local_action: copy content=None dest=/tmp/kolla_ceph_cluster mode=0644
changed_when: False
always_run: True
run_once: True
- name: Creating ceph_mon_config volume
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
always_run: True
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
always_run: True
run_once: True
- include: generate_cluster.yml
when: delegate_host == 'None' and inventory_hostname == groups['ceph-mon'][0]