Tools, scripts and other systems infrastructure used to support the work of the OME http://www.openmicroscopy.org/
OME Ansible repository
This playbook uses Ansible 2.0 features (which is still in development), do not use
pip install ansible.
See http://docs.ansible.com/ansible/intro_installation.html for full installation instructions.
Create a virtualenv:
Clone ansible and submodules:
git clone git://github.com/ansible/ansible.git --recursive
Install dependencies listed in
venvs/ansible/bin/pip install paramiko jinja2 PyYAML pycrypto six
Clone this repository:
git clone https://github.com/openmicroscopy/infrastructure.git
Clone the repository containing the inventory, host and group vars files. Ansible will automatically look for
group_varsdirectories in the parent directory of the inventory file.
Running the development ansible
Activate the virtualenv:
Activate the Ansible development environment:
source ansible/hacking/env-setup -q
All ansible tools should now be in your path.
Alternatively adjust the paths in this script as necessary:
shell #!/bin/sh source ~/venvs/ansible/bin/activate source ~/github/ansible/hacking/env-setup -q exec "$(basename $0)" "$@"
And copy/symlink it into a directory on your
ansible-playbook, etc (the script should automatically run the ansible command corresponding to it's file name).
As another alternative you can probably install ansible into your virtualenv (untested):
venvs/ansible/bin/python setup.py install --help
In the following examples replace example-hosts with the private host inventory file
ci-provision.yml for all hosts listed in
-uLogin as this user
--ask-become-passprompt for sudo password
-vVerbose (repeat to increase verbosity)
Note this may fail since some tasks are dependent on others being completed:
ansible-playbook -i example-hosts -u $USERNAME -b --ask-become-pass -C -v ci-provision.yml
ansible-playbook -i example-hosts -u $USERNAME -b --ask-become-pass ci-provision.yml
provision.yml for all subset of the hosts or groups listed in
ansible-playbook -i example-hosts -u $USERNAME -b --ask-become-pass ci-provision.yml --limit $HOST_OR_GROUP_NAME
List the hosts that would be targeted by a command, don't do anything else:
ansible-playbook -i example-hosts ci-provision.yml --list-hosts
Playbooks which do not alter hardware can often be tested in Docker instead of a full VM, for example by using the omero-ssh image:
docker run -d omero-ssh # Optional: ssh-copy-id firstname.lastname@example.org # Pass -K if sudo requires a password, and -k if ssh keys aren't setup ansible-playbook -i etc/test-hosts -u omero ci-deployment.yml -bv