CentOS Stream 8
Sponsored Link

Ansible : Install2021/06/16

 
Install Ansible which is the configuration management tool.
Ansible does not require dedicated server/client program, it needs Ansible command and SSH only.
[1]
[2] Install Ansible.
[root@dlp ~]#
dnf -y install centos-release-ansible-29
[root@dlp ~]#
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SIG-ansible-29.repo

[root@dlp ~]#
dnf --enablerepo=centos-ansible-29 -y install ansible
[root@dlp ~]#
ansible --version

ansible 2.9.22
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, May  8 2021, 09:11:34) [GCC 8.4.1 20210423 (Red Hat 8.4.1-2)]
[3] Define client hosts as management targets.
[root@dlp ~]#
vi /etc/ansible/ansible.cfg
# line 71 : change if need (check or not SSH host key)

host_key_checking = False
[root@dlp ~]#
vi /etc/ansible/hosts
# add to the end

# set target hosts

10.0.0.51

# set targets as a group

# any group name

[target_servers]
# set targets per line

10.0.0.51
10.0.0.52
# confirm settings

# show all defined hosts

[root@dlp ~]#
ansible all --list-hosts

  hosts (3):
    10.0.0.50
    10.0.0.51
    10.0.0.52

# show specific hosts in a group

[root@dlp ~]#
ansible target_servers --list-hosts

  hosts (2):
    10.0.0.51
    10.0.0.52
Matched Content