
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.
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.
ssh-copy-idThe ssh-copy-id command copies a public key to a remote server's ~/.ssh/authorized_keys file.
ssh-copy-id -i ~/.ssh/id_rsa.pub <remote_user>@<remote_IP>: This command copies the public key id_rsa.pub to the ims user on the remote server. After running this command, you'll be prompted to confirm the connection and enter the
ims user's password.
one key was added.


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.
install_nginx.ymlThis 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.
nginx package and ensures its state is present.systemd module to start NGINX and configure it to run at boot.systemctl status nginx command confirms that the NGINX service is active (running).