Based on usage in himlar and with himlarcli
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
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).
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
To use dry-run add --check
to the command
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