algo/ec2.yml

109 lines
3.4 KiB
YAML
Raw Normal View History

2016-07-30 16:05:04 +00:00
# vim:ft=ansible:
- name: Create a sandbox instance
hosts: localhost
gather_facts: False
2016-08-11 19:36:36 +00:00
vars_files:
2016-08-16 03:32:44 +00:00
- config.cfg
2016-07-30 16:05:04 +00:00
vars:
instance_type: t2.nano
security_group: vpn-secgroup
regions:
"1": "us-east-1"
"2": "us-west-1"
"3": "us-west-2"
"4": "ap-south-1"
"5": "ap-northeast-2"
"6": "ap-southeast-1"
"7": "ap-southeast-2"
"8": "ap-northeast-1"
"9": "eu-central-1"
"10": "eu-west-1"
"11": "sa-east-1"
vars_prompt:
2016-08-16 03:32:44 +00:00
2016-08-11 19:36:36 +00:00
- name: "aws_access_key"
prompt: "Enter your aws_access_key (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSGettingStartedGuide/AWSCredentials.html):\n"
private: yes
2016-08-16 03:32:44 +00:00
2016-08-11 19:36:36 +00:00
- name: "aws_secret_key"
prompt: "Enter your aws_secret_key (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSGettingStartedGuide/AWSCredentials.html):\n"
2016-08-16 03:32:44 +00:00
private: yes
2016-07-30 16:05:04 +00:00
- name: "region"
prompt: >
What region should the server be located in?
2016-08-16 03:32:44 +00:00
1. us-east-1 US East (N. Virginia)
2. us-west-1 US West (N. California)
2016-07-30 16:05:04 +00:00
3. us-west-2 US West (Oregon)
2016-08-16 03:32:44 +00:00
4. ap-south-1 Asia Pacific (Mumbai)
5. ap-northeast-2 Asia Pacific (Seoul)
6. ap-southeast-1 Asia Pacific (Singapore)
7. ap-southeast-2 Asia Pacific (Sydney)
8. ap-northeast-1 Asia Pacific (Tokyo)
9. eu-central-1 EU (Frankfurt)
10. eu-west-1 EU (Ireland)
2016-07-30 16:05:04 +00:00
11. sa-east-1 South America (São Paulo)
default: "1"
2016-08-11 08:54:34 +00:00
private: no
2016-08-16 03:32:44 +00:00
2016-08-11 19:36:36 +00:00
- name: "aws_server_name"
prompt: "Name the vpn server:\n"
default: "algo.local"
2016-08-16 03:32:44 +00:00
private: no
2016-08-11 19:36:36 +00:00
- name: "ssh_public_key"
2016-08-17 20:39:18 +00:00
prompt: "Enter the local path to your SSH public key:\n"
2016-08-17 20:38:34 +00:00
default: "~/.ssh/id_rsa.pub"
2016-08-16 03:32:44 +00:00
private: no
2016-08-11 08:54:34 +00:00
- name: "dns_enabled"
2016-08-21 16:57:52 +00:00
prompt: "Do you want to install a local DNS resolver to block ads while surfing? (Y or N):\n"
default: "Y"
private: no
- name: "proxy_enabled"
prompt: "Do you want to install a proxy to block ads and decrease traffic usage while surfing? (Y or N):\n"
2016-08-11 08:54:34 +00:00
default: "Y"
private: no
2016-08-16 03:32:44 +00:00
2016-08-11 08:54:34 +00:00
- name: "auditd_enabled"
prompt: "Do you want to use auditd ? (Y or N):\n"
default: "Y"
private: no
2016-08-23 13:51:06 +00:00
- name: "ssh_tunneling_enabled"
prompt: "Do you want to use SSH tunneling ? (Y or N):\n"
default: "Y"
private: no
2016-08-18 08:16:22 +00:00
- name: "easyrsa_p12_export_password"
prompt: "Enter the password for p12 certificates:\n"
default: "vpn"
private: yes
2016-07-30 16:05:04 +00:00
2016-08-11 19:36:36 +00:00
roles:
2016-08-16 04:00:26 +00:00
- cloud-ec2
2016-08-16 03:32:44 +00:00
2016-08-11 08:54:34 +00:00
- name: Post-provisioning tasks
hosts: vpn-host
gather_facts: false
become: true
vars_files:
- config.cfg
2016-08-16 03:32:44 +00:00
2016-08-11 08:54:34 +00:00
pre_tasks:
- name: Install prerequisites
raw: sudo apt-get update -qq && sudo apt-get install -qq -y python2.7
- name: Configure defaults
2016-08-11 20:40:07 +00:00
raw: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
2016-08-16 03:32:44 +00:00
2016-08-11 08:54:34 +00:00
roles:
- common
- security
2016-08-11 19:36:36 +00:00
- vpn
2016-08-21 16:57:52 +00:00
- { role: proxy, when: proxy_enabled is defined and proxy_enabled == "Y" }
2016-08-17 20:26:17 +00:00
- { role: dns_adblocking , when: dns_enabled is defined and dns_enabled == "Y" }
2016-08-16 03:32:44 +00:00
- { role: logging, when: auditd_enabled is defined and auditd_enabled == 'Y' }
2016-08-23 13:51:06 +00:00
- { role: ssh_tunneling, when: ssh_tunneling_enabled is defined and ssh_tunneling_enabled == "Y" }