2020-12-02 16:04:55 +01:00
|
|
|
---
|
|
|
|
# Provisioning of a graviton server using aws spot instance
|
2020-12-02 18:11:18 +01:00
|
|
|
- name: provisions a graviton server as aws spot instance
|
|
|
|
hosts: localhost
|
|
|
|
connection: local
|
2020-12-02 16:04:55 +01:00
|
|
|
vars_prompt:
|
|
|
|
- name: ssh_pub_key_file
|
|
|
|
prompt: Location of your public ssh key
|
|
|
|
default: "~/.ssh/id_rsa.pub"
|
2020-12-03 00:09:24 +01:00
|
|
|
private: no
|
2020-12-02 16:04:55 +01:00
|
|
|
- name: aws_region
|
|
|
|
prompt: AWS Region to use for instaance
|
|
|
|
default: "us-east-1"
|
2020-12-03 00:09:24 +01:00
|
|
|
private: no
|
2020-12-02 16:04:55 +01:00
|
|
|
- name: aws_ami
|
2020-12-02 18:11:18 +01:00
|
|
|
prompt: Disk image to use for instance (default is debian buster arm64)
|
|
|
|
default: "ami-057796a93302d0b14"
|
2020-12-03 00:09:24 +01:00
|
|
|
private: no
|
2020-12-02 16:04:55 +01:00
|
|
|
- name: aws_type
|
|
|
|
prompt: Instance type to request
|
|
|
|
default: "t4g.nano"
|
2020-12-03 00:09:24 +01:00
|
|
|
private: no
|
2020-12-16 11:42:13 +01:00
|
|
|
- name: dns_name
|
|
|
|
prompt: Which hostname shall be registered for the host (Empty = no dns, Zone needs to be route53 managed)?
|
|
|
|
default: ""
|
|
|
|
private: no
|
|
|
|
vars:
|
|
|
|
- dns_zone_name: "{{ dns_name | regex_replace('^[\\w-]+\\.', '') }}"
|
2020-12-02 16:04:55 +01:00
|
|
|
roles:
|
|
|
|
- aws_graviton_nano_spot
|
2020-12-02 18:11:18 +01:00
|
|
|
|
|
|
|
- name: Install wireguard server on launched hosts
|
|
|
|
hosts: launched
|
|
|
|
remote_user: admin
|
2020-12-02 22:16:25 +01:00
|
|
|
become: true
|
2020-12-02 22:31:28 +01:00
|
|
|
vars_prompt:
|
|
|
|
- name: vpn_clients
|
|
|
|
prompt: Number of vpn clients to be generated
|
2020-12-03 00:09:24 +01:00
|
|
|
default: 1
|
|
|
|
private: no
|
2020-12-02 22:16:25 +01:00
|
|
|
vars:
|
|
|
|
vpn_network: '10.100.100'
|
|
|
|
vpn_port: '58172'
|
2020-12-02 18:11:18 +01:00
|
|
|
roles:
|
2020-12-02 16:04:55 +01:00
|
|
|
- wireguard_server
|