mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-14 00:33:02 +02:00
first round of debugging
This commit is contained in:
parent
53260c9a82
commit
24e03b6faf
4 changed files with 66 additions and 51 deletions
|
@ -20,7 +20,7 @@
|
||||||
- { name: Google Compute Engine, alias: gce }
|
- { name: Google Compute Engine, alias: gce }
|
||||||
- { name: Scaleway, alias: scaleway}
|
- { name: Scaleway, alias: scaleway}
|
||||||
- { name: OpenStack (DreamCompute optimised), alias: openstack }
|
- { name: OpenStack (DreamCompute optimised), alias: openstack }
|
||||||
- { name: CloudStack, alias: cloudstask }
|
- { name: CloudStack, alias: cloudstack }
|
||||||
- { name: Install to existing Ubuntu 18.04 server (Advanced), alias: local }
|
- { name: Install to existing Ubuntu 18.04 server (Advanced), alias: local }
|
||||||
vars_files:
|
vars_files:
|
||||||
- config.cfg
|
- config.cfg
|
||||||
|
|
|
@ -1,58 +1,66 @@
|
||||||
---
|
---
|
||||||
- block:
|
- block:
|
||||||
- name: Build python virtual environment
|
- name: Build python virtual environment
|
||||||
import_tasks: venv.yml
|
import_tasks: venv.yml
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Security group created
|
- name: Include prompts
|
||||||
cs_securitygroup:
|
import_tasks: prompts.yml
|
||||||
name: "{{ algo_server_name }}-security_group"
|
|
||||||
description: AlgoVPN security group
|
- name: Security group created
|
||||||
register: cs_security_group
|
local_action:
|
||||||
|
module: cs_securitygroup
|
||||||
|
name: "{{ algo_server_name }}-security_group"
|
||||||
|
description: AlgoVPN security group
|
||||||
|
register: cs_security_group
|
||||||
|
|
||||||
- name: Security rules created
|
- name: Security rules created
|
||||||
cs_security_group_rule:
|
local_action:
|
||||||
security_group: "{{ cs_security_group.name }}"
|
module: cs_security_group_rule
|
||||||
protocol: "{{ item.proto }}"
|
security_group: "{{ cs_security_group.name }}"
|
||||||
start_port: "{{ item.port_min }}"
|
protocol: "{{ item.proto }}"
|
||||||
end_port: "{{ item.port_max }}"
|
start_port: "{{ item.port_min }}"
|
||||||
cidr: "{{ item.range }}"
|
end_port: "{{ item.port_max }}"
|
||||||
with_items:
|
cidr: "{{ item.range }}"
|
||||||
- { proto: tcp, start_port: 22, end_port: 22, range: 0.0.0.0/0 }
|
with_items:
|
||||||
- { proto: udp, start_port: 4500, end_port: 4500, range: 0.0.0.0/0 }
|
- { proto: tcp, start_port: 22, end_port: 22, range: 0.0.0.0/0 }
|
||||||
- { proto: udp, start_port: 500, end_port: 500, range: 0.0.0.0/0 }
|
- { proto: udp, start_port: 4500, end_port: 4500, range: 0.0.0.0/0 }
|
||||||
- { proto: udp, start_port: "{{ wireguard_port }}", end_port: "{{ wireguard_port }}", range: 0.0.0.0/0 }
|
- { proto: udp, start_port: 500, end_port: 500, range: 0.0.0.0/0 }
|
||||||
|
- { proto: udp, start_port: "{{ wireguard_port }}", end_port: "{{ wireguard_port }}", range: 0.0.0.0/0 }
|
||||||
|
|
||||||
- name: Keypair created
|
- name: Keypair created
|
||||||
cs_sshkeypair:
|
local_action:
|
||||||
name: "{{ SSH_keys.comment|regex_replace('@', '_') }}"
|
module: cs_sshkeypair
|
||||||
public_key: "{{ SSH_keys.public }}"
|
name: "{{ SSH_keys.comment|regex_replace('@', '_') }}"
|
||||||
register: cs_keypair
|
public_key: "{{ SSH_keys.public }}"
|
||||||
|
register: cs_keypair
|
||||||
|
|
||||||
- name: Set facts
|
- name: Set facts
|
||||||
set_fact:
|
set_fact:
|
||||||
image_id: "{{ cloud_providers.cloudstack.image }}"
|
image_id: "{{ cloud_providers.cloudstack.image }}"
|
||||||
size: "{{ cloud_providers.cloudstack.size }}"
|
size: "{{ cloud_providers.cloudstack.size }}"
|
||||||
disk: "{{ cloud_providers.cloudstack.disk }}"
|
disk: "{{ cloud_providers.cloudstack.disk }}"
|
||||||
keypair_name: "{{ cs_keypair.name }}"
|
keypair_name: "{{ cs_keypair.name }}"
|
||||||
|
|
||||||
- name: Server created
|
- name: Server created
|
||||||
cs_instance:
|
local_action:
|
||||||
name: "{{ algo_server_name }}"
|
module: cs_instance
|
||||||
root_disk_size: "{{ disk }}"
|
name: "{{ algo_server_name }}"
|
||||||
image: "{{ image_id }}"
|
root_disk_size: "{{ disk }}"
|
||||||
ssh_key: "{{ keypair_name }}"
|
image: "{{ image_id }}"
|
||||||
security_groups: "{{ cs_security_group.name }}"
|
ssh_key: "{{ keypair_name }}"
|
||||||
register: cs_server
|
security_groups: "{{ cs_security_group.name }}"
|
||||||
|
zone: "{{ _algo_region }}"
|
||||||
|
register: cs_server
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
cloud_instance_ip: "{{ cs_server.default_ip }}"
|
cloud_instance_ip: "{{ cs_server.default_ip }}"
|
||||||
ansible_ssh_user: ubuntu
|
ansible_ssh_user: ubuntu
|
||||||
environment:
|
environment:
|
||||||
PYTHONPATH: "{{ cloudstack_venv }}/lib/python2.7/site-packages/"
|
PYTHONPATH: "{{ cloudstack_venv }}/lib/python2.7/site-packages/"
|
||||||
|
|
||||||
rescue:
|
rescue:
|
||||||
- debug: var=fail_hint
|
- debug: var=fail_hint
|
||||||
tags: always
|
tags: always
|
||||||
- fail:
|
- fail:
|
||||||
tags: always
|
tags: always
|
||||||
|
|
7
roles/cloud-cloudstack/tasks/prompts.yml
Normal file
7
roles/cloud-cloudstack/tasks/prompts.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
- block:
|
||||||
|
- pause:
|
||||||
|
prompt: |
|
||||||
|
What region should the server be located in?
|
||||||
|
register: _algo_region
|
||||||
|
when: region is undefined
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
- name: Install requirements
|
- name: Install requirements
|
||||||
pip:
|
pip:
|
||||||
name: sc
|
name: cs
|
||||||
version: 2.5.8
|
version: 2.5.8
|
||||||
virtualenv: "{{ cloudstack_venv }}"
|
virtualenv: "{{ cloudstack_venv }}"
|
||||||
virtualenv_python: python2.7
|
virtualenv_python: python2.7
|
||||||
|
|
Loading…
Add table
Reference in a new issue