所有Ansible playbook属性

时间:2016-12-19 18:20:27

标签: ansible ansible-playbook

我刚刚开始使用Ansible,在阅读完教程(Ansible Team命名为“docs”)后,我希望看到可以在playbooks中使用的所有属性的完整列表。有人能够提供这样的清单吗?我能够使用谷歌的唯一一个是this old example,但它缺少像gather_facts这样的东西
也许有经验的人可以在这里粘贴一个包含所有属性的正确结构的“骨架”
提前谢谢。

1 个答案:

答案 0 :(得分:6)

您可以随时查看the code

package entities;

另请注意,# ================================================================================= # Connection-Related Attributes # TODO: generalize connection _accelerate = FieldAttribute(isa='bool', default=False, always_post_validate=True) _accelerate_ipv6 = FieldAttribute(isa='bool', default=False, always_post_validate=True) _accelerate_port = FieldAttribute(isa='int', default=5099, always_post_validate=True) # Connection _gather_facts = FieldAttribute(isa='bool', default=None, always_post_validate=True) _gather_subset = FieldAttribute(isa='barelist', default=None, always_post_validate=True) _gather_timeout = FieldAttribute(isa='int', default=None, always_post_validate=True) _hosts = FieldAttribute(isa='list', required=True, listof=string_types, always_post_validate=True) _name = FieldAttribute(isa='string', default='', always_post_validate=True) # Variable Attributes _vars_files = FieldAttribute(isa='list', default=[], priority=99) _vars_prompt = FieldAttribute(isa='list', default=[], always_post_validate=True) _vault_password = FieldAttribute(isa='string', always_post_validate=True) # Role Attributes _roles = FieldAttribute(isa='list', default=[], priority=90) # Block (Task) Lists Attributes _handlers = FieldAttribute(isa='list', default=[]) _pre_tasks = FieldAttribute(isa='list', default=[]) _post_tasks = FieldAttribute(isa='list', default=[]) _tasks = FieldAttribute(isa='list', default=[]) # Flag/Setting Attributes _any_errors_fatal = FieldAttribute(isa='bool', default=False, always_post_validate=True) _force_handlers = FieldAttribute(isa='bool', always_post_validate=True) _max_fail_percentage = FieldAttribute(isa='percent', always_post_validate=True) _serial = FieldAttribute(isa='list', default=[], always_post_validate=True) _strategy = FieldAttribute(isa='string', default=C.DEFAULT_STRATEGY, always_post_validate=True) # ================================================================================= 类会继承PlayBaseTaggable
因此,所有这些类的属性也可用于播放。

<强>更新

这是我在another question中建议的Python oneliner:

Become