Skip to content

Commit

Permalink
Don't print registry password in loop label (#255)
Browse files Browse the repository at this point in the history
don't print registry password in loop label
  • Loading branch information
sthiriet authored Jun 12, 2024
1 parent b48ead5 commit 2160440
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/molecule_plugins/docker/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
key_path: "{{ item.key_path | default((lookup('env', 'DOCKER_CERT_PATH') + '/key.pem') if lookup('env', 'DOCKER_CERT_PATH') else omit) }}"
tls_verify: "{{ item.tls_verify | default(lookup('env', 'DOCKER_TLS_VERIFY')) or false }}"
with_items: "{{ molecule_yml.platforms }}"
loop_control:
label: "{{ item.registry.url | default(item.name) }}"
when:
- item.registry is defined
- item.registry.url is defined and item.registry.url
Expand All @@ -38,6 +40,8 @@
ansible.builtin.stat:
path: "{{ molecule_scenario_directory + '/' + (item.dockerfile | default('Dockerfile.j2')) }}"
loop: "{{ molecule_yml.platforms }}"
loop_control:
label: "{{ item.name }}"
register: dockerfile_stats

- name: Create Dockerfiles from image names
Expand All @@ -52,6 +56,7 @@
mode: "0600"
loop: "{{ molecule_yml.platforms }}"
loop_control:
label: "{{ item.name }}"
index_var: i
when: not item.pre_build_image | default(false)
register: platforms
Expand All @@ -68,6 +73,7 @@
- "--exclude=molecule.yml"
loop: "{{ molecule_yml.platforms }}"
loop_control:
label: "{{ item.name }}"
index_var: i
when: not item.pre_build_image | default(false)
delegate_to: localhost
Expand All @@ -81,6 +87,8 @@
key_path: "{{ item.key_path | default((lookup('env', 'DOCKER_CERT_PATH') + '/key.pem') if lookup('env', 'DOCKER_CERT_PATH') else omit) }}"
tls_verify: "{{ item.tls_verify | default(lookup('env', 'DOCKER_TLS_VERIFY')) or false }}"
with_items: "{{ platforms.results }}"
loop_control:
label: "{{ item.item.docker_host | default(lookup('env', 'DOCKER_HOST') or 'unix://var/run/docker.sock') }}"
when:
- not item.pre_build_image | default(false)
register: docker_images
Expand Down Expand Up @@ -128,6 +136,8 @@
combine({item.name: item.command | default('bash -c "while true; do sleep 10000; done"')})
}}
with_items: "{{ molecule_yml.platforms }}"
loop_control:
label: "{{ item.name }}"
when: item.override_command | default(true)

- name: Create molecule instance(s)
Expand Down Expand Up @@ -199,3 +209,5 @@
until: docker_jobs.finished
retries: 300
with_items: "{{ server.results }}"
loop_control:
label: "{{ item.item.name }}"

0 comments on commit 2160440

Please sign in to comment.