我正在使用 ansible 版本 2.1.0.0,我的部分代码是:
- shell: /etc/init.d/named restart
when: ('FAILED' not in zoneconfig.stdout) and ('neither' not in zoneconfig.stdout) and ('FAILED' not in echofail.stdout) and ('SUCCESSFUL' in echopass.stdout_lines) and ('SUCCESSFUL' in zoneconfig.stdout)
ignore_errors: True
register: namedrestart
- debug: var=namedrestart.stdout_lines
when: ('FAILED' not in zoneconfig.stdout) and ('neither' not in zoneconfig.stdout) and ('FAILED' not in echofail.stdout) and ('SUCCESSFUL' in echopass.stdout_lines) and ('SUCCESSFUL' in zoneconfig.stdout)
ignore_errors: True
- shell: /etc/init.d/named status
when: ('FAILED' not in zoneconfig.stdout) and ('neither' not in zoneconfig.stdout) and ('FAILED' not …Run Code Online (Sandbox Code Playgroud) ansible ×1