-
Notifications
You must be signed in to change notification settings - Fork 7
Ansible
Pavel Zinin edited this page Jul 2, 2019
·
4 revisions
In order to use an Ansible playbook, you must
- (Optional) mount a folder with Ansible playboks to a container's
./ansible
directory. Default:./ansible
directory in project root. This directory contains example playbooks - Mount a folder/volume to store logs to a container according to a
config.ini
file. Default:./logs/ansible
directory in project root. - Generate a SSH key for Ansible and make sure it exists for a container according to a
config.ini
file. If you use VMEmperor auto-installation, this key will be authorized in a VM - (if you don't use docker-compose) Set
ansible_playbook
parameter to the path toansible-playbook
binary if you use custom Ansible distribution
Supply a vmemperor.conf
file with each playbook as described here.
If you use VMEmperor to install a VM with unattended installation, it'll authorize VMEmperor's ansible_pubkey
to access user you've created.
The ansible playbook will run under this user and it can be assumed that the user has a no-password sudo
access.
You can change the user name by editing other_config
field of a desired VM with a tool like xe
on a Xen Server:
xe vm-param-get uuid=YOUR_UUID param-name=other-config:first_user
If there's no such user, then root
is assumed.
NB: You should make the user "USERNAME" a sudoer with no password required
xe vm-param-set uuid=YOUR_UUID other-config:first_user=USERNAME