This is an example release of the Compute Canada ansible-cvmfs-server role, which is maintained elsewhere. If you are interested in using this Ansible role please let us know!
It can be useful to do echo "export PYTHONUNBUFFERED=1" >> ~/.bashrc
in your session to ensure that Ansible output is streamed to stdout smoothly.
-
Enable EPEL repository
EPEL is required to provide a recent version of Ansible and some JSON packages.
sudo dnf install epel-release
-
Install Ansible
Ansible v2.5 or higher is required. To install from EPEL:
sudo dnf install ansible
- It is useful to set
force_color=True
under[defaults]
in/etc/ansible/ansible.cfg
-
Install git
sudo dnf install git
- Add the hostname of the new system to the Ansible inventory file
hosts
in git, with membership in the appropriate groups, and additional host or group vars as needed (which are documented here).
- Make sure you have logged in to the server using SSH agent forwarding (
ssh -A
) in order to access gitlab. sudo
will be used by Ansible to execute the role - so do not use sudo when invokingansible-pull
. However you may need to e.g.sudo -l
at this point to avoid a password prompt if applicable.- It is good practice to use
--check
and--diff
first to see which changes will be applied.Note: this may fail due to missing files etc., if the play has not yet completed in non-check mode to actually make changes, which is expected.ansible-pull -U git@github.com:ComputeCanada/ansible-cvmfs-server.git --checkout=example --full -i hosts --check --diff
- Run without check mode to apply all changes.
ansible-pull -U git@github.com:ComputeCanada/ansible-cvmfs-server.git --checkout=example --full -i hosts
- If you want to limit the scope of changes to a subset of tasks, use
-t
to run specific tagged tasks. See main.yml for the list of tags that can be specified.
Some parts of the stratum server deployment are not automated and must be done manually in order for the Ansible play to complete successfully.
- A modification to the iptables file will be required, as described by the output of the iptables task if needed.
To test the Ansible role, create a branch in Git (named test
in this example), and pull from there:
ansible-pull -U git@github.com:ComputeCanada/ansible-cvmfs-server.git --checkout=test --full -i hosts