Mark Goddard b50917fe2c Fix non-root reconfiguration with ceph enabled
Various ceph-related tasks were missing a 'become' that would allow them
to work as a non-root user. This seems to only cause a problem after an
initial deployment, perhaps due to the recursive ownership & permissions
changes at the end of the ceph.yml and external_ceph.yml files.

This change adds the necessary becomes.

Change-Id: I887c7b3bdef49db1dd1bf9e5bdbf5dc47b7f41af
Closes-Bug: #1795125
2018-10-02 09:16:34 +01:00

55 lines
1.5 KiB
YAML

---
- name: Ensuring config directory exists
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
become: true
when: inventory_hostname in groups[item]
with_items:
- "gnocchi-api"
- "gnocchi-metricd"
- "gnocchi-statsd"
- name: Copy over ceph.conf file
template:
src: "{{ node_custom_config }}/gnocchi/ceph.conf"
dest: "{{ node_config_directory }}/{{ item }}/ceph.conf"
become: true
when: inventory_hostname in groups[item]
with_items:
- "gnocchi-api"
- "gnocchi-metricd"
- "gnocchi-statsd"
notify:
- Restart gnocchi-api container
- Restart gnocchi-metricd container
- Restart gnocchi-statsd container
- name: Copy over ceph gnocchi keyring
copy:
src: "{{ node_custom_config }}/gnocchi/ceph.client.gnocchi.keyring"
dest: "{{ node_config_directory }}/{{ item }}/ceph.client.gnocchi.keyring"
become: true
when: inventory_hostname in groups[item]
with_items:
- "gnocchi-api"
- "gnocchi-metricd"
- "gnocchi-statsd"
notify:
- Restart gnocchi-api container
- Restart gnocchi-metricd container
- Restart gnocchi-statsd container
- name: Ensuring config directory has correct owner and permission
become: true
file:
path: "{{ node_config_directory }}/{{ item }}"
recurse: yes
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
when: inventory_hostname in groups[item]
with_items:
- "gnocchi-api"
- "gnocchi-metricd"
- "gnocchi-statsd"