]> git.phdru.name Git - ansible.git/commitdiff
Feat(OpenVPN): Add separate role to install OpenVPN
authorOleg Broytman <phd@phdru.name>
Wed, 8 Apr 2020 20:24:07 +0000 (23:24 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 8 Apr 2020 20:24:07 +0000 (23:24 +0300)
playbooks/debian/init-local-phd.yml
playbooks/roles/openvpn/README.txt [new file with mode: 0644]
playbooks/roles/openvpn/tasks/main.yml [new file with mode: 0644]

index 01e653429ba77e43a3adec3ee74fdcaa2e1cd667..285bf12c591213c45232f9045a8705f9edcddda9 100644 (file)
@@ -29,7 +29,7 @@
         name: ['acpi', 'audacious', 'chromium', 'fuse-convmvfs', 'curlftpfs',
                'docutils-doc', 'fvwm', 'gajim', 'gxmessage',
                'hibernate', 'libdbus-1-3', # for Firefox
-               'mpv', 'openvpn', 'pavucontrol', 'pinentry-gtk2', 'pulseaudio',
+               'mpv', 'pavucontrol', 'pinentry-gtk2', 'pulseaudio',
                'qpdfview', 'rxvt-unicode', 'sqlite3-doc', 'sshfs', 'uswsusp',
                'vim-doc', 'vim-gtk3',
                'x11-apps', 'x11-xserver-utils', 'xbindkeys', 'xclip', 'xinit',
diff --git a/playbooks/roles/openvpn/README.txt b/playbooks/roles/openvpn/README.txt
new file mode 100644 (file)
index 0000000..d072a74
--- /dev/null
@@ -0,0 +1 @@
+Install and setup OpenVPN (currently Debian-only).
diff --git a/playbooks/roles/openvpn/tasks/main.yml b/playbooks/roles/openvpn/tasks/main.yml
new file mode 100644 (file)
index 0000000..6cc6296
--- /dev/null
@@ -0,0 +1,20 @@
+- name: Install OpenVPN (Debian)
+  become: true
+  apt:
+    autoclean: yes
+    autoremove: yes
+    cache_valid_time: 3600
+    install_recommends: no
+    name: ['openvpn']
+    state: latest
+    update_cache: yes
+  when: ansible_facts.os_family == 'Debian'
+
+- name: Configure OpenVPN (Debian)
+  become: true
+  lineinfile:
+    path: /etc/default/openvpn
+    regexp: '^AUTOSTART="none"$'
+    line: 'AUTOSTART="none"'
+    insertafter: '^#AUTOSTART="home office"$'
+  when: ansible_facts.os_family == 'Debian'