Wednesday, 25 July 2018

Ansible on SUSE Leap 15

Ansible is more commonly associated with Red Hat instead of SUSE, but setting up ansible on SUSE Leap 15 is actually quite simple. Below are how you can get started with ansible on SUSE Leap 15.  

Start with installing ansible:
# zypper in ansible

Add the host that you want to manage in /etc/ansible/hosts, the format is as follow:
ipaddress:port ansible_connection=ssh ansible_user=root ansible_password=password

Assuming the system you want to manage has IP address of 192.168.5.1, running root enabled sshd with password 'pass1234' and sshd running on the default port 22 the configuration will be as follow: 

192.168.5.1 ansible_connection=ssh ansible_user=root ansible_password=pass1234

Notice that the port number is optional when sshd is running on default port 22

Disable host key checking by adding the following configuration in /etc/ansible/ansible.cfg

host_key_checking = False

And just like that you are ready to play with ansible. 

Run the following command just to test:
# ansible all -m ping
# ansible all -a "cat /etc/hosts"
# ansible all -m setup

Until next time, long live Geeko Chameleon !!!





No comments:

Post a Comment