Skip to content

Commit

Permalink
fix(roles/nerdctl_login): Always login to registry
Browse files Browse the repository at this point in the history
  • Loading branch information
konradasb committed Nov 21, 2023
1 parent db86ce1 commit 0a2a232
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions roles/nerdctl_login/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
---
- name: Get Docker config contents
ansible.builtin.slurp:
src: "{{ nerdctl_login_config_path }}"
register: nerdctl_login_docker_config
ignore_errors: true
when:
- nerdctl_login_registry_url | length > 0

- name: Login to container registry
environment:
REGISTRY_PASSWORD: "{{ nerdctl_login_password }}"
ansible.builtin.shell: nerdctl login -u {{ nerdctl_login_username }} -p "${REGISTRY_PASSWORD}" {{ nerdctl_login_registry_url }}
changed_when: false
when:
- nerdctl_login_username | length > 0
- nerdctl_login_password | length > 0
- nerdctl_login_registry_url | length > 0
- nerdctl_login_docker_config['content'] is not defined or
nerdctl_login_docker_config['content'] | b64decode | from_json | json_query('auths."' ~ nerdctl_login_registry_url ~ '".auth') is not defined

0 comments on commit 0a2a232

Please sign in to comment.