Category: nginx, automation, yaml, ansible

Since the world is moving into the DevOps model, and the industry started focusing on automation, I thought of sharing something related to automation for deployment. There are several configuration-management tools out there, then why we should go with Ansible.

Type the below command in the terminal to install nginx $ ansible testserver -m apt -a ‘name=nginx state=latest’ — become starting the services : Run the below command in the terminal to start the service $ ansible -m service -a “name=nginx state=started enabled=yes” testserver — become Run the below command in the terminal to see ths status of the ngnix $ ansible testserver -m shell -a “service nginx status” — become

Run the below command in the terminal to find the existence of the folder $ ansible -m file -a “path=/usr/share/nginx/html state=directory” testserver — become

Related Articles