Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
IPvSean committed Oct 31, 2024
1 parent 78821e7 commit 4184cf9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
4 changes: 2 additions & 2 deletions roles/manage_ec2_instances/tasks/resources/resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
register: create_key

- name: save private key
copy:
ansible.builtin.copy:
content: "{{ create_key.key.private_key }}"
dest: "{{ playbook_dir }}/{{ ec2_name_prefix }}/{{ ec2_name_prefix }}-private.pem"
mode: '0400'
Expand All @@ -153,7 +153,7 @@
include_tasks: "{{ dns_type }}.yml"

- name: Ensure key file has proper permissions
file:
ansible.builtin.file:
dest: "{{ playbook_dir }}/{{ ec2_name_prefix }}/{{ ec2_name_prefix }}-private.pem"
mode: 0600

Expand Down
7 changes: 5 additions & 2 deletions roles/workshop_attendance/tasks/aws.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: workshop_attendance | Create DNS record
become: false
community.aws.route53:
amazon.aws.route53:
state: "{{ s3_state }}"
zone: "{{ workshop_dns_zone }}"
record: "{{ec2_name_prefix|lower}}.{{workshop_dns_zone}}"
Expand All @@ -10,13 +10,16 @@
value: "{{ ansible_host }}"
wait: true
delegate_to: localhost
connection: local
register: route53_status
run_once: true
when:
- dns_type is defined
- dns_type == "aws"

- name: set information for instructor
set_fact:
ansible.builtin.set_fact:
login_website_information: "Auto-Assignment website located at http://{{ ec2_name_prefix|lower }}.{{ workshop_dns_zone|lower }}, instructor can see workbench assignments at http://{{ ec2_name_prefix|lower }}.{{ workshop_dns_zone|lower }}/list.php"
delegate_to: localhost
connection: local
run_once: true
34 changes: 17 additions & 17 deletions roles/workshop_attendance/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
---
- name: Teardown attendance
include_tasks: teardown.yml
ansible.builtin.include_tasks: teardown.yml
when: teardown|bool

- name: setup attendance instance
when: not teardown
block:
- name: setup DNS specific information
include_tasks: "{{ item }}"
- name: Setup DNS specific information
ansible.builtin.include_tasks: "{{ item }}"
with_first_found:
- "{{role_path}}/tasks/{{ dns_type }}.yml"
- "{{role_path}}/tasks/none.yml"

- name: install package dependencies for attendance instance
include_tasks: 10_package_dependencies.yml
- name: Install package dependencies for attendance instance
ansible.builtin.include_tasks: 10_package_dependencies.yml

- name: attempt to get SSL certificates
- name: Attempt to get SSL certificates
block:
- name: retrieve SSL cert with certbot
include_tasks: 20_certbot.yml
- name: Retrieve SSL cert with certbot
ansible.builtin.include_tasks: 20_certbot.yml
rescue:
- name: append dns_information failure
set_fact:
- name: Append dns_information failure
ansible.builtin.set_fact:
dns_information:
- "{{ dns_information }}"
- "The Lets Encrypt certbot failed for the attendance node, please check https://letsencrypt.status.io/ to make sure the service is running"

- name: error with SSL cert
debug:
- name: Error with SSL cert
ansible.builtin.debug:
msg: "Unable to retrieve SSL cert, ERROR, continuing on without cert..."


- name: install and configure nginx on attendance node
include_tasks: 30_nginx.yml
- name: Install and configure nginx on attendance node
ansible.builtin.include_tasks: 30_nginx.yml

- name: Configure attendance host
import_tasks: 40_attendance.yml
when: not teardown
ansible.builtin.import_tasks: 40_attendance.yml

- name: Configure attendance host
import_tasks: 40_attendance.yml
ansible.builtin.import_tasks: 40_attendance.yml
when: not teardown|bool
14 changes: 14 additions & 0 deletions version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Ensure boto3 version is >= 1.28.0
hosts: localhost
connection: local
gather_facts: no
tasks:

- name: do facts
ansible.builtin.setup:
register: my_facts

- debug:
var: my_facts

0 comments on commit 4184cf9

Please sign in to comment.