FreeBSD 14
Sponsored Link

Ansible : Install2024/09/11

 

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:~ #
pkg install -y py311-ansible
root@dlp:~ #
ansible --version

ansible [core 2.15.6]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/local/share/py311-ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/local/share/py311-ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.9 (main, Jul  6 2024, 01:06:23) [Clang 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a (/usr/local/bin/python3.11)
  jinja version = 3.1.3
  libyaml = True
[3] Define client hosts as management targets.
root@dlp:~ #
mkdir /usr/local/etc/ansible

root@dlp:~ #
vi /usr/local/etc/ansible/ansible.cfg
# create new

[defaults]
# set parameters if need (true or false for SSH host key checking)

host_key_checking=False
# set Python path

interpreter_python=/usr/local/bin/python3.11
root@dlp:~ #
vi /usr/local/etc/ansible/hosts
# create new
# set target hosts

10.0.0.50

# 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