---
- name: Copy over ceph.conf for Glance
  template:
    src: "{{ node_custom_config }}/glance/ceph.conf"
    dest: "{{ node_config_directory }}/glance-api/ceph.conf"
    mode: "0660"
  become: true
  when: inventory_hostname in groups['glance-api']
  notify:
    - Restart glance-api container

- name: Copy over ceph Glance keyring
  template:
    src: "{{ node_custom_config }}/glance/{{ ceph_glance_keyring }}"
    dest: "{{ node_config_directory }}/glance-api/{{ ceph_glance_keyring }}"
    mode: "0660"
  become: true
  when: inventory_hostname in groups['glance-api']
  notify:
    - Restart glance-api container

- name: Ensuring config directory has correct owner and permission
  file:
    path: "{{ node_config_directory }}/glance-api"
    recurse: yes
    owner: "{{ config_owner_user }}"
    group: "{{ config_owner_group }}"
  become: true
  when: inventory_hostname in groups['glance-api']
