Viewing Configuration Options If you want to find out what options are available in the configuration file, use the ansible-config list command. It will display an exhaustive list of the available configuration options and their default settings. This list may vary depending on the version of Ansible that you have installed and whether you have any additional Ansible plugins on your control node. Each option displayed by ansible-config list will have a number of key-value pairs associated … [Read more...] about How to use ansible-config to discover and investigate configuration options
Ansible
How to write multiple plays and per-play privilege escalation in Ansible
Writing Multiple Plays A playbook is a YAML file containing a list of one or more plays. Remember that a single play is an ordered list of tasks to execute against hosts selected from the inventory. Therefore, if a playbook contains multiple plays, each play may apply its tasks to a separate set of hosts. This can be very useful when orchestrating a complex deployment which may involve different tasks on different hosts. You can write a playbook that runs one play against one set of hosts, and … [Read more...] about How to write multiple plays and per-play privilege escalation in Ansible
How to Write Ansible Playbook and run it using the ansible-playbook command
Ansible Playbooks and Ad Hoc Commands Ad hoc commands can run a single, simple task against a set of targeted hosts as a one-time command. The real power of Ansible, however, is in learning how to use playbooks to run multiple, complex tasks against a set of targeted hosts in an easily repeatable manner. A play is an ordered set of tasks run against hosts selected from your inventory. A playbook is a text file containing a list of one or more plays to run in a specific order. Plays allow you … [Read more...] about How to Write Ansible Playbook and run it using the ansible-playbook command
How to Run Ad-Hoc Commands Using Ansible
In this post, we will learn how to run a single Ansible automation task using an ad hoc command and explain some use cases for ad hoc commands. Running ad hoc Commands with Ansible An ad hoc command is a way of executing a single Ansible task quickly, one that you do not need to save to run again later. They are simple, online operations that can be run without writing a playbook. Ad hoc commands are useful for quick tests and changes. For example, you can use an ad hoc command to make sure … [Read more...] about How to Run Ad-Hoc Commands Using Ansible