Skip to content

Commit

Permalink
configascode seems fine now
Browse files Browse the repository at this point in the history
  • Loading branch information
IPvSean committed Oct 23, 2023
1 parent 5e27300 commit c5ba002
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
16 changes: 8 additions & 8 deletions provisioner/provision_lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@
ansible.builtin.include_role:
name: ../roles/control_node_always

- name: Install and configure code server using code_server role
- name: Add dns entries for all student control nodes using aws_dns role
ansible.builtin.include_role:
name: ../roles/code_server_native
name: ../roles/aws_dns
when:
- code_server is defined
- code_server
- dns_type is defined
- dns_type == "aws"
- controllerinstall is defined
- controllerinstall

- name: Add dns entries for all student control nodes using aws_dns role
- name: Install and configure code server using code_server role
ansible.builtin.include_role:
name: ../roles/aws_dns
name: ../roles/code_server_native
when:
- dns_type is defined
- dns_type == "aws"
- code_server is defined
- code_server
- controllerinstall is defined
- controllerinstall

Expand Down
19 changes: 13 additions & 6 deletions roles/code_server_native/tasks/dns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@
group: "{{ username }}"
mode: '0755'

- name: Copy all certs to user directory directory so the code-server container can use it
- name: Copy cert.pem to student
become: true
become_user: root
ansible.builtin.copy:
src: "/etc/letsencrypt/live/{{ student }}.{{ ec2_name_prefix|lower }}.{{ workshop_dns_zone }}/"
dest: "/home/{{ username }}/{{ student }}.{{ ec2_name_prefix|lower }}.{{ workshop_dns_zone }}/"
src: "/etc/letsencrypt/live/{{ student }}.{{ ec2_name_prefix|lower }}.{{ workshop_dns_zone }}/cert.pem"
dest: "/home/{{ username }}/{{ student }}.{{ ec2_name_prefix|lower }}.{{ workshop_dns_zone }}/cert.pem"
owner: "{{ username }}"
group: "{{ username }}"
remote_src: true

- name: Copy privkey.pem to student
become: true
become_user: root
ansible.builtin.copy:
src: "/etc/letsencrypt/live/{{ student }}.{{ ec2_name_prefix|lower }}.{{ workshop_dns_zone }}/privkey.pem"
dest: "/home/{{ username }}/{{ student }}.{{ ec2_name_prefix|lower }}.{{ workshop_dns_zone }}/privkey.pem"
owner: "{{ username }}"
group: "{{ username }}"
mode: preserve
follow: yes
remote_src: true
directory_mode: '0755'
5 changes: 5 additions & 0 deletions roles/workshop_check_setup/tasks/configascode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Check workshop_type and automation_hub values
fail:
msg: "When workshop_type is 'configascode', automation_hub must be set to true"
when: workshop_type == 'configascode' and (automation_hub is not defined or not automation_hub)

0 comments on commit c5ba002

Please sign in to comment.