toansible: Add protonvpn installation

This commit is contained in:
flyingscorpio@clevo 2022-02-23 22:12:58 +01:00
parent c90c5457f0
commit f531c08f23
4 changed files with 47 additions and 17 deletions

View file

@ -36,23 +36,6 @@ repos:
- include:
- repos.yml
protonvpn:
- install:
- openvpn
- clone:
url: https://aur.archlinux.org/openvpn-update-systemd-resolved.git
dest: ~/builds/openvpn-update-systemd-resolved
condition: arch
- run:
command: cd ~/builds/openvpn-update-systemd-resolved && makepkg -cirs --needed
condition: arch
- run:
- sudo cp ~/src/secrets/setup-cockpit/protonvpn_confs/*.conf /etc/openvpn/client/
- run:
- sudo cp ~/src/secrets/setup-cockpit/protonvpn_confs/pvpn.auth /etc/openvpn/client/
- run:
- sudo systemctl enable openvpn-client@fr.protonvpn.com.udp.service
mariadb:
- install:
- mariadb

View file

@ -37,3 +37,5 @@
tags: lilypond
- role: latex
tags: latex
- role: protonvpn
tags: protonvpn

View file

@ -0,0 +1,3 @@
---
dependencies:
- role: git

View file

@ -0,0 +1,42 @@
---
- name: Install packages (Archlinux)
become: true
pacman:
name:
- openvpn
when: ansible_distribution == 'Archlinux'
- name: Install packages (Debian)
become: true
apt:
name:
- openvpn
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