Neu mit optionalem route53 nameservereintrag
This commit is contained in:
parent
b44f265407
commit
10fd7b45c8
@ -20,6 +20,12 @@
|
|||||||
prompt: Instance type to request
|
prompt: Instance type to request
|
||||||
default: "t4g.nano"
|
default: "t4g.nano"
|
||||||
private: no
|
private: no
|
||||||
|
- 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-]+\\.', '') }}"
|
||||||
roles:
|
roles:
|
||||||
- aws_graviton_nano_spot
|
- aws_graviton_nano_spot
|
||||||
|
|
||||||
|
@ -29,8 +29,22 @@
|
|||||||
image: "{{ aws_ami }}"
|
image: "{{ aws_ami }}"
|
||||||
wait: yes
|
wait: yes
|
||||||
instance_initiated_shutdown_behavior: terminate
|
instance_initiated_shutdown_behavior: terminate
|
||||||
|
vpc_subnet_id: "subnet-3df70f5a"
|
||||||
|
assign_public_ip: yes
|
||||||
register: graviton
|
register: graviton
|
||||||
|
|
||||||
|
- name: generate route53 dns entry for the instance
|
||||||
|
route53:
|
||||||
|
command: create
|
||||||
|
overwrite: yes
|
||||||
|
zone: "{{ dns_zone_name }}"
|
||||||
|
record: "{{ dns_name }}"
|
||||||
|
type: CNAME
|
||||||
|
ttl: 60
|
||||||
|
value: "{{ item.public_dns_name }}"
|
||||||
|
loop: "{{ graviton.instances }}"
|
||||||
|
when: dns_name != ""
|
||||||
|
|
||||||
- name: Wait for SSH to come up
|
- name: Wait for SSH to come up
|
||||||
delegate_to: "{{ item.public_dns_name }}"
|
delegate_to: "{{ item.public_dns_name }}"
|
||||||
wait_for_connection:
|
wait_for_connection:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user