setup-cockpit/roles/protonvpn/tasks/main.yml

43 lines
1.1 KiB
YAML

---
- name: Install packages (Archlinux)
become: true
pacman:
name:
- openvpn
when: ansible_distribution == 'Archlinux'
- name: Install packages (Debian)
become: true
apt:
name:
- openvpn
# TODO: add openvpn-update-systemd-resolved equivalent for Debian
when: ansible_distribution == 'Debian'
- name: Clone openvpn-update-systemd-resolved
git:
repo: https://aur.archlinux.org/openvpn-update-systemd-resolved.git
dest: ~/builds/openvpn-update-systemd-resolved
clone: yes
when: ansible_distribution == 'Archlinux'
- name: Make and install openvpn-update-systemd-resolved
command:
cmd: makepkg -cirs --needed
chdir: ~/builds/openvpn-update-systemd-resolved
when: ansible_distribution == 'Archlinux'
- name: Copy client confs
become: true
copy:
src: "{{ ansible_facts.user_dir }}/src/secrets/setup-cockpit/protonvpn_confs/"
dest: /etc/openvpn/client/
mode: 0644
owner: root
group: root
remote_src: yes
- name: Enable protonvpn service
systemd:
name: openvpn-client@fr.protonvpn.com.udp
enabled: true