第 6 章 Creating content
Use the guidelines in this section of the Creator Guide to learn more about the developing the content you will use in Red Hat Ansible Automation Platform.
6.1. Creating playbooks 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Playbooks start with the three YAML dashes (---) followed by:
- Name: a brief description of the overall function of the playbook, which assists in keeping it readable and organized for all users.
- Hosts: identifies the target(s) for Ansible to run against.
-
Become statements: this optional statement can be set to
true/yesto activate privilege escalation (e.g., sudo, su, pfexec, doas, pbrun, dzdo, ksu, etc.). - Tasks: this is where actions that get executed via a call to an Ansible module get listed.
Example playbook