Skip to content

Commit

Permalink
Merge pull request #971 from ansible/devel
Browse files Browse the repository at this point in the history
Sep 14, 2020 Release PR
  • Loading branch information
IPvSean authored Sep 15, 2020
2 parents 2eb2007 + 86a2307 commit 73a0cba
Show file tree
Hide file tree
Showing 20 changed files with 239 additions and 32 deletions.
2 changes: 2 additions & 0 deletions provisioner/provision_lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@
- Instructor inventory is located at {{playbook_dir}}/{{ec2_name_prefix}}/instructor_inventory.txt
- Private key is located at {{playbook_dir}}/{{ec2_name_prefix}}/{{ec2_name_prefix}}-private.pem
- {{website_information}}
{% if attendance %}
- {{hostvars['attendance-host'].login_website_information | default("attendance feature is off") }}
{% endif %}
FAILURES
*******************
Expand Down
24 changes: 23 additions & 1 deletion provisioner/roles/code_server/tasks/codeserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
dnf:
name: /tmp/code-server.rpm
state: present
disable_gpg_check: true

- name: Apply our systemd service file (instead of RPM file)
template:
Expand All @@ -50,7 +51,28 @@
dest: /etc/nginx/nginx.conf
insertafter: "http {"

# source: https://vscode.readthedocs.io/en/latest/getstarted/settings/
# Make sure we can re-run the Tower installer during a lab without killing code-server access
- name: update Ansible installer nginx configuration template to support code server
blockinfile:
block: "{{ lookup('template', 'nginx.conf') }}"
dest: /tmp/tower_install/roles/nginx/templates/nginx.conf
insertafter: "http {"

# Make the block inserted above conditional to only apply to ansible-1
- name: Add jinja conditional start
lineinfile:
path: /tmp/tower_install/roles/nginx/templates/nginx.conf
insertafter: "http {"
line: '{% raw %} {% if ansible_hostname == "ansible-1" %} {% endraw %}'

# Make the block inserted above conditional to only apply to ansible-1
- name: Add jinja conditional end
lineinfile:
path: /tmp/tower_install/roles/nginx/templates/nginx.conf
insertbefore: "include(.*)/etc/nginx/mime.types;"
line: '{% raw %} {% endif %} {% endraw %}'

# source: https://vscode.readthedocs.io/en/latest/getstarted/settings/
- name: ensure custom facts directory exists
file:
path: "/home/{{username}}/.local/share/code-server/User/"
Expand Down
5 changes: 5 additions & 0 deletions provisioner/roles/community_grid/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
- name: initiation boinc-client installation and registration
block:
- name: Install required RPM GPG keys
rpm_key:
state: present
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8

- name: Install EPEL
dnf:
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion provisioner/roles/control_node/tasks/tower.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Download Ansible Tower
get_url:
url: '{{ tower_installer_url | default("https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-3.7.1-1.tar.gz") }}'
url: '{{ tower_installer_url | default("https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-3.7.2-1.tar.gz") }}'
dest: /tmp/tower.tar.gz

- name: Create directory for Ansible Tower
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,13 @@ ansible_ssh_private_key_file=/home/ec2-user/.ssh/aws-private.pem
ansible_become=yes
ansible_ssh_common_args='-o StrictHostKeyChecking=no'



pg_host='ansible-4'
pg_port='5432'

pg_database='awx'
pg_username='awx'
pg_password='{{admin_password}}'

rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password='{{admin_password}}'
rabbitmq_cookie=cookiemonster

# Needs to be true for fqdns and ip addresses
rabbitmq_use_long_name=false
pg_sslmode='prefer' # set to 'verify-full' for client-side enforced SSL

gpgcheck='{{ gpgcheck | default(1)}}'
aw_repo_url='{{ aw_repo_url | default("https://releases.ansible.com/ansible-tower/") }}'
10 changes: 1 addition & 9 deletions provisioner/roles/control_node/templates/tower_install.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ pg_port=''
pg_database='awx'
pg_username='awx'
pg_password='{{admin_password}}'

rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password='{{admin_password}}'
rabbitmq_cookie=cookiemonster

# Needs to be true for fqdns and ip addresses
rabbitmq_use_long_name=false
pg_sslmode='prefer' # set to 'verify-full' for client-side enforced SSL

gpgcheck='{{ gpgcheck | default(1)}}'
aw_repo_url='{{ aw_repo_url | default("https://releases.ansible.com/ansible-tower/") }}'
6 changes: 6 additions & 0 deletions provisioner/roles/gitlab-server/tasks/certbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
- name: GitLab post | stop gitlab
command: gitlab-ctl stop

- name: Install required RPM GPG keys
rpm_key:
state: present
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
become: true

- name: GitLab post | Install EPEL
dnf:
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
Workshop_node1: "{{ ec2_name_prefix }}-node1"
Workshop_type: "{{ workshop_type }}"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Linklight: "This was provisioned through the linklight provisioner"
Expand Down Expand Up @@ -59,6 +61,8 @@
Workshop_node2: "{{ ec2_name_prefix }}-node2"
Workshop_type: "{{ workshop_type }}"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Linklight: "This was provisioned through the linklight provisioner"
Expand Down Expand Up @@ -104,6 +108,8 @@
Workshop_node3: "{{ ec2_name_prefix }}-node3"
Workshop_type: "{{ workshop_type }}"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Linklight: "This was provisioned through the linklight provisioner"
Expand Down Expand Up @@ -149,6 +155,8 @@
Workshop_node4: "{{ ec2_name_prefix }}-node4"
Workshop_type: "{{ workshop_type }}"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Linklight: "This was provisioned through the linklight provisioner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
instance_tags:
Workshop_f5: "{{ ec2_name_prefix }}-f5"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -53,6 +55,8 @@
instance_tags:
Workshop_node1: "{{ ec2_name_prefix }}-node1"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -92,6 +96,8 @@
instance_tags:
Workshop_node2: "{{ ec2_name_prefix }}-node2"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
instance_tags:
Workshop_rtr1: "{{ ec2_name_prefix }}-rtr1"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -67,6 +69,8 @@
instance_tags:
Workshop_rtr2: "{{ ec2_name_prefix }}-rtr2"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -111,6 +115,8 @@
instance_tags:
Workshop_rtr3: "{{ ec2_name_prefix }}-rtr3"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -155,6 +161,8 @@
instance_tags:
Workshop_rtr4: "{{ ec2_name_prefix }}-rtr4"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
instance_tags:
Workshop_node1: "{{ ec2_name_prefix }}-node1"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -57,6 +59,8 @@
instance_tags:
Workshop_node2: "{{ ec2_name_prefix }}-node2"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -101,6 +105,8 @@
instance_tags:
Workshop_node3: "{{ ec2_name_prefix }}-node3"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -130,3 +136,95 @@
with_indexed_items:
- "{{ node3_output.instances }}"
when: node3_output.instance_ids is not none

# Create isolated/remote node for Adv Tower lab when cluster install

- name: Create EC2 instances for isonode
ec2:
assign_public_ip: true
key_name: "{{ ec2_name_prefix }}-key"
group: "{{ ec2_security_group }}"
instance_type: "{{ ec2_info[rhel].size }}"
image: "{{ node_ami.image_id }}"
region: "{{ ec2_region }}"
exact_count: "{{ student_total }}"
count_tag:
Workshop_isonode: "{{ ec2_name_prefix }}-isonode"
instance_tags:
Workshop_isonode: "{{ ec2_name_prefix }}-isonode"
Workshop: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Linklight: "This was provisioned through the linklight provisioner"
Students: "{{ student_total }}"
short_name: "isonode"
username: "{{ ec2_info[rhel].username }}"
wait: "{{ ec2_wait }}"
vpc_subnet_id: "{{ ec2_vpc_subnet_id }}"
volumes:
- device_name: /dev/sda1
volume_type: gp2
volume_size: "{{ ec2_info[rhel].disk_space }}"
delete_on_termination: true
register: isonode_output
when: create_cluster|bool

- name: Ensure tags are present for isonode
ec2_tag:
region: "{{ ec2_region }}"
resource: "{{ item.1.id }}"
state: present
tags:
Name: "{{ ec2_name_prefix }}-student{{ item.0 + 1 }}-isonode"
Index: "{{ item[0] }}"
Student: "student{{ item.0 + 1 }}"
launch_time: "{{ item.1.launch_time }}"
with_indexed_items:
- "{{ isonode_output.instances }}"
when: isonode_output.instance_ids is not none and create_cluster|bool

- name: Create EC2 instances for remotenode
ec2:
assign_public_ip: true
key_name: "{{ ec2_name_prefix }}-key"
group: "{{ ec2_security_group }}"
instance_type: "{{ ec2_info[rhel].size }}"
image: "{{ node_ami.image_id }}"
region: "{{ ec2_region }}"
exact_count: "{{ student_total }}"
count_tag:
Workshop_remotenode: "{{ ec2_name_prefix }}-remotenode"
instance_tags:
Workshop_remotenode: "{{ ec2_name_prefix }}-remotenode"
Workshop: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Linklight: "This was provisioned through the linklight provisioner"
Students: "{{ student_total }}"
short_name: "remotenode"
username: "{{ ec2_info[rhel].username }}"
wait: "{{ ec2_wait }}"
vpc_subnet_id: "{{ ec2_vpc_subnet_id }}"
volumes:
- device_name: /dev/sda1
volume_type: gp2
volume_size: "{{ ec2_info[rhel].disk_space }}"
delete_on_termination: true
register: remotenode_output
when: create_cluster|bool

- name: Ensure tags are present for remotenode
ec2_tag:
region: "{{ ec2_region }}"
resource: "{{ item.1.id }}"
state: present
tags:
Name: "{{ ec2_name_prefix }}-student{{ item.0 + 1 }}-remotenode"
Index: "{{ item[0] }}"
Student: "student{{ item.0 + 1 }}"
launch_time: "{{ item.1.launch_time }}"
with_indexed_items:
- "{{ remotenode_output.instances }}"
when: remotenode_output.instance_ids is not none and create_cluster|bool
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
instance_tags:
Workshop_netapp: "{{ ec2_name_prefix }}-netapp"
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Linklight: "This was provisioned through the linklight provisioner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
Name: "{{ ec2_name_prefix }}-gitlab"
App: AnsibleWorkshop
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "Username that provisioned this-> {{ aws_user }}"
Expand Down Expand Up @@ -43,6 +45,8 @@
Workshop_instance1: "{{ ec2_name_prefix }}-instance1"
App: AnsibleWorkshop
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand All @@ -69,6 +73,8 @@
Workshop_instance2: "{{ ec2_name_prefix }}-instance2"
App: AnsibleWorkshop
Workshop: "{{ ec2_name_prefix }}"
uuid: "{{ ec2_name_prefix }}"
guid: "{{ ec2_name_prefix }}"
Workshop_type: "{{ workshop_type }}"
AWS_USERNAME: "{{ aws_user }}"
Info: "AWS_USERNAME that provisioned this-> {{ aws_user }}"
Expand Down
Loading

0 comments on commit 73a0cba

Please sign in to comment.