From 2cba7e32b7a08ae422d9a1ba2455331bd4d5cb93 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Sat, 12 Jan 2019 07:57:52 -0700 Subject: [PATCH] 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 --- ci-scripts/ansible-lint.sh | 4 +++- tasks/docker.yml | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ci-scripts/ansible-lint.sh b/ci-scripts/ansible-lint.sh index 65e2245..2d079e0 100755 --- a/ci-scripts/ansible-lint.sh +++ b/ci-scripts/ansible-lint.sh @@ -10,7 +10,9 @@ # ANSIBLE0013: Use Shell only when shell functionality is required # ANSIBLE0016: Tasks that run when changed should likely be handlers # 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. ansible-lint -vvv -x $SKIPLIST ./ || lint_error=1 diff --git a/tasks/docker.yml b/tasks/docker.yml index ec4c02e..bc3c4c6 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -85,7 +85,7 @@ when: container_registry_insecure_registries | length > 0 notify: restart docker service 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 file: @@ -107,7 +107,7 @@ regexp: '^DOCKER_STORAGE_OPTIONS=' line: "DOCKER_STORAGE_OPTIONS=' {{ container_registry_storage_options }}'" create: yes - when: container_registry_storage_options != "" + when: container_registry_storage_options | length > 0 notify: restart docker service - name: configure DOCKER_NETWORK_OPTIONS in /etc/sysconfig/docker-network @@ -116,7 +116,7 @@ regexp: '^DOCKER_NETWORK_OPTIONS=' line: "DOCKER_NETWORK_OPTIONS=' {{ container_registry_network_options }}'" create: yes - when: container_registry_storage_options != "" + when: container_registry_storage_options | length > 0 notify: restart docker service - name: ensure docker group exists @@ -129,7 +129,7 @@ name: "{{ container_registry_deployment_user }}" groups: docker append: yes - when: container_registry_deployment_user != "" + when: container_registry_deployment_user | length > 0 - name: force systemd to reread configs meta: flush_handlers