From: Oleg Broytman Date: Wed, 8 Apr 2020 20:24:07 +0000 (+0300) Subject: Feat(OpenVPN): Add separate role to install OpenVPN X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=5176d94282c5c94129cfd0ad55691c445fe1408c;p=ansible.git Feat(OpenVPN): Add separate role to install OpenVPN --- 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'