ansible-playbook useful command line options
TRANSCRIPT
!
知ってると便利なオプション ansible-playbook useful options
若山史郎 (WAKAYAMA Shirou)
ツキノワ株式会社 / Tsukinowa Inc.
おまえだれよ? / Who are you?
• 若山 史郎(@r_rudi) / ツキノワ株式会社
• golang, python, iOS, AndroidWeb app, MQTT, Ansible
• Author of 「入門Ansible」
• in the Amazon Japan
—verbose (-v)
• Increase verbose level
• -v, -vv, -vvv, -vvvv, -vvvvv(v*5), -vvvvvv(v*6)
• v*6 is only in winrm (currently)
• vvv, vvvv shows ssh connection
• Many ansible trouble is related to ssh. Try -vvvv first!
—list-hosts, —list-tasks, --list-tags
• —list-tasks
!
!
• —list-tags (1.9-)
Tips: where can we put tags?
Tag for play
Multiple tags
Name for play
IncludeRole
Tips: special tags (1.9-)
• always
• always run
• tagged
• untagged
• can be specified with -t
--syntax-check
• Very helpful error message
• Useful for CI (like jenkins or CircleCI)
--start-at-task
• “Task failed. I wanna restart from HERE!!! “
• —start-at-task=“<taskname>”
-e @vars.json
• -e set additional variables from command line
• -e "version=1.23.45 other_variable=foo"
• @vars.json or @vars.yml
• load variables from specified JSON/YAML