Setting up Nodejs Application using ansible
OS: Ubuntu 22 (Control Node)
Step 1: Update OS
sudo apt update
Step 2: Install Ansible
sudo apt install ansible
Step 3: Check if it is installed
sudo ansible --version
Step 4: Generate an SSH key pair on the control node
ssh-keygen
Step 5: Copy the public key from control to the host server
ssh-copy-id usernameofhost@ipaddressofhostserver
Step 6: Test the SSH connection
You can test the SSH connection from the control node to the host server using the following command:
ssh hostuser@host_ip_address
Step 7: Create the inventory file
sudo vim /etc/ansible/hosts and add hosts ip address - e.g. 164.92.249.174
Step 8: Create the playbook file
Step 9: Run this playbook file now Command: sudo ansible-playbook -i /etc/ansible/inventory deploy_task_manager.yml
Step 10:
APP IS LIVE ON HOST NODE: