├── defaults └── main.yml ├── handlers └── main.yml ├── tasks ├── main.yml ├── Ubuntu.yml └── CentOS.yml ├── vars └── main.yml ├── README.md ├── LICENSE └── meta └── main.yml /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for include.pritunl 3 | -------------------------------------------------------------------------------- /handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for include.pritunl 3 | -------------------------------------------------------------------------------- /tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: SYSTEM | check Centos version 4 | include: CentOS.yml 5 | when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' 6 | 7 | - name: SYSTEM | check Ubuntu 8 | include: Ubuntu.yml 9 | when: ansible_distribution == 'Ubuntu' -------------------------------------------------------------------------------- /vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | epel_release: 7-2 3 | epel_release_pkg: epel-release-{{ epel_release }}.noarch.rpm 4 | epel_release_url: http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/{{ epel_release_pkg }} 5 | 6 | pritunl_version: 0.10.12-1 7 | pritunl_pkg: pritunl-{{ pritunl_version }}.el7.centos.x86_64.rpm 8 | pritunl_url: http://pritunl.com/bin/{{ pritunl_pkg }} 9 | 10 | pritunl_admin_port: 9700 11 | 12 | # Pritunl defaults 13 | # 14 | # Admin Port: 9700 15 | # Admin username: admin 16 | # Admin password: admin 17 | -------------------------------------------------------------------------------- /tasks/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Ubuntu | SYSTEM | update cache 3 | apt: update_cache=yes 4 | tags: update 5 | 6 | - name: Ubuntu | SYSTEM | install dependencies 7 | apt: name=python-software-properties state=present 8 | tags: install_reps 9 | 10 | - name: Ubuntu | SYSTEM | add apt repository 11 | apt_repository: repo='ppa:pritunl/ppa' state=present 12 | tags: add_repo 13 | 14 | - name: Ubuntu | SYSTEM | update cache 15 | apt: update_cache=yes 16 | tags: update 17 | 18 | - name: Ubuntu | PRITUNL | install 19 | apt: name=pritunl update_cache=yes state=present 20 | tags: install_pritunl -------------------------------------------------------------------------------- /tasks/CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: CentOS | SYSTEM | install epel-release 4 | yum: name=epel-release state=present 5 | tags: install epel-release 6 | 7 | - name: CentOS | PRITUNL | download 8 | get_url: url={{ pritunl_url }} dest=/tmp mode=0440 9 | tags: get_pritunl 10 | 11 | - name: CentOS | PRITUNL | install 12 | yum: name=/tmp/{{ pritunl_pkg }} state=present 13 | tags: install_pritunl 14 | 15 | - name: CentOS | PRITUNL | start service 16 | service: name=pritunl state=started 17 | tags: start_pritunl 18 | 19 | - name: CentOS | PRITUNL | enable service 20 | service: name=pritunl enabled=yes 21 | tags: enable_pritunl -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | Simple Pritunl VPN setup with Ansible. 5 | 6 | 7 | Requirements 8 | ------------ 9 | 10 | This role expects CentOS 7 operating system. 11 | 12 | 13 | Role Variables 14 | -------------- 15 | 16 | All variables are defined under `vars/main.yml`. 17 | 18 | 19 | Dependencies 20 | ------------ 21 | 22 | Do dependencies. 23 | 24 | 25 | Example Playbook 26 | ---------------- 27 | 28 | Playbook example: 29 | 30 | - hosts: vpn 31 | sudo: yes 32 | roles: 33 | - { role: include.pritunl } 34 | 35 | License 36 | ------- 37 | 38 | BSD 39 | 40 | Author Information 41 | ------------------ 42 | 43 | Francisco Cabrita - francisco.cabrita@gmail.com 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Francisco Cabrita 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Francisco Cabrita 4 | description: Simple Pritunl VPN setup with Ansible 5 | # Some suggested licenses: 6 | # - BSD (default) 7 | # - MIT 8 | # - GPLv2 9 | # - GPLv3 10 | # - Apache 11 | # - CC-BY 12 | license: BSD 13 | min_ansible_version: 1.2 14 | # 15 | # Below are all platforms currently available. Just uncomment 16 | # the ones that apply to your role. If you don't see your 17 | # platform on this list, let us know and we'll get it added! 18 | # 19 | platforms: 20 | - name: EL 21 | versions: 22 | # - all 23 | # - 5 24 | # - 6 25 | - 7 26 | #- name: GenericUNIX 27 | # versions: 28 | # - all 29 | # - any 30 | #- name: Fedora 31 | # versions: 32 | # - all 33 | # - 16 34 | # - 17 35 | # - 18 36 | # - 19 37 | # - 20 38 | #- name: opensuse 39 | # versions: 40 | # - all 41 | # - 12.1 42 | # - 12.2 43 | # - 12.3 44 | # - 13.1 45 | # - 13.2 46 | #- name: Amazon 47 | # versions: 48 | # - all 49 | # - 2013.03 50 | # - 2013.09 51 | #- name: GenericBSD 52 | # versions: 53 | # - all 54 | # - any 55 | #- name: FreeBSD 56 | # versions: 57 | # - all 58 | # - 8.0 59 | # - 8.1 60 | # - 8.2 61 | # - 8.3 62 | # - 8.4 63 | # - 9.0 64 | # - 9.1 65 | # - 9.1 66 | # - 9.2 67 | - name: Ubuntu 68 | versions: 69 | # - all 70 | # - lucid 71 | # - maverick 72 | # - natty 73 | # - oneiric 74 | # - precise 75 | # - quantal 76 | # - raring 77 | # - saucy 78 | - trusty 79 | #- name: SLES 80 | # versions: 81 | # - all 82 | # - 10SP3 83 | # - 10SP4 84 | # - 11 85 | # - 11SP1 86 | # - 11SP2 87 | # - 11SP3 88 | #- name: GenericLinux 89 | # versions: 90 | # - all 91 | # - any 92 | #- name: Debian 93 | # versions: 94 | # - all 95 | # - etch 96 | # - lenny 97 | # - squeeze 98 | # - wheezy 99 | # 100 | # Below are all categories currently available. Just as with 101 | # the platforms above, uncomment those that apply to your role. 102 | # 103 | categories: 104 | #- cloud 105 | #- cloud:ec2 106 | #- cloud:gce 107 | #- cloud:rax 108 | #- clustering 109 | #- database 110 | #- database:nosql 111 | #- database:sql 112 | #- development 113 | #- monitoring 114 | - networking 115 | #- packaging 116 | #- system 117 | #- web 118 | dependencies: [] 119 | # List your role dependencies here, one per line. Only 120 | # dependencies available via galaxy should be listed here. 121 | # Be sure to remove the '[]' above if you add dependencies 122 | # to this list. 123 | 124 | --------------------------------------------------------------------------------