Category: ansible

1) Create ssh keypair & copy ssh of the remote server with the public key. 2) Insert the copied remote server IP address in the /etc/ansible/hosts file & checking the status of the HTTPD service. 3) Now if the AWS EC2 instance gets rebooted or stopped we can attain the status of the remote server even the public IP address gets changed.

Again we started the same EC2 instance & it is observed that the IP address got changed.

Finally, we are able to run the ansible and check the status of the HTTP service of the remote host even the AWS EC2 instance public IP address gets changed each time on the stopping or rebooting of the EC2 instance.

Related Articles