Fix linting issues

Newer versions of ansible lint are stricter. This change fixes up the
issues and ignores rule 405 which requires retries on package items.
We're skipping the retries because yum does that natively.

Change-Id: I9280a736cb1bdeeb1bdcea11ec4ca8f5af9d1e44
This commit is contained in:
Alex Schultz 2019-01-12 07:57:52 -07:00
parent 61760f2fc1
commit 2cba7e32b7
2 changed files with 7 additions and 5 deletions

View File

@ -10,7 +10,9 @@
# ANSIBLE0013: Use Shell only when shell functionality is required # ANSIBLE0013: Use Shell only when shell functionality is required
# ANSIBLE0016: Tasks that run when changed should likely be handlers # ANSIBLE0016: Tasks that run when changed should likely be handlers
# this requires refactoring roles, skipping for now # this requires refactoring roles, skipping for now
SKIPLIST="ANSIBLE0006,ANSIBLE0007,ANSIBLE0010,ANSIBLE0012,ANSIBLE0013,ANSIBLE0016" # 405: Package tasks should have retries. Skipping because yum does
# this natively.
SKIPLIST="ANSIBLE0006,ANSIBLE0007,ANSIBLE0010,ANSIBLE0012,ANSIBLE0013,ANSIBLE0016,405"
# Lin the role. # Lin the role.
ansible-lint -vvv -x $SKIPLIST ./ || lint_error=1 ansible-lint -vvv -x $SKIPLIST ./ || lint_error=1

View File

@ -85,7 +85,7 @@
when: container_registry_insecure_registries | length > 0 when: container_registry_insecure_registries | length > 0
notify: restart docker service notify: restart docker service
vars: vars:
registry_flags: "{% for reg in container_registry_insecure_registries %}--insecure-registry {{ reg }}{% if not loop.last %} {% endif %}{% endfor %}" registry_flags: --insecure-registry {{ container_registry_insecure_registries | join(' --insecure-registry ') }}
- name: Create additional socket directories - name: Create additional socket directories
file: file:
@ -107,7 +107,7 @@
regexp: '^DOCKER_STORAGE_OPTIONS=' regexp: '^DOCKER_STORAGE_OPTIONS='
line: "DOCKER_STORAGE_OPTIONS=' {{ container_registry_storage_options }}'" line: "DOCKER_STORAGE_OPTIONS=' {{ container_registry_storage_options }}'"
create: yes create: yes
when: container_registry_storage_options != "" when: container_registry_storage_options | length > 0
notify: restart docker service notify: restart docker service
- name: configure DOCKER_NETWORK_OPTIONS in /etc/sysconfig/docker-network - name: configure DOCKER_NETWORK_OPTIONS in /etc/sysconfig/docker-network
@ -116,7 +116,7 @@
regexp: '^DOCKER_NETWORK_OPTIONS=' regexp: '^DOCKER_NETWORK_OPTIONS='
line: "DOCKER_NETWORK_OPTIONS=' {{ container_registry_network_options }}'" line: "DOCKER_NETWORK_OPTIONS=' {{ container_registry_network_options }}'"
create: yes create: yes
when: container_registry_storage_options != "" when: container_registry_storage_options | length > 0
notify: restart docker service notify: restart docker service
- name: ensure docker group exists - name: ensure docker group exists
@ -129,7 +129,7 @@
name: "{{ container_registry_deployment_user }}" name: "{{ container_registry_deployment_user }}"
groups: docker groups: docker
append: yes append: yes
when: container_registry_deployment_user != "" when: container_registry_deployment_user | length > 0
- name: force systemd to reread configs - name: force systemd to reread configs
meta: flush_handlers meta: flush_handlers