From 5176d94282c5c94129cfd0ad55691c445fe1408c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 8 Apr 2020 23:24:07 +0300 Subject: [PATCH] Feat(OpenVPN): Add separate role to install OpenVPN --- playbooks/debian/init-local-phd.yml | 2 +- playbooks/roles/openvpn/README.txt | 1 + playbooks/roles/openvpn/tasks/main.yml | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 playbooks/roles/openvpn/README.txt create mode 100644 playbooks/roles/openvpn/tasks/main.yml diff --git a/playbooks/debian/init-local-phd.yml b/playbooks/debian/init-local-phd.yml index 01e6534..285bf12 100644 --- a/playbooks/debian/init-local-phd.yml +++ b/playbooks/debian/init-local-phd.yml @@ -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 index 0000000..d072a74 --- /dev/null +++ b/playbooks/roles/openvpn/README.txt @@ -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 index 0000000..6cc6296 --- /dev/null +++ b/playbooks/roles/openvpn/tasks/main.yml @@ -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' -- 2.39.5