algo/gce.yml

94 lines
2.6 KiB
YAML
Raw Normal View History

2016-08-14 11:13:23 +00:00
- name: Configure the server and install required software
hosts: localhost
gather_facts: false
vars:
2016-08-14 13:36:50 +00:00
zones:
"1": "us-central1-a"
"2": "us-central1-b"
"3": "us-central1-c"
"4": "us-central1-f"
"5": "us-east1-b"
"6": "us-east1-c"
"7": "us-east1-d"
"8": "europe-west1-b"
"9": "europe-west1-c"
"10": "europe-west1-d"
"11": "asia-east1-a"
"12": "asia-east1-b"
"13": "asia-east1-c"
2016-08-14 11:13:23 +00:00
2016-08-14 13:36:50 +00:00
vars_prompt:
- name: "credentials_file"
prompt: "Enter the local path to your credentials JSON file [ex: ~/gogle_cloud.json] (https://support.google.com/cloud/answer/6158849?hl=en&ref_topic=6262490#serviceaccounts):\n"
private: no
2016-08-16 03:32:44 +00:00
2016-08-14 13:36:50 +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-14 11:13:23 +00:00
2016-08-14 13:36:50 +00:00
- name: "zone"
prompt: >
What zone should the server be located in?
1. Central US (Iowa A)
2. Central US (Iowa B)
3. Central US (Iowa C)
4. Central US (Iowa F)
5. Eastern US (South Carolina B)
6. Eastern US (South Carolina C)
7. Eastern US (South Carolina D)
8. Western Europe (Belgium B)
9. Western Europe (Belgium C)
10. Western Europe (Belgium D)
11. East Asia (Taiwan A)
12. East Asia (Taiwan B)
13. East Asia (Taiwan C)
Please choose the number of your zone. Press enter for default (#8) zone.
default: "8"
private: no
2016-08-16 03:32:44 +00:00
2016-08-14 13:36:50 +00:00
- name: "server_name"
prompt: "Name the vpn server:\n"
default: "algo"
private: no
2016-08-16 03:32:44 +00:00
2016-08-14 13:36:50 +00:00
- name: "dns_enabled"
prompt: "Do you want to use a local DNS resolver to block ads while surfing? (Y or N):\n"
default: "Y"
private: no
2016-08-16 03:32:44 +00:00
2016-08-14 13:36:50 +00:00
- name: "auditd_enabled"
prompt: "Do you want to use auditd ? (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-08-16 03:32:44 +00:00
2016-08-14 11:13:23 +00:00
roles:
2016-08-16 04:00:26 +00:00
- cloud-gce
2016-08-14 11:13:23 +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-14 11:13:23 +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-16 03:32:44 +00:00
raw: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
2016-08-14 11:13:23 +00:00
roles:
- common
- security
2016-08-17 20:26:17 +00:00
- proxy
2016-08-14 11:13:23 +00:00
- vpn
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' }