1 Answer

0 votes
by
An Ansible play is a set of tasks that are run on one or more managed hosts. A play may include one or more tasks, and the most common way to execute play is to use a playbook. An Ansible playbook is composed of one or more plays and offer more advanced functionality for sending tasks to managed host compared to running many ad-hoc commands.  

               

Example of play is:

                       - hosts: webservers

                         tasks:

                           - name: ensure apache is at the latest version

                              yum:

                                   name: httpd

                                   state: latest

 Example of playbook with 2 plays is:

                        ---

                        - hosts: webservers

                          tasks:

                             - name: ensure apache is at the latest version

                                   yum:

                                       name: httpd

                                       state: latest

                        - hosts: databases

                          tasks:

                             - name: ensure postgresql is at the latest version

                                   yum:

                                       name: postgresql

                                       state: latest
Click here to read more about Ansible
Click here to read more about Insurance

Related questions

0 votes
asked Aug 24, 2019 in Ansible by rahulsharma
0 votes
asked Aug 24, 2019 in Ansible by rahulsharma
0 votes
asked Aug 24, 2019 in Ansible by rahulsharma
0 votes
asked Aug 24, 2019 in Ansible by rahulsharma
0 votes
asked Feb 17, 2020 in Ansible by MBarbieri
0 votes
...