Ansible

Puppet How To

2017-02-14. Category & Tags: Puppet, Ansible, Automation

Ref: DigitalOcean tutorial of puppet
Ansible is very easy to use, just need master, no need to install on slaves. Instead, SSH (usually with pub keys) are used in Ansible.
Puppet is more complex, Ansible can be used to assist the installation.
Puppet requires firewall to open port nr 8140.

INSTALL #

ansibleall 'apt-get install -y puppet' # for clients (nodes)
sudo apt-get install -y puppetmaster   # On server (master)

ref

CONFIG #

ansibleall 'echo "192.168.1.194 [email protected]" >> /etc/hosts'

PS #

  • change “example.com” to the actual domain that we can control.

Ansible How To

2017-01-22. Category & Tags: Ansible, Server, Cloud/Cluster, Management, DevOpt, Puppet

A simple video tutorial
OBS: ansible uses py, and py calls /bin/sh, NOT bash !

PRE-CONFIG #

suggested: use ssh-pub-key auth without passphrase.

INSTALL #

Optioanl: add ppa:ansible/ansible
installation:

sudo apt-get update && \
sudo apt-get install ansible

HOSTS #

vim /etc/ansible/hosts

master.ip.1
[slaves]
slave.domain1
slave.ip.addr.2
[slavesGroup2]
slave.domain2
slave.ip.addr.1

(see ref to give hosts’ names individually.)

SLAVE USERNAME #

sudo mkdir /etc/ansible/group_vars && \
sudo echo '---' > /etc/ansible/group_vars/all && \
sudo echo 'ansible_ssh_user: root' >> /etc/ansible/group_vars/all

(see DigitalOcean ref to config hosts individually.)

...