Merge "[external-ceph] Use template instead of copy"

This commit is contained in:
Zuul 2022-03-19 00:04:33 +00:00 committed by Gerrit Code Review
commit ed148cd8dd
6 changed files with 17 additions and 9 deletions

View File

@ -20,7 +20,7 @@
- Restart {{ item.key }} container
- name: Copy over Ceph keyring files for cinder-volume
copy:
template:
src: "{{ node_custom_config }}/cinder/cinder-volume/{{ ceph_cinder_keyring }}"
dest: "{{ node_config_directory }}/cinder-volume/"
mode: "0660"
@ -33,7 +33,7 @@
- Restart cinder-volume container
- name: Copy over Ceph keyring files for cinder-backup
copy:
template:
src: "{{ node_custom_config }}/cinder/{{ item }}"
dest: "{{ node_config_directory }}/cinder-backup/"
mode: "0660"

View File

@ -10,7 +10,7 @@
- Restart glance-api container
- name: Copy over ceph Glance keyring
copy:
template:
src: "{{ node_custom_config }}/glance/{{ ceph_glance_keyring }}"
dest: "{{ node_config_directory }}/glance-api/{{ ceph_glance_keyring }}"
mode: "0660"

View File

@ -13,7 +13,7 @@
- Restart {{ item.key }} container
- name: Copy over ceph gnocchi keyring
copy:
template:
src: "{{ node_custom_config }}/gnocchi/{{ ceph_gnocchi_keyring }}"
dest: "{{ node_config_directory }}/{{ item.key }}/{{ ceph_gnocchi_keyring }}"
mode: "0660"

View File

@ -11,7 +11,7 @@
- Restart manila-share container
- name: Copy over Ceph keyring files for manila
copy:
template:
src: "{{ node_custom_config }}/manila/{{ ceph_manila_keyring }}"
dest: "{{ node_config_directory }}/manila-share/{{ ceph_manila_keyring }}"
mode: "0600"

View File

@ -32,7 +32,7 @@
- external_ceph_cephx_enabled | bool
- name: Copy over ceph nova keyring file
copy:
template:
src: "{{ nova_cephx_keyring_file.stat.path }}"
dest: "{{ node_config_directory }}/{{ item }}/"
mode: "0660"
@ -47,7 +47,7 @@
- Restart {{ item }} container
- name: Copy over ceph cinder keyring file
copy:
template:
src: "{{ cinder_cephx_keyring_file.stat.path }}"
dest: "{{ node_config_directory }}/{{ item }}/"
mode: "0660"
@ -98,7 +98,7 @@
- name: Extract nova key from file
set_fact:
nova_cephx_raw_key:
"{{ lookup('file', nova_cephx_keyring_file.stat.path) | regex_search('key\\s*=.*$', multiline=True) | regex_replace('key\\s*=\\s*(.*)\\s*', '\\1') }}"
"{{ lookup('template', nova_cephx_keyring_file.stat.path) | regex_search('key\\s*=.*$', multiline=True) | regex_replace('key\\s*=\\s*(.*)\\s*', '\\1') }}"
changed_when: false
run_once: True
when:
@ -108,7 +108,7 @@
- name: Extract cinder key from file
set_fact:
cinder_cephx_raw_key:
"{{ lookup('file', cinder_cephx_keyring_file.stat.path) | regex_search('key\\s*=.*$', multiline=True) | regex_replace('key\\s*=\\s*(.*)\\s*', '\\1') }}"
"{{ lookup('template', cinder_cephx_keyring_file.stat.path) | regex_search('key\\s*=.*$', multiline=True) | regex_replace('key\\s*=\\s*(.*)\\s*', '\\1') }}"
changed_when: false
run_once: True
when:

View File

@ -0,0 +1,8 @@
---
features:
- |
Allows the use of variables in ceph conf and keyring files.
Consistently use template instead of copy. This has the added
advantage of allowing variables inside ceph conf files and keyrings.
Including but not limited to ansible lookup expressions.
`LP#1959565 <https://launchpad.net/bugs/1959565>`__