21. エラーメッセージ改良
# 1.9.4
ERROR: us is not a legal parameter in an Ansible task or handler
# 2.0.1
ERROR! no action detected in task
The error appears to have been in
'/home/centos/linux/crm/playbook.yml': line 11, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: Changing root password
^ here
構文に関連しない場合のエラーも
詳しい場所のサジェスチョン
22. Strategy プラグイン追加
新しく追加されたプラグイン
linear , free が用意されている
linear(デフォルト、~1.9.xと同じ)
全ホストの実行終了を待つ
serial ディレクティブ(並列数)と併用可
free
全ホストの実行終了を待たずに実行する
http://docs.ansible.com/ansible/playbooks_strategies.html
24. Include の改良(Facts)
# Before v2
- include: RedHat.yml
when: ansible_os_family == "RedHat"
- include: Debian.yml
when: ansible_os_family == "Debian"
# With v2
- include: "{{ ansible_os_family }}".yml
例:ディストリビューション毎にタスクを実行
25. 変数の優先順位 v1.*
1. extra vars
2. vars, vars_files, etc.
3. inventory vars – host vars 、group vars
4. facts
5. role defaults
26. 変数の優先順位 v2.0
1. extra vars(command line –e)
2. task vars (only for the task)
3. block vars (only for tasks in block)
4. role and include vars
5. play vars_files
6. play vars_prompt
7. play vars
8. set_facts
9. registered vars
10. host facts
11. playbook host_vars
12. playbook group_vars
13. inventory host_vars
14. inventory group_vars
15. inventory vars
16. role defaults
高
低
http://docs.ansible.com/ansible/playbooks_variables.html