common: do not log keyring secret

let's not display any keyring secret by default in ansible log.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1980744

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/6823/head
Guillaume Abrioux 2021-08-09 14:57:33 +02:00
parent 5e0ace7e54
commit 7511195738
20 changed files with 42 additions and 18 deletions

View File

@ -789,7 +789,7 @@ dummy:
#client_connections: {} #client_connections: {}
#no_log_on_ceph_key_tasks: True
############### ###############
# DEPRECATION # # DEPRECATION #

View File

@ -789,7 +789,7 @@ alertmanager_container_image: registry.redhat.io/openshift4/ose-prometheus-alert
#client_connections: {} #client_connections: {}
#no_log_on_ceph_key_tasks: True
############### ###############
# DEPRECATION # # DEPRECATION #

View File

@ -28,7 +28,7 @@
- cephx | bool - cephx | bool
- keys | length > 0 - keys | length > 0
- inventory_hostname == groups.get('_filtered_clients') | first - inventory_hostname == groups.get('_filtered_clients') | first
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: slurp client cephx key(s) - name: slurp client cephx key(s)
slurp: slurp:
@ -40,7 +40,7 @@
- cephx | bool - cephx | bool
- keys | length > 0 - keys | length > 0
- inventory_hostname == groups.get('_filtered_clients') | first - inventory_hostname == groups.get('_filtered_clients') | first
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: pool related tasks - name: pool related tasks
when: when:
@ -81,5 +81,5 @@
group: "{{ ceph_uid }}" group: "{{ ceph_uid }}"
with_items: "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] }}" with_items: "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] }}"
when: not item.get('skipped', False) when: not item.get('skipped', False)
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"

View File

@ -13,6 +13,7 @@
register: _admin_key register: _admin_key
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true run_once: true
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -21,7 +22,7 @@
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
mode: "{{ ceph_keyring_permissions }}" mode: "{{ ceph_keyring_permissions }}"
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
when: when:
- cephx | bool - cephx | bool
- copy_admin_key | bool - copy_admin_key | bool

View File

@ -19,6 +19,7 @@
CEPH_CONTAINER_BINARY: "{{ container_binary }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}"
delegate_to: "{{ groups.get(mon_group_name, [])[0] }}" delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
run_once: True run_once: True
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: get keys from monitors - name: get keys from monitors
ceph_key: ceph_key:
@ -32,6 +33,7 @@
register: _crash_keys register: _crash_keys
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true run_once: true
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -40,7 +42,7 @@
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
mode: "{{ ceph_keyring_permissions }}" mode: "{{ ceph_keyring_permissions }}"
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: start ceph-crash daemon - name: start ceph-crash daemon
when: containerized_deployment | bool when: containerized_deployment | bool

View File

@ -781,7 +781,7 @@ rbd_devices: {}
client_connections: {} client_connections: {}
no_log_on_ceph_key_tasks: True
############### ###############
# DEPRECATION # # DEPRECATION #

View File

@ -14,6 +14,7 @@
when: when:
- cephx | bool - cephx | bool
- copy_admin_key | bool - copy_admin_key | bool
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -25,7 +26,7 @@
when: when:
- cephx | bool - cephx | bool
- copy_admin_key | bool - copy_admin_key | bool
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: add mgr ip address to trusted list with dashboard - ipv4 - name: add mgr ip address to trusted list with dashboard - ipv4
set_fact: set_fact:

View File

@ -28,6 +28,7 @@
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -40,5 +41,5 @@
when: when:
- cephx | bool - cephx | bool
- item.item.copy_key | bool - item.item.copy_key | bool
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"

View File

@ -35,6 +35,7 @@
owner: ceph owner: ceph
group: ceph group: ceph
mode: "{{ ceph_keyring_permissions }}" mode: "{{ ceph_keyring_permissions }}"
no_log: "{{ no_log_on_ceph_key_tasks }}"
when: cephx | bool when: cephx | bool
- name: ensure systemd service override directory exists - name: ensure systemd service override directory exists

View File

@ -24,6 +24,7 @@
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}"
when: groups.get(mgr_group_name, []) | length == 0 # the key is present already since one of the mons created it in "create ceph mgr keyring(s)" when: groups.get(mgr_group_name, []) | length == 0 # the key is present already since one of the mons created it in "create ceph mgr keyring(s)"
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: create and copy keyrings - name: create and copy keyrings
when: groups.get(mgr_group_name, []) | length > 0 when: groups.get(mgr_group_name, []) | length > 0
@ -46,6 +47,7 @@
with_items: "{{ groups.get(mgr_group_name, []) }}" with_items: "{{ groups.get(mgr_group_name, []) }}"
run_once: True run_once: True
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: set_fact _mgr_keys - name: set_fact _mgr_keys
set_fact: set_fact:
@ -68,6 +70,7 @@
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -81,7 +84,7 @@
- cephx | bool - cephx | bool
- item is not skipped - item is not skipped
- item.item.copy_key | bool - item.item.copy_key | bool
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: set mgr key permissions - name: set mgr key permissions
file: file:

View File

@ -27,5 +27,6 @@
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}"
CEPH_ROLLING_UPDATE: "{{ rolling_update }}" CEPH_ROLLING_UPDATE: "{{ rolling_update }}"
no_log: "{{ no_log_on_ceph_key_tasks }}"
when: when:
- cephx | bool - cephx | bool

View File

@ -17,6 +17,7 @@
run_once: True run_once: True
delegate_to: "{{ running_mon }}" delegate_to: "{{ running_mon }}"
failed_when: initial_mon_key.rc not in [0, 2] failed_when: initial_mon_key.rc not in [0, 2]
no_log: "{{ no_log_on_ceph_key_tasks }}"
when: running_mon is defined when: running_mon is defined
- name: generate monitor initial keyring - name: generate monitor initial keyring
@ -26,6 +27,7 @@
delegate_to: localhost delegate_to: localhost
become: false become: false
run_once: true run_once: true
no_log: "{{ no_log_on_ceph_key_tasks }}"
when: when:
- initial_mon_key is skipped - initial_mon_key is skipped
or or
@ -52,6 +54,7 @@
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
mode: "0400" mode: "0400"
no_log: "{{ no_log_on_ceph_key_tasks }}"
environment: environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}"
@ -98,6 +101,7 @@
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}"
register: create_custom_admin_secret register: create_custom_admin_secret
no_log: "{{ no_log_on_ceph_key_tasks }}"
when: when:
- cephx | bool - cephx | bool
- admin_secret != 'admin_secret' - admin_secret != 'admin_secret'

View File

@ -75,7 +75,7 @@
when: when:
- not item.0.get('skipped', False) - not item.0.get('skipped', False)
- item.0.item.name == 'client.' + ceph_nfs_ceph_user or item.0.item.name == rgw_client_name - item.0.item.name == 'client.' + ceph_nfs_ceph_user or item.0.item.name == rgw_client_name
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: include start_nfs.yml - name: include start_nfs.yml
import_tasks: start_nfs.yml import_tasks: start_nfs.yml

View File

@ -27,6 +27,7 @@
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -39,7 +40,7 @@
when: when:
- cephx | bool - cephx | bool
- item.item.copy_key | bool - item.item.copy_key | bool
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
when: groups.get(mon_group_name, []) | length > 0 when: groups.get(mon_group_name, []) | length > 0
- name: dbus related tasks - name: dbus related tasks

View File

@ -62,6 +62,7 @@
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -74,7 +75,7 @@
when: when:
- cephx | bool - cephx | bool
- item.item.copy_key | bool - item.item.copy_key | bool
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: nfs object gateway related tasks - name: nfs object gateway related tasks
when: nfs_obj_gw | bool when: nfs_obj_gw | bool
@ -93,3 +94,4 @@
owner: ceph owner: ceph
group: ceph group: ceph
mode: "{{ ceph_keyring_permissions }}" mode: "{{ ceph_keyring_permissions }}"
no_log: "{{ no_log_on_ceph_key_tasks }}"

View File

@ -26,6 +26,7 @@
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true run_once: true
no_log: "{{ no_log_on_ceph_key_tasks }}"
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
@ -42,5 +43,5 @@
- cephx | bool - cephx | bool
- item is not skipped - item is not skipped
- item.item.copy_key | bool - item.item.copy_key | bool
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"

View File

@ -35,6 +35,7 @@
CEPH_CONTAINER_BINARY: "{{ container_binary }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}"
with_items: "{{ openstack_keys }}" with_items: "{{ openstack_keys }}"
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: get keys from monitors - name: get keys from monitors
ceph_key: ceph_key:
@ -48,6 +49,7 @@
register: _osp_keys register: _osp_keys
with_items: "{{ openstack_keys }}" with_items: "{{ openstack_keys }}"
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -60,7 +62,7 @@
- "{{ _osp_keys.results }}" - "{{ _osp_keys.results }}"
- "{{ groups[mon_group_name] }}" - "{{ groups[mon_group_name] }}"
delegate_to: "{{ item.1 }}" delegate_to: "{{ item.1 }}"
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
when: when:
- cephx | bool - cephx | bool
- openstack_config | bool - openstack_config | bool

View File

@ -17,6 +17,7 @@
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -29,7 +30,7 @@
when: when:
- cephx | bool - cephx | bool
- item.item.copy_key | bool - item.item.copy_key | bool
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: create rbd-mirror keyring - name: create rbd-mirror keyring
ceph_key: ceph_key:
@ -45,4 +46,5 @@
owner: ceph owner: ceph
group: ceph group: ceph
mode: "{{ ceph_keyring_permissions }}" mode: "{{ ceph_keyring_permissions }}"
no_log: "{{ no_log_on_ceph_key_tasks }}"
when: not containerized_deployment | bool when: not containerized_deployment | bool

View File

@ -26,6 +26,7 @@
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
copy: copy:
@ -39,7 +40,7 @@
- cephx | bool - cephx | bool
- item is not skipped - item is not skipped
- item.item.copy_key | bool - item.item.copy_key | bool
no_log: true no_log: "{{ no_log_on_ceph_key_tasks }}"
- name: copy SSL certificate & key data to certificate path - name: copy SSL certificate & key data to certificate path
copy: copy:

View File

@ -13,6 +13,7 @@
owner: "ceph" owner: "ceph"
group: "ceph" group: "ceph"
mode: "0600" mode: "0600"
no_log: "{{ no_log_on_ceph_key_tasks }}"
environment: environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}" CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}" CEPH_CONTAINER_BINARY: "{{ container_binary }}"