Created
January 5, 2018 12:58
-
-
Save suzuki-shunsuke/41d42f83bc17c53ff6a591a273fe2014 to your computer and use it in GitHub Desktop.
ansibleのshell(command)モジュールで標準出力によってchangedを判定する方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
tasks: | |
- shell: "echo '{\"changed\": true}'" | |
register: result | |
changed_when: (result.stdout|from_json)["changed"] | |
- shell: "echo '{\"changed\": false}'" | |
register: result | |
changed_when: (result.stdout|from_json)["changed"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment