diff --git a/roles/vpn/tasks/ubuntu-hacks.yml b/roles/vpn/tasks/ubuntu-hacks.yml new file mode 100644 index 0000000..fbe2cbc --- /dev/null +++ b/roles/vpn/tasks/ubuntu-hacks.yml @@ -0,0 +1,14 @@ +--- + +- name: Configure apt to use the Xenial release by default + template: src=01_xenial_aptconf.j2 dest=/etc/apt/apt.conf.d/01xenial + +- name: Configure packages preferences + template: src=01_strongswan.pref.j2 dest=/etc/apt/preferences.d/01_strongswan.pref + +- name: Configure the Ubuntu Zesty repository + apt_repository: + repo: deb http://mirrors.kernel.org/ubuntu/ zesty main + state: present + filename: 'zesty' + update_cache: yes diff --git a/roles/vpn/tasks/ubuntu.yml b/roles/vpn/tasks/ubuntu.yml index 4856a97..971d905 100644 --- a/roles/vpn/tasks/ubuntu.yml +++ b/roles/vpn/tasks/ubuntu.yml @@ -3,6 +3,9 @@ - set_fact: strongswan_additional_plugins: [] +- include: ubuntu-hacks.yml + when: ansible_distribution_version == "16.04" + - name: Ubuntu | Install strongSwan apt: name=strongswan state=latest update_cache=yes install_recommends=yes diff --git a/roles/vpn/templates/01_strongswan.pref.j2 b/roles/vpn/templates/01_strongswan.pref.j2 new file mode 100644 index 0000000..3249758 --- /dev/null +++ b/roles/vpn/templates/01_strongswan.pref.j2 @@ -0,0 +1,3 @@ +Package: *strongswan* +Pin: release n=zesty +Pin-Priority: 9000 diff --git a/roles/vpn/templates/01_xenial_aptconf.j2 b/roles/vpn/templates/01_xenial_aptconf.j2 new file mode 100644 index 0000000..c589ffc --- /dev/null +++ b/roles/vpn/templates/01_xenial_aptconf.j2 @@ -0,0 +1 @@ +APT::Default-Release "xenial";