Add a node in Ansible

0 votes
I have installed ansible on CentOS and now I want to add a server that is to manage or add another node to it. How do I do that?
Jan 8, 2019 in Ansible by Ruth
1,579 views

1 answer to this question.

0 votes

Follow these steps @Ruth:

  • Generate ssh key

ssh-keygen
  • Check the ip of your node using ifconfig

  • copy public key of Ansible server to its nodes. Use the command below:

ssh-copy-id -i root@<ip address of your node machine>
  • use any editor to write your inventory or specify the IP addresses of your nodes grouped under ‘test-servers’

vi /etc/ansible/hosts
  • Check the IP of your host
cat /etc/ansible/hosts

And you're done!

answered Jan 8, 2019 by Haider

Related Questions In Ansible

0 votes
1 answer

How to add multiple lines in a file using Ansible playbook?

Hi@akhtar, You can update your file using lineinfile ...READ MORE

answered Sep 16, 2020 in Ansible by MD
• 95,460 points
26,718 views
0 votes
1 answer

How do I execute a shell script and then use the result in ansible

This can work out for you: - name: ...READ MORE

answered Apr 11, 2018 in Ansible by shubham
• 7,340 points
6,913 views
0 votes
1 answer

Using multiple config files using same template in a role in ansible

Go through this include_role module: tasks: - ...READ MORE

answered Jun 5, 2018 in Ansible by DareDev
• 6,890 points
4,243 views
+1 vote
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,240 points
1,208 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,062 views
0 votes
1 answer

How do I wget a file from web server using shell in the ansible playbook

Hey Ayaan, you could probably use this ...READ MORE

answered Jan 24, 2019 in Ansible by Anushri
4,182 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP