diff --git a/README.md b/README.md index 4fd389699..b2f3eebc8 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ The Red Hat Ansible Automation Workshops project is intended for effectively dem - [How to contribute](docs/contribute.md) - [How to use the AWS Lab Provisioner](provisioner/README.md) - [FAQ](docs/faq.md) + - [Release Process](docs/release.md) --- ![Red Hat Ansible Automation](images/rh-ansible-automation-platform.png) diff --git a/docs/faq.md b/docs/faq.md index e3d5135ec..6079ff1a6 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,6 +1,10 @@ # FAQ for the Provisioner Frequently Asked Questions... or rather common problems that people have hit. +## How do I do a release PR? + +Read this [guide](release.md) + ## Problem: boto3 missing ``` diff --git a/docs/release.md b/docs/release.md new file mode 100644 index 000000000..fd877a467 --- /dev/null +++ b/docs/release.md @@ -0,0 +1,53 @@ +# Release PR + +The Ansible Automation Workshops have two main branches + +- `master` - this is the stable supported branch. This is what RHPDS (Red Hat Product Demo System) points to +- `devel` - this is the development branch. This is where PRs (Pull Requests) go into, and get tested. + +A **release** is when we move `devel` into `master`. This means the stable `master` branch will pickup all new features, bug fixes and changes that `devel` branch has been testing. + +# How to push a release + +1. An administrator has to create a PR (pull request) from `devel` into `master` from `https://github.com/ansible/workshops` + + ![release pr](../images/release_pr.png) + +2. Title the PR with `Date Release PR` + + For example: + `April 16th, 2020 Release PR` + +3. Copy the last PR's contents into your new PR contents, here is an example: [https://github.com/ansible/workshops/pull/800](https://github.com/ansible/workshops/pull/800) + +e.g. here is a template you can use + +``` +# SUMMARY +this is a release PR, a release PR merges the devel branch to the master branch taking in multiple PRs over the last period of time. The last release was on April 16th, 2020 https://github.com/ansible/workshops/pull/784 +this merges PRs for the following since the last review: +- https://github.com/ansible/workshops/pull/785 - cleaning up tower exercises +- https://github.com/ansible/workshops/pull/786 - Fix start of YAML marker +- https://github.com/ansible/workshops/pull/790 - add synchronization with ansible/product-demos +- https://github.com/ansible/workshops/pull/795 - new exercise for rhel lab with system roles +- https://github.com/ansible/workshops/pull/799 - fixing RHEL workshop exercises +# ISSUE TYPE +Release PR +cc @cloin @liquidat @goetzrieger @Spredzy +``` + +4. The goal of the PR summary is to: + + - indicate this is a release PR + - link to the last release PR + - summarize all PRs into `devel` since the last time there was a release (this means only purple merged PRs, not closed PRs, or PRs still not merged yet) + +5. wait for CI testing to complete + + ![ci testing](../images/ci.png) + +6. merge when you get passing CI + + ![passed ci](../images/passed.png) + +7. If there are major changes, announce these to Roland to make sure they reach his newsletter :) diff --git a/images/ci.png b/images/ci.png new file mode 100644 index 000000000..a48a7f4d0 Binary files /dev/null and b/images/ci.png differ diff --git a/images/passed.png b/images/passed.png new file mode 100644 index 000000000..02378b089 Binary files /dev/null and b/images/passed.png differ diff --git a/images/release_pr.png b/images/release_pr.png new file mode 100644 index 000000000..2556c05de Binary files /dev/null and b/images/release_pr.png differ diff --git a/provisioner/provision_lab.yml b/provisioner/provision_lab.yml index 3478618f7..2774e2dcd 100644 --- a/provisioner/provision_lab.yml +++ b/provisioner/provision_lab.yml @@ -154,6 +154,9 @@ loop: - "ansible-galaxy collection install ansible.product_demos" - "ansible-galaxy collection install awx.awx" + register: galaxy + until: galaxy is not failed + retries: 5 - name: Create lab instances in AWS hosts: localhost @@ -207,6 +210,8 @@ when: - dns_type is defined - dns_type == "aws" + - towerinstall is defined + - towerinstall tags: control_node - name: Setup Amazon S3 Website for Student Login diff --git a/provisioner/roles/aws_dns/tasks/tower.yml b/provisioner/roles/aws_dns/tasks/tower.yml index d2c1e1a69..a52a4878b 100644 --- a/provisioner/roles/aws_dns/tasks/tower.yml +++ b/provisioner/roles/aws_dns/tasks/tower.yml @@ -1,12 +1,15 @@ --- -- name: CHANGE TOWER BASE URL - tower_settings: +- name: change ansible tower base URL + awx.awx.tower_settings: name: TOWER_URL_BASE value: "https://{{username}}.{{ec2_name_prefix|lower}}.{{workshop_dns_zone}}" tower_verify_ssl: false tower_host: localhost tower_username: admin tower_password: "{{admin_password}}" + register: change_base_url + until: change_base_url is not failed + retries: 5 # directions found here https://certbot.eff.org/lets-encrypt/centosrhel8-other - name: Download and install certbot diff --git a/provisioner/roles/code_server/tasks/codeserver.yml b/provisioner/roles/code_server/tasks/codeserver.yml index 8477e1877..4f766fd8d 100644 --- a/provisioner/roles/code_server/tasks/codeserver.yml +++ b/provisioner/roles/code_server/tasks/codeserver.yml @@ -87,6 +87,9 @@ - hnw.vscode-auto-open-markdown-preview-0.0.4.vsix - vscoss.vscode-ansible-0.5.2.vsix ignore_errors: true + register: install_extension + until: install_extension is not failed + retries: 5 - name: start code-server service service: diff --git a/provisioner/roles/manage_ec2_instances/tasks/instances/instances_f5.yml b/provisioner/roles/manage_ec2_instances/tasks/instances/instances_f5.yml index 42bdc3a03..4267f01e7 100644 --- a/provisioner/roles/manage_ec2_instances/tasks/instances/instances_f5.yml +++ b/provisioner/roles/manage_ec2_instances/tasks/instances/instances_f5.yml @@ -25,6 +25,7 @@ short_name: "f5" Workshop_f5: "{{ec2_name_prefix}}-f5" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -60,6 +61,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-node1" Workshop_node1: "{{ec2_name_prefix}}-node1" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -97,6 +99,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-node2" Workshop_node2: "{{ec2_name_prefix}}-node2" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" diff --git a/provisioner/roles/manage_ec2_instances/tasks/instances/instances_networking.yml b/provisioner/roles/manage_ec2_instances/tasks/instances/instances_networking.yml index ce3bd149d..d5df7234e 100644 --- a/provisioner/roles/manage_ec2_instances/tasks/instances/instances_networking.yml +++ b/provisioner/roles/manage_ec2_instances/tasks/instances/instances_networking.yml @@ -34,6 +34,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-rtr1" Workshop_rtr1: "{{ec2_name_prefix}}-rtr1" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -44,6 +45,7 @@ ansible_network_os: "{{ec2_info[rtr1_type].os}}" username: "{{ec2_info[rtr1_type].username}}" launch_time: "{{item.1.launch_time}}" + group: core with_indexed_items: - "{{ rtr1_output.instances }}" when: rtr1_output.instance_ids is not none @@ -75,6 +77,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-rtr2" Workshop_rtr2: "{{ec2_name_prefix}}-rtr2" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -85,6 +88,7 @@ ansible_network_os: "{{ec2_info[rtr2_type].os}}" username: "{{ec2_info[rtr1_type].username}}" launch_time: "{{item.1.launch_time}}" + group: core with_indexed_items: - "{{ rtr2_output.instances }}" when: rtr2_output.instance_ids is not none @@ -116,6 +120,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-rtr3" Workshop_rtr3: "{{ec2_name_prefix}}-rtr3" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -126,6 +131,7 @@ ansible_network_os: "{{ec2_info[rtr3_type].os}}" username: "{{ec2_info[rtr1_type].username}}" launch_time: "{{item.1.launch_time}}" + group: access with_indexed_items: - "{{ rtr3_output.instances }}" when: rtr3_output.instance_ids is not none @@ -157,6 +163,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-rtr4" Workshop_rtr4: "{{ec2_name_prefix}}-rtr4" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -167,6 +174,7 @@ ansible_network_os: "{{ec2_info[rtr4_type].os}}" username: "{{ec2_info[rtr1_type].username}}" launch_time: "{{item.1.launch_time}}" + group: access with_indexed_items: - "{{ rtr4_output.instances }}" when: rtr4_output.instance_ids is not none diff --git a/provisioner/roles/manage_ec2_instances/tasks/instances/instances_rhel.yml b/provisioner/roles/manage_ec2_instances/tasks/instances/instances_rhel.yml index fa80b93a6..8f5b7b7a6 100644 --- a/provisioner/roles/manage_ec2_instances/tasks/instances/instances_rhel.yml +++ b/provisioner/roles/manage_ec2_instances/tasks/instances/instances_rhel.yml @@ -28,6 +28,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-node1" Workshop_node1: "{{ec2_name_prefix}}-node1" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -70,6 +71,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-node2" Workshop_node2: "{{ec2_name_prefix}}-node2" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -112,6 +114,7 @@ Name: "{{ ec2_name_prefix }}-student{{item.0 + 1}}-node3" Workshop_node3: "{{ec2_name_prefix}}-node3" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item.0 + 1}}" AWS_USERNAME: "{{ aws_user }}" diff --git a/provisioner/roles/manage_ec2_instances/tasks/main.yml b/provisioner/roles/manage_ec2_instances/tasks/main.yml index b062ec449..1f3e83575 100644 --- a/provisioner/roles/manage_ec2_instances/tasks/main.yml +++ b/provisioner/roles/manage_ec2_instances/tasks/main.yml @@ -2,12 +2,7 @@ - include_tasks: teardown.yml when: teardown|bool -- name: provision workshop in AWS public cloud - block: - - name: provision aws resources and instances - include_tasks: provision.yml - tags: provisioned - - - name: create instructor_inventory, and student files - include_tasks: create_inventory.yml +- name: provision aws resources and instances + include_tasks: provision.yml + tags: provisioned when: not teardown|bool diff --git a/provisioner/roles/manage_ec2_instances/tasks/provision.yml b/provisioner/roles/manage_ec2_instances/tasks/provision.yml index 04a732d07..bd0103c34 100644 --- a/provisioner/roles/manage_ec2_instances/tasks/provision.yml +++ b/provisioner/roles/manage_ec2_instances/tasks/provision.yml @@ -78,3 +78,6 @@ ## Instance creation - name: provision workshop instances include_tasks: 'instances/instances_{{workshop_type}}.yml' + +- name: create instructor_inventory, and student files + include_tasks: create_inventory.yml diff --git a/provisioner/roles/manage_ec2_instances/tasks/security_includes/security_ec2_tags.yml b/provisioner/roles/manage_ec2_instances/tasks/security_includes/security_ec2_tags.yml index 0296664f9..c2a1b0fcb 100644 --- a/provisioner/roles/manage_ec2_instances/tasks/security_includes/security_ec2_tags.yml +++ b/provisioner/roles/manage_ec2_instances/tasks/security_includes/security_ec2_tags.yml @@ -8,6 +8,7 @@ Name: "{{ ec2_name_prefix }}-student{{item[0] + 1}}-splunk" Workshop_splunk: "{{ec2_name_prefix}}-splunk" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item[0] + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -34,6 +35,7 @@ Name: "{{ ec2_name_prefix }}-student{{item[0] + 1}}-qradar" Workshop_qradar: "{{ec2_name_prefix}}-qradar" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item[0] + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -67,6 +69,7 @@ Name: "{{ ec2_name_prefix }}-student{{item[0] + 1}}-snort" Workshop_snort: "{{ec2_name_prefix}}-snort" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item[0] + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -92,6 +95,7 @@ Name: "{{ ec2_name_prefix }}-student{{item[0] + 1}}-attacker" Workshop_attacker: "{{ec2_name_prefix}}-attacker" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item[0] + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -118,6 +122,7 @@ Name: "{{ ec2_name_prefix }}-student{{item[0] + 1}}-checkpoint_mgmt" Workshop_checkpoint_mgmt: "{{ec2_name_prefix}}-checkpoint" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item[0] + 1}}" AWS_USERNAME: "{{ aws_user }}" @@ -145,6 +150,7 @@ Name: "{{ ec2_name_prefix }}-student{{item[0] + 1}}-windows_ws" Workshop_windows: "{{ec2_name_prefix}}-windows" Workshop: "{{ec2_name_prefix}}" + Workshop_type: "{{ workshop_type }}" Index: "{{ item[0] }}" Student: "student{{item[0] + 1}}" AWS_USERNAME: "{{ aws_user }}" diff --git a/provisioner/roles/populate_tower/tasks/rhel_90.yml b/provisioner/roles/populate_tower/tasks/rhel_90.yml index 90fe575e0..1a8fad204 100644 --- a/provisioner/roles/populate_tower/tasks/rhel_90.yml +++ b/provisioner/roles/populate_tower/tasks/rhel_90.yml @@ -17,4 +17,4 @@ my_tower_host: "{{ ansible_host }}" demo: hardening include_role: - name: "ipvsean.product_demos.install_demo" + name: "ansible.product_demos.install_demo"