algo/deploy.yml

56 lines
1.9 KiB
YAML
Raw Normal View History

2016-08-28 20:04:59 +00:00
- name: Configure the server and install required software
hosts: localhost
2016-08-28 21:05:20 +00:00
tags: algo
2016-08-28 20:04:59 +00:00
vars_files:
- config.cfg
2016-09-19 17:18:27 +00:00
2016-08-28 20:04:59 +00:00
roles:
- { role: cloud-digitalocean, tags: ['digitalocean'] }
2016-09-19 17:18:27 +00:00
- { role: cloud-ec2, tags: ['ec2'] }
- { role: cloud-gce, tags: ['gce'] }
2016-09-19 16:54:45 +00:00
- { role: local, tags: ['local'] }
2016-09-19 17:18:27 +00:00
2016-08-28 20:04:59 +00:00
- name: Post-provisioning tasks
hosts: vpn-host
gather_facts: false
2016-09-19 17:18:27 +00:00
tags: algo
2016-08-28 20:04:59 +00:00
become: true
vars_files:
- config.cfg
2016-09-19 17:18:27 +00:00
pre_tasks:
2016-08-28 20:04:59 +00:00
- name: Common pre-tasks
include: playbooks/common.yml
2016-09-18 10:12:17 +00:00
tags: [ 'digitalocean', 'ec2', 'gce', 'pre' ]
2016-09-19 17:18:27 +00:00
2016-08-28 20:04:59 +00:00
- name: DigitalOcean pre-tasks
include: playbooks/digitalocean.yml
2016-09-18 10:12:17 +00:00
tags: [ 'digitalocean' ]
2016-08-28 20:04:59 +00:00
roles:
- { role: security, tags: [ 'security' ] }
- { role: proxy, tags: [ 'proxy', 'adblock' ] }
- { role: dns_adblocking, tags: ['dns', 'adblock' ] }
- { role: logging, tags: [ 'logging' ] }
- { role: ssh_tunneling, tags: [ 'ssh_tunneling' ] }
2016-09-19 17:18:27 +00:00
- { role: vpn, tags: [ 'vpn' ] }
2016-08-28 20:04:59 +00:00
handlers:
- name: reload eth0
2016-08-28 21:05:20 +00:00
shell: sh -c 'ifdown eth0; ip addr flush dev eth0; ifup eth0'
post_tasks:
- shell: |
echo "#----------------------------------------------------------------------#"
echo "# Congratulations! #"
echo "# Your Algo server is running. #"
echo "# Config files and certificates are in the ./configs/ directory. #"
echo "# Go to https://whoer.net/ after connecting #"
echo "# and ensure that all your traffic passes through the VPN. #"
echo "# Local DNS resolver and Proxy IP address: {{ local_service_ip }}"
echo "#----------------------------------------------------------------------#"
tags: always
register: congrats
- debug: msg="{{ congrats.stdout_lines }}"
tags: always