]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
common: do not log keyring secret
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 9 Aug 2021 12:57:33 +0000 (14:57 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 11 Aug 2021 18:59:25 +0000 (14:59 -0400)
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>
(cherry picked from commit 7511195738e9d1e8f3d3ec77ad4473fa90d17d22)

20 files changed:
group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-client/tasks/create_users_keys.yml
roles/ceph-client/tasks/pre_requisite.yml
roles/ceph-crash/tasks/main.yml
roles/ceph-defaults/defaults/main.yml
roles/ceph-iscsi-gw/tasks/common.yml
roles/ceph-mds/tasks/common.yml
roles/ceph-mds/tasks/non_containerized.yml
roles/ceph-mgr/tasks/common.yml
roles/ceph-mon/tasks/ceph_keys.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-nfs/tasks/main.yml
roles/ceph-nfs/tasks/pre_requisite_container.yml
roles/ceph-nfs/tasks/pre_requisite_non_container.yml
roles/ceph-osd/tasks/common.yml
roles/ceph-osd/tasks/openstack_config.yml
roles/ceph-rbd-mirror/tasks/common.yml
roles/ceph-rgw/tasks/common.yml
roles/ceph-rgw/tasks/pre_requisite.yml

index 6044216e7b38ad84e4ce64e1ccf45a2dfc37050b..3c745403eebf7b1ad4f6d013654853cbe763581d 100644 (file)
@@ -795,7 +795,7 @@ dummy:
 
 #client_connections: {}
 
-
+#no_log_on_ceph_key_tasks: True
 
 ###############
 # DEPRECATION #
index c799c4d5c9ac52935b3d52e5a083b4e03b6bd05f..2a556e7e5924ef0e3ec26e29672d317916ed81c5 100644 (file)
@@ -795,7 +795,7 @@ alertmanager_container_image: registry.redhat.io/openshift4/ose-prometheus-alert
 
 #client_connections: {}
 
-
+#no_log_on_ceph_key_tasks: True
 
 ###############
 # DEPRECATION #
index c9512175cd2cf37085ef3e118d25e286fa468bea..33582899c62d6ee213cc84fc487b7400139382bd 100644 (file)
@@ -39,7 +39,7 @@
     - cephx | bool
     - keys | length > 0
     - inventory_hostname == groups.get('_filtered_clients') | first
-  no_log: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: slurp client cephx key(s)
   slurp:
@@ -51,7 +51,7 @@
     - cephx | bool
     - keys | length > 0
     - inventory_hostname == groups.get('_filtered_clients') | first
-  no_log: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: pool related tasks
   when:
@@ -92,5 +92,5 @@
     group: "{{ ceph_uid }}"
   with_items: "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] }}"
   when: not item.get('skipped', False)
-  no_log: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
index e928c664be91bd822fcaa28c583e77377f55d465..92cce4c0b2f81a90cfaf96f504aff4a332137e57 100644 (file)
@@ -13,6 +13,7 @@
       register: _admin_key
       delegate_to: "{{ groups.get(mon_group_name)[0] }}"
       run_once: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -21,7 +22,7 @@
         owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "{{ ceph_keyring_permissions }}"
-      no_log: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
   when:
     - cephx | bool
     - copy_admin_key | bool
index 9723b2477def4f49d7f93205378bf002a651e4c2..51c4aeb58f465e5f8528a50dbf43741b24f113da 100644 (file)
@@ -19,6 +19,7 @@
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
       run_once: True
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: get keys from monitors
       ceph_key:
@@ -32,6 +33,7 @@
       register: _crash_keys
       delegate_to: "{{ groups.get(mon_group_name)[0] }}"
       run_once: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -40,7 +42,7 @@
         owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "{{ ceph_keyring_permissions }}"
-      no_log: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: start ceph-crash daemon
   when: containerized_deployment | bool
index 5a6ee8441dc8491bea16b6968b4adc5e72546711..695e50d3c33e15af34becdfcf30a678b8b01d2a0 100644 (file)
@@ -787,7 +787,7 @@ rbd_devices: {}
 
 client_connections: {}
 
-
+no_log_on_ceph_key_tasks: True
 
 ###############
 # DEPRECATION #
index b43c0e02d117b57090b5a3f7c4442640c507c0b7..3e9ff1ef9fd94dd58c5067f799466ef6c045994e 100644 (file)
@@ -14,6 +14,7 @@
   when:
     - cephx | bool
     - copy_admin_key | bool
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: copy ceph key(s) if needed
   copy:
@@ -25,7 +26,7 @@
   when:
     - cephx | 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
   set_fact:
index d4c9b1f4160f41dc61ba78d6f26d6a57713a2b0a..9e837ddcea788c6c63a2d814a74cb35e086a49eb 100644 (file)
@@ -28,6 +28,7 @@
   when:
     - cephx | bool
     - item.copy_key | bool
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: copy ceph key(s) if needed
   copy:
@@ -40,5 +41,5 @@
   when:
     - cephx | bool
     - item.item.copy_key | bool
-  no_log: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
index ad744ed30341eb9c60b417fe63442be77e2dde1c..cfe6b2703fe11b2b64608a0180af4f727a61acd9 100644 (file)
@@ -35,6 +35,7 @@
     owner: ceph
     group: ceph
     mode: "{{ ceph_keyring_permissions }}"
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   when: cephx | bool
 
 - name: ensure systemd service override directory exists
index d0690d1317f50c3de40fd68d23a13117b6b545fb..4b59e4783e5b53debb24aa5d464d184e5eaa0793 100644 (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_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)"
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: create and copy keyrings
   when: groups.get(mgr_group_name, []) | length > 0
@@ -46,6 +47,7 @@
       with_items: "{{ groups.get(mgr_group_name, []) }}"
       run_once: True
       delegate_to: "{{ groups[mon_group_name][0] }}"
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: set_fact _mgr_keys
       set_fact:
@@ -68,6 +70,7 @@
       when:
         - cephx | bool
         - item.copy_key | bool
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -81,7 +84,7 @@
         - cephx | bool
         - item is not skipped
         - item.item.copy_key | bool
-      no_log: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: set mgr key permissions
   file:
index 02a694f4e11a0b1144281ede1c206c5d57c326f1..7ec8c7d788c3b18453784cdd42207f75e19b9a4c 100644 (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_BINARY: "{{ container_binary }}"
     CEPH_ROLLING_UPDATE: "{{ rolling_update }}"
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   when:
     - cephx | bool
index e057dd32f2dd7ab77765b924d0be1c76d4a92d5e..3c66dcb1994a941b5430c1853edf4a7e721652ef 100644 (file)
@@ -17,6 +17,7 @@
       run_once: True
       delegate_to: "{{ running_mon }}"
       failed_when: initial_mon_key.rc not in [0, 2]
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
       when: running_mon is defined
 
     - name: generate monitor initial keyring
@@ -26,6 +27,7 @@
       delegate_to: localhost
       become: false
       run_once: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
       when:
         - initial_mon_key is skipped
           or
@@ -52,6 +54,7 @@
         owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "0400"
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
       environment:
         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_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
   register: create_custom_admin_secret
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   when:
     - cephx | bool
     - admin_secret != 'admin_secret'
index 2169908acae36565ffd41638ce56b06a840e18aa..aa609d8c81a02f1ddb886107b2672500595f25df 100644 (file)
@@ -75,7 +75,7 @@
       when:
         - not item.0.get('skipped', False)
         - 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
   import_tasks: start_nfs.yml
index 599f78f8287d522430369e9460679e069610f51a..8c168f39cda2ffc095e21a5304d7d4e1fb50c68c 100644 (file)
@@ -27,6 +27,7 @@
       when:
         - cephx | bool
         - item.copy_key | bool
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -39,7 +40,7 @@
       when:
         - cephx | 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
 
 - name: dbus related tasks
index f197eec9d6adb5b3b4a4457d1eac3c97e1965cb8..12e50874a962ee57c345027639808bf2291799ec 100644 (file)
@@ -62,6 +62,7 @@
       when:
         - cephx | bool
         - item.copy_key | bool
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -74,7 +75,7 @@
       when:
         - cephx | bool
         - item.item.copy_key | bool
-      no_log: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: nfs object gateway related tasks
       when: nfs_obj_gw | bool
@@ -93,3 +94,4 @@
             owner: ceph
             group: ceph
             mode: "{{ ceph_keyring_permissions }}"
+          no_log: "{{ no_log_on_ceph_key_tasks }}"
\ No newline at end of file
index 86087cec19a3f807e4e36f940739e8b90faae5d5..ac690e46faa9f174cadba6935cb2a3efb8aba867 100644 (file)
@@ -26,6 +26,7 @@
     - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
   delegate_to: "{{ groups.get(mon_group_name)[0] }}"
   run_once: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   when:
     - cephx | bool
     - item.copy_key | bool
@@ -42,5 +43,5 @@
     - cephx | bool
     - item is not skipped
     - item.item.copy_key | bool
-  no_log: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
index 254f86a18d3d3202b004828644da1d52daf07e68..6b05d2c3a300518392e8930373e78828140f92c6 100644 (file)
@@ -35,6 +35,7 @@
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       with_items: "{{ openstack_keys }}"
       delegate_to: "{{ groups[mon_group_name][0] }}"
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: get keys from monitors
       ceph_key:
@@ -48,6 +49,7 @@
       register: _osp_keys
       with_items: "{{ openstack_keys }}"
       delegate_to: "{{ groups.get(mon_group_name)[0] }}"
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -60,7 +62,7 @@
         - "{{ _osp_keys.results }}"
         - "{{ groups[mon_group_name] }}"
       delegate_to: "{{ item.1 }}"
-      no_log: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
   when:
     - cephx | bool
     - openstack_config | bool
index a47da60e6dbb9816e16554a6d039b45477ba3ac2..a33147818ef0d6c517913349ecbb74e6b623bf45 100644 (file)
@@ -17,6 +17,7 @@
   when:
     - cephx | bool
     - item.copy_key | bool
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: copy ceph key(s) if needed
   copy:
@@ -29,7 +30,7 @@
   when:
     - cephx | bool
     - item.item.copy_key | bool
-  no_log: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: create rbd-mirror keyring
   ceph_key:
@@ -45,4 +46,5 @@
     owner: ceph
     group: ceph
     mode: "{{ ceph_keyring_permissions }}"
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   when: not containerized_deployment | bool
index 237f110f60b727acf47512ef4c09c022f41cd65e..e25fb4d244945642865091528e3d6db8f7015862 100644 (file)
@@ -26,6 +26,7 @@
   when:
     - cephx | bool
     - item.copy_key | bool
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: copy ceph key(s) if needed
   copy:
@@ -39,7 +40,7 @@
     - cephx | bool
     - item is not skipped
     - 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
   copy:
index c10fbf5e362625fce5578426f5c94cad48238c56..af42f688f19a8460f93b827e8ec096833097b49b 100644 (file)
@@ -13,6 +13,7 @@
     owner: "ceph"
     group: "ceph"
     mode: "0600"
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   environment:
     CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"