Verified Commit 51f61a0e authored by Loïc Dachary's avatar Loïc Dachary
Browse files

libvirt: enable docker on the hypervisor

parent fcfbac53
......@@ -31,3 +31,51 @@
- python-libvirt
- python-lxml
when: ansible_distribution_release == 'buster'
- name: load enough in .bashrc
blockinfile:
path: /home/{{ ansible_user }}/.bashrc
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
block: |
eval "$(docker run --rm enoughcommunity/enough:latest install)"
- when: ansible_distribution_release == 'buster'
block:
- import_role:
name: ansible-role-docker
- import_role:
name: docker
- name: connect libvirt hypervisor to VPN
hosts: libvirt-hypervisor
become: true
pre_tasks:
- when: vpn != "NOOP"
block:
- name: apt-get install openvpn
apt:
name:
- openvpn
- name: copy VPN credentials
copy:
src: "{{ enough_domain_config_directory }}/{{ vpn }}"
dest: "/etc/openvpn/client/hypervisor.tar.gz"
- name: expand credentials
shell: |
tar zxvf hypervisor.tar.gz
args:
chdir: "/etc/openvpn/client"
- name: systemctl enable openvpn-client@hypervisor
service:
name: openvpn-client@hypervisor
enabled: yes
state: stopped
......@@ -24,6 +24,10 @@ def test_libvirt_install(dotenough_libvirt_fixture):
assert sh.ssh('-oStrictHostKeyChecking=no',
'-i', dotenough.private_key(), f'debian@{hypervisor_ip}',
'which', 'virsh').exit_code == 0
r = sh.ssh('-oStrictHostKeyChecking=no',
'-i', dotenough.private_key(), f'debian@{hypervisor_ip}',
'docker', 'version')
assert 'Docker Engine' in r.stdout.decode('utf-8')
@pytest.mark.libvirt_integration
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment