DevOps Classroomnotes 19/Mar/2022

Ansible Configuration

  • We have two linux machines with a user called as devops with sudo permissions and NOPASSWD
  • Ansible control node needs to have the information about the nodes which are attempting to connect. This information is referred to as inventory.
  • Now we have executed the ansible basic command after creating the inventory Refer Here for the inventory and the command used. We got the following error
    Preview
  • To add the known-host entry lets manually login from ansible control node to node using ssh command
    Preview
  • Right now we are entering the password manually when connecting to the nodes which is not good for automation, So lets create a secure approach, which enables password less authentication with security
  • Now on the ansible control node, i will be create a key pair
ssh-keygen

Preview
* Now lets copy the key from ansible control node to node 1 so that we can use key based authentication.

ssh-copy-id username@<destination-node-ip>

Preview
* Now lets try logging in into node1 without password
Preview
* Now lets exit and retry the command without password option Refer Here
Preview
* Now lets add localhost to the inventory Refer Here and run the ansible ping command
Preview
* It fails on localhost as the key is not copied, so copy the key using ssh-copy-id
Preview

  • Overview of the Steps
    Preview

From ansible I want to deploy an application into Linux Server

  • Deployment Statements
    • I want to deploy a spring boot application into ubuntu linux server and ensure the service is configured and running on port 8080.
    • I want to deploy an node js application on the Linux Server and configure nginx to forward the requests to nodejs
    • I want to deploy a postgresql database on the linux server
  • Steps to Resolve this

    • Understand the Manual steps to acheive and try to execute them once before you start any automation with any tool in this case it is Ansible.
  • Yaml Tutorial: Refer Here

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner