Skip to content

Commit

Permalink
Fix ansible-lint / yamllint warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjj committed Sep 9, 2023
1 parent d6c4717 commit a7fea65
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docker__cron_jobs_prune_flags: "af"
docker__cron_jobs_prune_schedule: ["0", "0", "*", "*", "0"]
docker__cron_jobs:
- name: "Docker disk clean up"
job: "docker system prune -{{ docker__cron_jobs_prune_flags }} > /dev/null 2>&1"
job: "docker system prune -{{ docker__cron_jobs_prune_flags }} > /dev/null 2>&1" # yamllint disable-line rule:line-length
schedule: "{{ docker__cron_jobs_prune_schedule }}"
cron_file: "docker-disk-clean-up"
user: "{{ (docker__users | first) | d('root') }}"
Expand All @@ -52,11 +52,11 @@ docker__architecture_map:
"armv7l": "armhf"

docker__apt_key_id: "9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
docker__apt_key_url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
docker__apt_key_url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg" # yamllint disable-line rule:line-length
docker__apt_repository: >
deb [arch={{ docker__architecture_map[ansible_architecture] }}]
https://download.docker.com/linux/{{ ansible_distribution | lower }}
{{ ansible_distribution_release }} {{ docker__channel | join (' ') }}
{{ ansible_distribution_release }} {{ docker__channel | join(' ') }}
docker__pip_dependencies:
- "gcc"
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---

galaxy_info:
namespace: "nickjj"
role_name: "docker"
author: "Nick Janetakis"
description: "Install and configure Docker / Docker Compose."
Expand Down
8 changes: 3 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
loop: "{{ docker__default_pip_packages + docker__pip_packages }}"
when: item.name | d()

- name: Create python3-docker proxy script to access the Virtualenv's interpreter
- name: Create python3-docker proxy script to access Virtualenv's interpreter
ansible.builtin.template:
src: "usr/local/bin/python3-docker.j2"
dest: "/usr/local/bin/python3-docker"
Expand Down Expand Up @@ -141,10 +141,8 @@
- name: Restart Docker now to make sure `docker login` works
ansible.builtin.meta: "flush_handlers"

# It's safe to ignore no-log-password because we're removing the password from
# the output with the loop_control property.
- name: Manage Docker registry login credentials
ansible.builtin.docker_login: # noqa no-log-password
community.docker.docker_login:
registry_url: "{{ item.registry_url | d(omit) }}"
username: "{{ item.username }}"
password: "{{ item.password }}"
Expand All @@ -154,7 +152,7 @@
state: "{{ item.state | d('present') }}"
loop: "{{ docker__registries }}"
loop_control:
label: '{{ {"registry_url": item.registry_url | d("https://index.docker.io/v1/"), "username": item.username, "state": item.state | d("present")} }}'
label: '{{ {"registry_url": item.registry_url | d("https://index.docker.io/v1/"), "username": item.username, "state": item.state | d("present")} }}' # yamllint disable-line rule:line-length
when: item.username | d() and item.password | d()
become: true
become_user: "{{ docker__login_become_user | d('root') }}"
Expand Down

0 comments on commit a7fea65

Please sign in to comment.