Write a playbook to create a backup of a file in the remote servers before copy.
Answer / Ritesh Sinha
Here's a simple Ansible playbook to install Nginx on a host:nn- name: Install and configure Nginxn hosts: webserversn tasks:n - name: Install Nginxn apt: name=nginx state=presentn - name: Enable and start the servicen service: name=nginx enabled=yes started=yesn - name: Ensure nginx configuration is loadedn command: service nginx reload
| Is This Answer Correct ? | 0 Yes | 0 No |
How can looping be done over a list of hosts in a group, inside of a template?
Why is ‘{{ }}’ notation used?
List some advantages of using ansible.
Describe your newsletter ansible and who it’s aimed at.
What is ansible role and how are they different from the playbook?
Can you write a simple playbook to install nginx on a host machine?
Explain a few of the basic terminologies or concepts in ansible.
Explain different modules in ansible.
What is ansible and what makes it stand out from the rest of the configuration management tools?
Why are you attracted to science and science fiction?
How do I see all the inventory vars defined for my host?
What are playbooks in ansible?