algo/deploy.yml

97 lines
2.5 KiB
YAML
Raw Normal View History

2016-12-13 19:08:05 +00:00
- name: Configure the server
2016-08-28 20:04:59 +00:00
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-12-12 19:02:45 +00:00
pre_tasks:
- block:
- name: Local pre-tasks
include: playbooks/local.yml
tags: [ 'always' ]
2016-12-12 19:02:45 +00:00
- name: Local pre-tasks
include: playbooks/local_ssh.yml
become: false
when: Deployed_By_Algo is defined and Deployed_By_Algo == "Y"
tags: [ 'local' ]
rescue:
- debug: var=fail_hint
tags: always
- fail:
tags: always
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-12-10 18:09:34 +00:00
- { role: cloud-azure, tags: ['azure'] }
2016-09-19 16:54:45 +00:00
- { role: local, tags: ['local'] }
2016-09-19 17:18:27 +00:00
2016-12-13 18:58:45 +00:00
post_tasks:
- block:
- name: Local post-tasks
include: playbooks/post.yml
become: false
tags: [ 'cloud' ]
rescue:
- debug: var=fail_hint
tags: always
- fail:
tags: always
2016-12-13 19:05:55 +00:00
2016-12-13 19:08:05 +00:00
- name: Configure the server and install required software
2016-08-28 20:04:59 +00:00
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:
- block:
- name: Common pre-tasks
include: playbooks/common.yml
tags: [ 'digitalocean', 'ec2', 'gce', 'azure', 'local', 'pre' ]
rescue:
- debug: var=fail_hint
tags: always
- fail:
tags: always
2016-09-19 17:18:27 +00:00
2016-08-28 20:04:59 +00:00
roles:
- { role: security, tags: [ 'security' ] }
- { role: dns_adblocking, tags: ['dns', 'adblock' ] }
- { 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
post_tasks:
- block:
- debug:
msg:
- "{{ congrats.common.split('\n') }}"
- " {{ congrats.p12_pass }}"
- " {% if Store_CAKEY is defined and Store_CAKEY == 'N' %}{% else %}{{ congrats.ca_key_pass }}{% endif %}"
- " {% if cloud_deployment is defined %}{{ congrats.ssh_access }}{% endif %}"
tags: always
2017-01-11 17:55:07 +00:00
- name: Save the CA key password
local_action: >
shell echo "{{ easyrsa_CA_password }}" > /tmp/ca_password
become: no
tags: tests
- name: Delete the CA key
local_action:
module: file
path: "configs/{{ IP_subject_alt_name }}/pki/private/cakey.pem"
state: absent
become: no
tags: always
when: Store_CAKEY is defined and Store_CAKEY == "N"
rescue:
- debug: var=fail_hint
tags: always
- fail:
tags: always