mirror of
https://github.com/trailofbits/algo.git
synced 2025-04-11 11:47:08 +02:00
* bump ansible to 2.8.3 * DigitalOcean: move to the latest modules * Add Hetzner Cloud * Scaleway and Lightsail fixes * lint missing roles * Update roles/cloud-hetzner/tasks/main.yml Add api_token Co-Authored-By: phaer <phaer@phaer.org> * Update roles/cloud-hetzner/tasks/main.yml Add api_token Co-Authored-By: phaer <phaer@phaer.org> * Try to run apt until succeeded * Scaleway modules upgrade * GCP: Refactoring, remove deprecated modules * Doc updates (#1552) * Update README.md Adding links and mentions of Exoscale aka CloudStack and Hetzner Cloud. * Update index.md Add the Hetzner Cloud to the docs index * Remove link to Win 10 IPsec instructions * Delete client-windows.md Unnecessary since the deprecation of IPsec for Win10. * Update deploy-from-ansible.md Added sections and required variables for CloudStack and Hetzner Cloud. * Update deploy-from-ansible.md Added sections for CloudStack and Hetzner, added req variables and examples, mentioned environment variables, and added links to the provider role section. * Update deploy-from-ansible.md Cosmetic changes to links, fix typo. * Update GCE variables * Update deploy-from-script-or-cloud-init-to-localhost.md Fix a finer point, and make variables list more readable. * update azure requirements * Python3 draft * set LANG=c to the p12 password generation task * Update README * Install cloud requirements to the existing venv * FreeBSD fix * env->.env fixes * lightsail_region_facts fix * yaml syntax fix * Update README for Python 3 (#1564) * Update README for Python 3 * Remove tabs and tweak instructions * Remove cosmetic command indentation * Update README.md * Update README for Python 3 (#1565) * DO fix for "found unpermitted parameters: id" * Verify Python version * Remove ubuntu 16.04 from readme * Revert back DigitalOcean module * Update deploy-from-script-or-cloud-init-to-localhost.md * env to .env
79 lines
2.6 KiB
YAML
79 lines
2.6 KiB
YAML
---
|
|
- fail:
|
|
msg: "OpenStack credentials are not set. Download it from the OpenStack dashboard->Compute->API Access and source it in the shell (eg: source /tmp/dhc-openrc.sh)"
|
|
when: lookup('env', 'OS_AUTH_URL')|length <= 0
|
|
|
|
- name: Build python virtual environment
|
|
import_tasks: venv.yml
|
|
|
|
- name: Security group created
|
|
os_security_group:
|
|
state: "{{ state|default('present') }}"
|
|
name: "{{ algo_server_name }}-security_group"
|
|
description: AlgoVPN security group
|
|
register: os_security_group
|
|
|
|
- name: Security rules created
|
|
os_security_group_rule:
|
|
state: "{{ state|default('present') }}"
|
|
security_group: "{{ os_security_group.id }}"
|
|
protocol: "{{ item.proto }}"
|
|
port_range_min: "{{ item.port_min }}"
|
|
port_range_max: "{{ item.port_max }}"
|
|
remote_ip_prefix: "{{ item.range }}"
|
|
with_items:
|
|
- { proto: tcp, port_min: 22, port_max: 22, range: 0.0.0.0/0 }
|
|
- { proto: icmp, port_min: -1, port_max: -1, range: 0.0.0.0/0 }
|
|
- { proto: udp, port_min: 4500, port_max: 4500, range: 0.0.0.0/0 }
|
|
- { proto: udp, port_min: 500, port_max: 500, range: 0.0.0.0/0 }
|
|
- { proto: udp, port_min: "{{ wireguard_port }}", port_max: "{{ wireguard_port }}", range: 0.0.0.0/0 }
|
|
|
|
- name: Keypair created
|
|
os_keypair:
|
|
state: "{{ state|default('present') }}"
|
|
name: "{{ SSH_keys.comment|regex_replace('@', '_') }}"
|
|
public_key_file: "{{ SSH_keys.public }}"
|
|
register: os_keypair
|
|
|
|
- name: Gather facts about flavors
|
|
os_flavor_facts:
|
|
ram: "{{ cloud_providers.openstack.flavor_ram }}"
|
|
|
|
- name: Gather facts about images
|
|
os_image_facts:
|
|
image: "{{ cloud_providers.openstack.image }}"
|
|
|
|
- name: Gather facts about public networks
|
|
os_networks_facts:
|
|
|
|
- name: Set the network as a fact
|
|
set_fact:
|
|
public_network_id: "{{ item.id }}"
|
|
when:
|
|
- item['router:external']|default(omit)
|
|
- item['admin_state_up']|default(omit)
|
|
- item['status'] == 'ACTIVE'
|
|
with_items: "{{ openstack_networks }}"
|
|
|
|
- name: Set facts
|
|
set_fact:
|
|
flavor_id: "{{ (openstack_flavors | sort(attribute='ram'))[0]['id'] }}"
|
|
image_id: "{{ openstack_image['id'] }}"
|
|
keypair_name: "{{ os_keypair.key.name }}"
|
|
security_group_name: "{{ os_security_group['secgroup']['name'] }}"
|
|
|
|
- name: Server created
|
|
os_server:
|
|
state: "{{ state|default('present') }}"
|
|
name: "{{ algo_server_name }}"
|
|
image: "{{ image_id }}"
|
|
flavor: "{{ flavor_id }}"
|
|
key_name: "{{ keypair_name }}"
|
|
security_groups: "{{ security_group_name }}"
|
|
nics:
|
|
- net-id: "{{ public_network_id }}"
|
|
register: os_server
|
|
|
|
- set_fact:
|
|
cloud_instance_ip: "{{ os_server['openstack']['public_v4'] }}"
|
|
ansible_ssh_user: ubuntu
|