Fix E306 in other roles (#6517)

This commit is contained in:
Maxime Guyot
2020-08-28 10:20:53 +02:00
committed by GitHub
parent 2f93d62aa5
commit 6e938a3106
6 changed files with 54 additions and 25 deletions

View File

@@ -17,14 +17,20 @@
set_fact:
docker_dns_search_domains: "{{ docker_dns_search_domains + searchdomains|default([]) }}"
- name: check system nameservers # noqa 306
shell: grep "^nameserver" /etc/resolv.conf | sed -r 's/^nameserver\s*([^#\s]+)\s*(#.*)?/\1/'
- name: check system nameservers
shell: set -o pipefail && grep "^nameserver" /etc/resolv.conf | sed -r 's/^nameserver\s*([^#\s]+)\s*(#.*)?/\1/'
args:
executable: /bin/bash
changed_when: False
register: system_nameservers
check_mode: no
- name: check system search domains # noqa 306
- name: check system search domains
# noqa 306 - if resolf.conf has no search domain, grep will exit 1 which would force us to add failed_when: false
# Therefore -o pipefail is not applicable in this specific instance
shell: grep "^search" /etc/resolv.conf | sed -r 's/^search\s*([^#]+)\s*(#.*)?/\1/'
args:
executable: /bin/bash
changed_when: False
register: system_search_domains
check_mode: no

View File

@@ -11,9 +11,11 @@
notify: restart docker
when: http_proxy is defined or https_proxy is defined
- name: get systemd version # noqa 306
- name: get systemd version
# noqa 303 - systemctl is called intentionally here
shell: systemctl --version | head -n 1 | cut -d " " -f 2
shell: set -o pipefail && systemctl --version | head -n 1 | cut -d " " -f 2
args:
executable: /bin/bash
register: systemd_version
when: not is_ostree
changed_when: false