54 lines
No EOL
1.5 KiB
YAML
Executable file
54 lines
No EOL
1.5 KiB
YAML
Executable file
- hosts: vpnservers
|
|
gather_facts: yes
|
|
become_user: root
|
|
tasks:
|
|
tasks:
|
|
- name: Install python 2
|
|
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
|
|
- name: Download OpenVPN install script.
|
|
get_url:
|
|
url: https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh
|
|
dest: /etc/openvpn-install.sh
|
|
- name: Install OpenVPN
|
|
command: bash /etc/openvpn-install.sh
|
|
environment:
|
|
APPROVE_INSTALL: y
|
|
APPROVE_IP: y
|
|
IPV6_SUPPORT: n
|
|
PORT_CHOICE: 1
|
|
PROTOCOL_CHOICE: 2
|
|
DNS: 7
|
|
COMPRESSION_ENABLED: n
|
|
CUSTOMIZE_ENC: n
|
|
CLIENT: client
|
|
PASS: 1
|
|
- name: Retrieve the OpenVPN client file.
|
|
fetch:
|
|
src: /root/client.ovpn
|
|
dest: .
|
|
mode: 0774
|
|
- name: Install obfsproxy
|
|
apt: pkg=obfs4proxy state=present
|
|
- name: Creates obfs4 directories
|
|
file:
|
|
path: /var/lib/tor/pt_state/obfs4
|
|
state: directory
|
|
- name: Copy obfs4 config from host to remote
|
|
copy:
|
|
src: obfs4.config
|
|
dest: /var/lib/tor/pt_state/obfs4/obfs4.config
|
|
- name: Create systemd service for obfs4
|
|
copy:
|
|
src: obfs4proxy.service
|
|
dest: /etc/systemd/system/obfs4proxy.service
|
|
- name: Enable the obfs4proxy systemd service
|
|
systemd:
|
|
name: obfs4proxy
|
|
state: started
|
|
enabled: yes
|
|
- name: Retrieve the obs4 cert key file.
|
|
fetch:
|
|
src: /var/lib/tor/pt_state/obfs4/obfs4_bridgeline.txt
|
|
dest: .
|
|
mode: 0774
|
|
|