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 in Ansible by Ruth
14 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 by Haider

Related Questions In Ansible

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
• 6,870 points
467 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,810 points
340 views
+1 vote
1 answer
0 votes
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
65 views
+13 votes
2 answers
0 votes
1 answer