Browse Source

Enable openvpn role in vagrant, plus:

* Removed unicode char from task name (ansible 1.3 doesn’t like it)
* Use ansible sysctl module instead of lineinfile
* Wait for only 5 seconds (for fully automated deploy)
Luke Cyca 11 years ago
parent
commit
69fc8b7eb0
2 changed files with 5 additions and 7 deletions
  1. 1
    1
      Vagrantfile
  2. 4
    6
      roles/vpn/tasks/openvpn.yml

+ 1
- 1
Vagrantfile View File

@@ -18,7 +18,7 @@ Vagrant.configure('2') do |config|
18 18
     ansible.host_key_checking = false
19 19
 
20 20
     # ansible.tags = ['blog']
21
-    ansible.skip_tags = ['openvpn']
21
+    # ansible.skip_tags = ['openvpn']
22 22
     # ansible.verbose = 'vvvv'
23 23
 
24 24
     # Workaround: https://github.com/mitchellh/vagrant/issues/2174

+ 4
- 6
roles/vpn/tasks/openvpn.yml View File

@@ -79,7 +79,7 @@
79 79
   command: openvpn --genkey --secret {{ openvpn_hmac_firewall }}
80 80
            creates={{ openvpn_hmac_firewall }}
81 81
 
82
-- name: Generate DiffieHellman parameters (this will take a while)
82
+- name: Generate Diffie-Hellman parameters (this will take a while)
83 83
   command: openssl dhparam -out {{ openvpn_dhparam }} {{ openvpn_key_size }}
84 84
            creates={{ openvpn_dhparam }}
85 85
 
@@ -87,10 +87,7 @@
87 87
   copy: src=etc_rc.local dest=/etc/rc.local
88 88
 
89 89
 - name: Enable IPv4 traffic forwarding
90
-  lineinfile: dest=/etc/sysctl.conf
91
-              regexp="^#?net.ipv4.ip_forward"
92
-              line="net.ipv4.ip_forward=1"
93
-- shell: echo 1 > /proc/sys/net/ipv4/ip_forward
90
+  sysctl: name=net.ipv4.ip_forward value=1
94 91
 
95 92
 - name: Allow OpenVPN through the firewall
96 93
   command: "{{ item }}"
@@ -129,4 +126,5 @@
129 126
          dest=/tmp/sovereign-openvpn-files
130 127
   with_items: openvpn_clients
131 128
 
132
-- pause: prompt="You are ready to set up your OpenVPN clients. The files that you need are in /tmp/sovereign-openvpn-files. Make sure LZO compression is enabled and that you provide the ta.key file for the TLS-Auth option with a direction of '1'. Press any key to continue..."
129
+- pause: seconds=5
130
+         prompt="You are ready to set up your OpenVPN clients. The files that you need are in /tmp/sovereign-openvpn-files. Make sure LZO compression is enabled and that you provide the ta.key file for the TLS-Auth option with a direction of '1'. Press any key to continue..."

Loading…
Cancel
Save