-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathletsencrypt.yml
31 lines (30 loc) · 995 Bytes
/
letsencrypt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
- hosts: localhost
gather_facts: no
vars_files:
- aws_vars.yml
vars:
route53_placeholder_ip: "104.67.28.83"
tasks:
- name: Create Hostnames
set_fact:
domains: "{{ domains | default('') | list }} + ['tower-{{ lab_user }}-{{ item }}.{{ domain_name }}', 'master-{{ lab_user }}-{{ item }}.{{ domain_name }}', '*.apps-{{ lab_user }}-{{ item }}.{{ domain_name }}']"
with_sequence: start="{{ student_count_start }}" end="{{ student_count_end }}"
- name: Register route53 entries
route53:
command: create
aws_access_key: "{{ec2_access_key}}"
aws_secret_key: "{{ec2_secret_key}}"
zone: "{{ domain_name }}"
type: A
overwrite: True
ttl: 60
record: "{{ item }}"
value: "{{ route53_placeholder_ip }}"
wait: yes
with_items: "{{ domains }}"
- name: Letsencrypt
include_role:
name: letsencrypt
vars:
letsencrypt_domains: "{{ domains }}"