Ansible playbooks for dlang CI servers
- https://docs.ansible.com/ansible/intro_installation.html
- version should be >=2.2.0.0
-
ansible-galaxy install -r requirements.yml
-
If your local username does not match your ssh account name on the server, configure that account name in your
~/.ssh/config
Host bla.dlang.org User accountname
-
Each container runs it's own sshd server which can be accessed by proxing through the host. The following setting in your
~/.ssh/config
is recommended so that you can e.g. runssh nightlies.builds.dlang.io
.Host *.*.lxd User root ProxyCommand ssh -W %h:%p $(echo %h | cut -d. -f2).dlang.io
For less typing store vault, sudo, and profitbricks passwords in Pass: The Standard Unix Password Manager.
pass add dlangci/ansible_vault
pass add dlangci/sudo
At best also tell git how to diff encrypted files.
git config diff.ansible-vault.textconv 'ansible-vault view --vault-password-file=ansible/query_vault_pass.sh'
Alternatively comment out vault_password_file
in ansible.cfg and ansible_become_pass
in group_vars/all
and pass -K, --ask-become-pass
and --ask-vault-pass
to ansible-playbook
.
- remove host facts caches under .cache/ in case major properties (e.g. IP address, hostname) change
- assuming initial account created during installation (using your commong username and sudo password, also see roles/users)
ssh-copy-id server.dlang.io
ansible -m raw -a 'apt-get update -q=2' server.dlang.io
ansible -m raw -a 'apt-get install --no-install-recommends python-minimal python-apt -q=2' server.dlang.io
ansible -m ping server.dlang.io
# test access
Vagrant to setup local VirtualBox (Jenkins on http:https://172.16.1.2)
-
see comment in Vagrantfile for an example of system-wide
~/.vagrant.d/Vagrantfile
VirtualBox defaults -
vagrant commands
- vagrant up ci
- vagrant halt ci
- vagrant destroy ci
- vagrant provision ci # rerun ansible