set "check_mode: no" for read-only "shell" steps that registers result

"shell" step doesn't support check mode, which currently leads to failures,
when Ansible is being run in check mode (because Ansible doesn't run command,
assuming that command might have effect, and no "rc" or "output" is registered).

Setting "check_mode: no" allows to run those "shell" commands in check mode
(which is safe, because those shell commands doesn't have side effects).
This commit is contained in:
Vladimir Rutsky
2017-02-06 21:13:21 +03:00
parent 9667ac3baf
commit 09847567ae
12 changed files with 20 additions and 0 deletions

View File

@@ -32,11 +32,13 @@
shell: grep "^nameserver" /etc/resolv.conf | sed 's/^nameserver\s*//'
changed_when: False
register: system_nameservers
check_mode: no
- name: check system search domains
shell: grep "^search" /etc/resolv.conf | sed 's/^search\s*//'
changed_when: False
register: system_search_domains
check_mode: no
- name: add system nameservers to docker options
set_fact: