Created
February 25, 2015 09:13
-
-
Save cyriac/67bdcea3a09140c96d22 to your computer and use it in GitHub Desktop.
PPTP VPN setup - ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
sudo: yes | |
tasks: | |
- name: set hostname using hostname command | |
command: hostname {{ inventory_hostname }} | |
- name: set hostname in /etc/hostname | |
shell: echo {{ inventory_hostname }} > /etc/hostname | |
- name: Set ip_forward (ipv4) | |
sysctl: name="net.ipv4.ip_forward" value=1 sysctl_set=yes state=present reload=yes | |
- name: Set ip_forward (ipv6) | |
sysctl: name="net.ipv6.conf.all.forwarding" value=1 sysctl_set=yes state=present reload=yes | |
- name: Install pptp | |
apt: pkg=pptpd | |
- name: Adding internal routing IPs (localip) | |
lineinfile: dest=/etc/pptpd.conf line="localip 10.99.99.99" | |
- name: Adding internal routing IPs (remoteip) | |
lineinfile: dest=/etc/pptpd.conf line="remoteip 10.99.99.100-199" | |
- name: Adding sample access credentials | |
lineinfile: dest=/etc/ppp/chap-secrets line="#<username> pptpd <password> *" | |
- name: Adding masquerade config to rc.local | |
lineinfile: dest=/etc/rc.local line="iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" | |
- name: Executing iptables update | |
command: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment