/ansible

Ansible jobs for use on himlar

Primary LanguageShell

Ansible managment of himlar

Based on usage in himlar and with himlarcli

Inventory

Inventory files can be updated from foreman with

$himlarcli/ansible_hosts.py -c ./config.ini.$loc or simply ./ansible_hosts.py when using proxy.

This will generate ./hostfile.$loc. Copy to this file to $ansible_repo/inventory/$loc

Variables

Default values are in group_vars/all.yaml and can then be overridden in group_vars/$loc.yaml or group_vars/$loc-$role.yaml (or in host_vars/ as a last resort).

Run

Always run with sudo and with hosts variable set on the command line. All playbook should be stored under lib/ and hosts can be single hostname, $loc or $loc-$role.

Example:

sudo ansible-playbook -e "myhosts=bgo" lib/ping.yaml

Dry-run

To use dry-run add --check to the command

Getting nasty output, do you have problem with http(s) proxy?

Try setting the https_proxy varaiable to http://IP:PORT

Example: sudo ansible-playbook -e "myhosts=osl-compute-08" -e "https_proxy=http://172.16.32.97:8888" lib/install_dsu.yaml