]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
container/registry: use password from stdin
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 12 Jan 2021 19:29:58 +0000 (14:29 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 1 Apr 2021 19:07:37 +0000 (21:07 +0200)
Pass the password variable via stdin for the registry login
authentication.
This allows to remove the no_log statement and see the task output
without displaying the password value.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-container-common/tasks/registry.yml

index a9abb3b982587d3fb7608ac3f4764841d3dd455a..91a08dcbe7a6e137a2b33f7606724eb06acc89c0 100644 (file)
@@ -1,8 +1,10 @@
 ---
 - name: container registry authentication
-  command: '{{ container_binary }} login -u {{ ceph_docker_registry_username }} -p {{ ceph_docker_registry_password | quote }} {{ ceph_docker_registry }}'
+  command: '{{ container_binary }} login -u {{ ceph_docker_registry_username }} --password-stdin {{ ceph_docker_registry }}'
+  args:
+    stdin: '{{ ceph_docker_registry_password }}'
+    stdin_add_newline: no
   changed_when: false
-  no_log: true
   environment:
     HTTP_PROXY: "{{ ceph_docker_http_proxy | default('') }}"
     HTTPS_PROXY: "{{ ceph_docker_https_proxy | default('') }}"