image.png

Overview of Ansible Automation

This documentation outlines the use of Ansible for automating various system administration tasks on a remote server. The playbooks and commands cover everything from initial server setup to deploying and managing applications like NGINX. The target server is identified by the IP address

163.223.99.79.


Prerequisites: Setting Up SSH Access

Before running any Ansible playbooks, it's essential to establish a secure, passwordless connection to the remote server using SSH keys. The following steps show how to copy an SSH public key to the server, allowing the

bishesna user to connect to the ims users without a password.

Command: ssh-copy-id

The ssh-copy-id command copies a public key to a remote server's ~/.ssh/authorized_keys file.


Ansible Playbooks and Their Functions

Ansible playbooks are YAML files that define a set of tasks to be executed on managed hosts. The following sections detail the playbooks used for this project.

Playbook: install_nginx.yml

This playbook, designed for installing and starting NGINX, runs on the webservers host group. It uses

become: yes to run tasks with elevated privileges.

`ansible-playbook -i inventory.ini install_nginx.yml`: This command executes the playbook.