Write a playbook to create a backup of a file in the remote servers before copy.
Answer Posted / 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 |
Post New Answer View All Answers
What are ad-hoc commands? Give an example.
What is ci/cd?
What are playbooks in ansible?
How does ansible work?
How can one interpolate variables or dynamic variable names?
Why is ‘{{ }}’ notation used? And how can one interpolate variables or dynamic variable names?
Describe your newsletter ansible and who it’s aimed at.
When should you test playbooks and roles?
What is the method to check the inventory vars defined for the host?
Can you write a simple playbook to install nginx on a host machine?
How can looping be done over a list of hosts in a group, inside of a template?
Give a comparison between ansible and puppet.
What is ansible tower?
What are ansible server requirements?
Is it unsafe to bulk-set task arguments from a variable?