Last active
March 22, 2022 22:52
-
-
Save nicck/5554bea184aa34164b22 to your computer and use it in GitHub Desktop.
Revisions
-
nicck revised this gist
Dec 2, 2014 . 2 changed files with 14 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ [vpshost] xxx.xxx.xx.xx This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,20 @@ # ansible-playbook -v -i hosts pptp.yml # ubuntu-14.04_32bit Server --- - hosts: vpshost remote_user: root sudo: yes vars: pptp_username: login pptp_password: pswrd tasks: - name: pptpd and iptables installed apt: name={{ item }} state=present with_items: - pptpd - iptables # - dnsutils - name: local and remote ip specified in pptpd.conf lineinfile: dest=/etc/pptpd.conf line="{{ item }}" @@ -21,15 +25,13 @@ - restart pptpd - name: users in chap-secrets lineinfile: dest=/etc/ppp/chap-secrets line="{{ pptp_username }} pptpd {{ pptp_password }} *" - name: dns added to pptpd-options lineinfile: dest=/etc/ppp/pptpd-options line="{{ item }}" with_items: - ms-dns 8.8.8.8 - ms-dns 8.8.4.4 notify: - restart pptpd -
nicck created this gist
Oct 27, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ --- - hosts: atlantic remote_user: root sudo: yes vars: pptp_username: box1 pptp_password: junkfood tasks: - name: pptpd and iptables installed apt: name={{ item }} state=present with_items: - pptpd - iptables - name: local and remote ip specified in pptpd.conf lineinfile: dest=/etc/pptpd.conf line="{{ item }}" with_items: - localip 192.168.0.1 - remoteip 192.168.0.100-200 notify: - restart pptpd - name: users in chap-secrets lineinfile: dest=/etc/ppp/chap-secrets line="{{ username }} pptpd {{ password }} *" - name: dns added to pptpd-options lineinfile: dest=/etc/ppp/pptpd-options line="ms-dns 8.8.8.8" notify: - restart pptpd - name: dns added to pptpd-options lineinfile: dest=/etc/ppp/pptpd-options line="ms-dns 8.8.4.4" notify: - restart pptpd - name: Setup Forwarding sysctl: name=net.ipv4.ip_forward value=1 state=present reload=yes - name: NAT rule for iptables command: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE notify: - save iptables handlers: - name: save iptables command: iptables-save - name: restart pptpd service: name=pptpd state=restarted