This commit is contained in:
Jack Ivanov 2016-09-19 20:18:27 +03:00
parent 69e7f1e5dc
commit 4d731580b7
7 changed files with 17 additions and 95 deletions

View File

@ -3,26 +3,26 @@
tags: algo
vars_files:
- config.cfg
roles:
- { role: cloud-digitalocean, tags: ['digitalocean'] }
- { role: cloud-ec2, tags: ['ec2'] }
- { role: cloud-gce, tags: ['gce'] }
- { role: cloud-ec2, tags: ['ec2'] }
- { role: cloud-gce, tags: ['gce'] }
- { role: local, tags: ['local'] }
- name: Post-provisioning tasks
hosts: vpn-host
gather_facts: false
tags: algo
tags: algo
become: true
vars_files:
- config.cfg
pre_tasks:
pre_tasks:
- name: Common pre-tasks
include: playbooks/common.yml
tags: [ 'digitalocean', 'ec2', 'gce', 'pre' ]
- name: DigitalOcean pre-tasks
include: playbooks/digitalocean.yml
tags: [ 'digitalocean' ]
@ -33,9 +33,9 @@
- { role: dns_adblocking, tags: ['dns', 'adblock' ] }
- { role: logging, tags: [ 'logging' ] }
- { role: ssh_tunneling, tags: [ 'ssh_tunneling' ] }
- { role: vpn, tags: [ 'vpn' ] }
- { role: vpn, tags: [ 'vpn' ] }
handlers:
- name: reload eth0
shell: sh -c 'ifdown eth0; ip addr flush dev eth0; ifup eth0'

View File

@ -1,5 +1,5 @@
- name: Install prerequisites
raw: sudo apt-get update -qq && sudo apt-get install -qq -y python2.7
- name: Configure defaults
raw: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

View File

@ -1,81 +1,3 @@
#vars:
#regions:
#"1": "ams2"
#"2": "ams3"
#"3": "fra1"
#"4": "lon1"
#"5": "nyc1"
#"6": "nyc2"
#"7": "nyc3"
#"8": "sfo1"
#"9": "sfo2"
#"10": "sgp1"
#"11": "tor1"
#"12": "blr1"
#vars_prompt:
#- name: "do_access_token"
#prompt: "Enter your API Token (https://cloud.digitalocean.com/settings/api/tokens):\n"
#private: yes
#- name: "do_ssh_name"
#prompt: "Enter a valid SSH key name (https://cloud.digitalocean.com/settings/security):\n"
#private: no
#- name: "do_region"
#prompt: >
#What region should the server be located in?
#1. Amsterdam (Datacenter 2)
#2. Amsterdam (Datacenter 3)
#3. Frankfurt
#4. London
#5. New York (Datacenter 1)
#6. New York (Datacenter 2)
#7. New York (Datacenter 3)
#8. San Francisco (Datacenter 1)
#9. San Francisco (Datacenter 2)
#10. Singapore
#11. Toronto
#12. Bangalore
#Enter the number of your desired region:
#default: "7"
#private: no
#- name: "do_server_name"
#prompt: "Name the vpn server:\n"
#default: "algo.local"
#private: no
#- name: "dns_enabled"
#prompt: "Do you want to install a local DNS resolver to block ads while surfing? (y/n):\n"
#default: "y"
#private: no
#- name: "proxy_enabled"
#prompt: "Do you want to install an HTTP proxy to block ads and decrease traffic usage while surfing? (y/n):\n"
#default: "y"
#private: no
#- name: "auditd_enabled"
#prompt: "Do you want to use auditd for security monitoring (see config.cfg)? (y/n):\n"
#default: "y"
#private: no
#- name: "ssh_tunneling_enabled"
#prompt: "Do you want each user to have their own account for SSH tunneling? (y/n):\n"
#default: "y"
#private: no
#- name: "security_enabled"
#prompt: "Do you want to enable the security role? (y/n):\n"
#default: "y"
#private: no
#- name: "easyrsa_p12_export_password"
#prompt: "Enter a password for p12 certificates and SSH private keys: (minimum five characters)\n"
#default: "vpnpw"
#private: yes
- name: Enable IPv6 on the droplet
uri:
url: "https://api.digitalocean.com/v2/droplets/{{ do_droplet_id }}/actions"
@ -111,4 +33,4 @@
- name: Wait for SSH to become available
local_action: "wait_for port=22 host={{ inventory_hostname }} timeout=320"
become: false
become: false

View File

@ -15,7 +15,7 @@
- name: Enable services
service: name=auditd enabled=yes
# Rsyslog
- name: Rsyslog configured
@ -29,4 +29,4 @@
- restart rsyslog
- name: Enable services
service: name=rsyslog enabled=yes
service: name=rsyslog enabled=yes

View File

@ -2,12 +2,12 @@
apt: name="{{ item }}" state=latest
with_items:
- unattended-upgrades
- name: Configure unattended-upgrades
template: src=50unattended-upgrades.j2 dest=/etc/apt/apt.conf.d/50unattended-upgrades owner=root group=root mode=0644
- name: Periodic upgrades configured
template: src=10periodic.j2 dest=/etc/apt/apt.conf.d/10periodic owner=root group=root mode=0644
template: src=10periodic.j2 dest=/etc/apt/apt.conf.d/10periodic owner=root group=root mode=0644
- name: Find directories for minimizing access
stat:

View File

@ -6,7 +6,7 @@
- name: restart apparmor
service: name=apparmor state=restarted
- name: save iptables
shell: service netfilter-persistent save

View File

@ -2,4 +2,4 @@
dependencies:
- { role: common }