DevOps Classroom Series – 07/Oct/2021

Ansible Configuration

  • The configuration done so far is represented as shown below Preview
  • Lets create an inventory file with the Node1 details. Create a file called as hosts with the following content
172.31.17.152
  • To check the connectivity for ansible control node with Node which internally checks the connectivity and ssh login ansible has a special command
ansible -i <inventory file path> -m ping --ask-pass all
  • So lets execute this command on control node Preview
  • Now lets add one more entry into the inventory
172.31.17.152
localhost

Preview

  • Now entering password every time might not be good option for automating deployments, so lets try to use key based authentication
  • To Create a key based authentication b/w ansible control node and nodes
    • Create a key pair in Ansible control node
    ssh-keygen
    
    Preview
    • Copy the public key to the node(s) from ansible control node
    ssh-copy-id <username>@<ipaddress>
    
    Preview
    • Now lets try to login from ansible control node to node just by using ip address Preview
  • Now lets try to ansible connectivity check without ask password
ansible -i hosts -m ping all

Preview

  • Now lets try to copy keys to localhost Preview

  • Setup done so far Preview

  • Now lets add the new centos 7 node and configure it to the ansible control node

    • for steps view recording Preview
  • Configuration overview Preview

  • Exercise:

Leave a Reply

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

Please turn AdBlock off
Floating Social Media Icons by Acurax Wordpress Designers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube