]> git.apps.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 21:01:09 +0000 (17:01 -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 e9c9000d5359c7f29434e2706e281c9fd77ff417..e7b021609241eb0858fa87f6947a0a6d0ad235ff 100644 (file)
@@ -800,7 +800,7 @@ dummy:
 
 #client_connections: {}
 
-
+#no_log_on_ceph_key_tasks: True
 
 ###############
 # DEPRECATION #
index 06ef04731f0da62bedc5bccd136c345b40fc8082..758dfac4cc1bfd611fd05604394155c382984e42 100644 (file)
@@ -800,7 +800,7 @@ alertmanager_container_image: registry.redhat.io/openshift4/ose-prometheus-alert
 
 #client_connections: {}
 
-
+#no_log_on_ceph_key_tasks: True
 
 ###############
 # DEPRECATION #
index 047246ae1a39a1d329a9e53fdcb4c0c1f8c5d4c1..f5be1a2ade3655c0075674da5c48eefe9bb23e78 100644 (file)
@@ -28,7 +28,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:
@@ -40,7 +40,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:
@@ -81,5 +81,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 1f144f7766ebeb68adf77f48fb2df281729d56f7..46cbcc05ad568819135c67e303b6146d305df2ba 100644 (file)
@@ -11,6 +11,7 @@
       when:
         - cephx | bool
         - item.copy_key | bool
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -22,5 +23,5 @@
       with_items: "{{ _client_keys.results }}"
       when:
         - item.item.copy_key | bool
-      no_log: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
   when: cephx | bool
index 89536f4d575f285b8d86546741ac89d8a8be2203..6db9028867b75ea37b5fd9ff8498c0e2fa4a99c4 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: enforce container_binary on first monitor
       import_role:
@@ -42,6 +43,7 @@
       check_mode: False
       changed_when: False
       run_once: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -50,7 +52,7 @@
         owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
         group: "{{ ceph_uid if containerized_deployment 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 c38bb9c80b267ba00808f5eb58b9aeb6b15c0d6c..5dd478ea7ae5d40f043fb25c70df96a7e4e5d4ff 100644 (file)
@@ -792,7 +792,7 @@ rbd_devices: {}
 
 client_connections: {}
 
-
+no_log_on_ceph_key_tasks: True
 
 ###############
 # DEPRECATION #
index ceafd0466ff3ca3fa6c324dbe826733da7514597..600a80950ae1c3f0d315164b5173742de41283d1 100644 (file)
@@ -9,6 +9,7 @@
   when:
     - cephx | bool
     - item.copy_key | bool
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: copy ceph key(s) if needed
   copy:
@@ -21,7 +22,7 @@
   when:
     - cephx | bool
     - item.item.copy_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 48d90d27956f00b59818d2d97f21b4ffe7ed1a83..01b94b8710f4bb1db162bacb5ad3eab57d3340ed 100644 (file)
@@ -21,6 +21,7 @@
   when:
     - cephx | bool
     - item.copy_key | bool
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: copy ceph key(s) if needed
   copy:
@@ -33,5 +34,5 @@
   when:
     - cephx | bool
     - item.item.copy_key | bool
-  no_log: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
index 55d0521dfd2a6996428146a788250661bfa97ebc..7aaf154236f4617f7c4e4a32d50012d786c97d23 100644 (file)
@@ -25,6 +25,7 @@
   args:
     creates: /var/lib/ceph/mds/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring
   changed_when: false
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   when: cephx
 
 - name: set mds key permissions
index 87f8f7c9a9f517f3f5e3eb772982d5e4ebc23a02..c9a92927aa3295cdae90d1bd4b7da243ba84e059 100644 (file)
@@ -24,6 +24,7 @@
     CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment 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:
@@ -61,6 +63,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 +77,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 ff4640b1fd478adaf91063c23b843ff9c9aafced..102d35b8a1f5d362b5b0a0277bedbb3b0f81a2b5 100644 (file)
@@ -27,5 +27,6 @@
     CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
     CEPH_ROLLING_UPDATE: "{{ rolling_update }}"
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   when:
     - cephx | bool
index c76a64625745dac1b90a254d2af3f5b9dd6d0fa0..1a8031203aa3f0bd583a8e1c8b5aac6a14db5355 100644 (file)
@@ -16,6 +16,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
@@ -25,6 +26,7 @@
       delegate_to: localhost
       become: false
       run_once: true
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
       when:
         - initial_mon_key is skipped
           or
@@ -51,6 +53,7 @@
         owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
         group: "{{ ceph_uid if containerized_deployment 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 else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
     CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment 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 186fb0f529684d3249a2434b39317f8217e515d8..164414c4c900912067e2870933f4e5248ab23c4f 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 b64301e53d1ef47fcd2283c95f714c2e9278351d..4e349fa377a655f937f97f79afce2c21fc3eaceb 100644 (file)
@@ -20,6 +20,7 @@
       when:
         - cephx | bool
         - item.copy_key | bool
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -32,7 +33,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 1856ce3210ba54c5bef75e3c0822108837c1e5fa..1118c6f4473f2ce3cf10f7e50d87622b0ddef663 100644 (file)
@@ -58,6 +58,7 @@
       when:
         - cephx | bool
         - item.copy_key | bool
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -70,7 +71,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
@@ -80,6 +81,7 @@
           args:
             creates: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}/keyring
           changed_when: false
+          no_log: "{{ no_log_on_ceph_key_tasks }}"
 
         - name: set rados gateway key permissions
           file:
index 40f01b6c23e30f2a5cd157406d002708ac87d6e6..8966645af416190477336c05a6054c5f5c2747ac 100644 (file)
@@ -19,6 +19,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
@@ -35,5 +36,5 @@
     - cephx | bool
     - item is not skipped
     - item.item.copy_key | bool
-  no_log: true
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
index 52441cf23c7a3823248ba83cf8f6cae1f3605e73..f7e3537f2dd5386182ca75aa840b6703201052a7 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
       command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
@@ -42,6 +43,7 @@
       with_items: "{{ openstack_keys }}"
       run_once: true
       delegate_to: "{{ groups.get(mon_group_name)[0] }}"
+      no_log: "{{ no_log_on_ceph_key_tasks }}"
 
     - name: copy ceph key(s) if needed
       copy:
@@ -54,7 +56,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 4de1bc7d1957fa3f898ebc21ac90b76dd7c43e21..978ccad84b0a857344daa1a6f93168ed657187a3 100644 (file)
@@ -10,6 +10,7 @@
   when:
     - cephx | bool
     - item.copy_key | bool
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: copy ceph key(s) if needed
   copy:
@@ -22,7 +23,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
   command: >
@@ -43,4 +44,5 @@
     owner: "ceph"
     group: "ceph"
     mode: "{{ ceph_keyring_permissions }}"
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
   when: not containerized_deployment | bool
index a851614070e1474b8420fa84cdbafbbd7c07e7be..e9ef32de8ddb43d8a94fbc74c4f260e041584063 100644 (file)
@@ -19,6 +19,7 @@
   when:
     - cephx | bool
     - item.copy_key | bool
+  no_log: "{{ no_log_on_ceph_key_tasks }}"
 
 - name: copy ceph key(s) if needed
   copy:
@@ -32,7 +33,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 }}"