diff --git a/CHANGELOG.md b/CHANGELOG.md index 21e51526..73f86011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,36 @@ All notable changes to this project will be documented in this file. +## 1.15.0 + +### Upgrade Notes + +- Updated to the latest version of `lazy-z` to fix an issue with some CIDR ranges and IP addresses being incorrectly flagged as invalid + +### Features + +- VPC Routing Tables can now be advertised to Transit Gateway, and Direct Link +- VPC Routing Table routes can now be assigned a Priority value and can advertise to the parent table's sources by using the `Advertise` toggle +- Cloud Object Storage buckets now support Metrics Monitoring and Activity Tracking +- Local CIDRs and Peer CIDRs are no longer required when creating a connection for a route-based VPN Gateway +- F5 Templates with an invalid TMOS Admin Password are now shown as invalid from `/v2/vpcDeployments` +- Image validation is now performed before a CRAIG configuration can be uploaded to Schematics +- Users can now reserve specific IPs for VPC VSI Deployments by toggling the `Configure VSI IP Addresses` toggle +- Domain Fields for Classic Gateways can now have `-` characters +- Invalid VPC deployments are now shown in `/v2/vpcDeployments` even when there are no VPCs in the current configuration +- F5 Templates with an invalid TMOS Admin Password are now shown as invalid from `/v2/vpcDeployments` +- When updating to the latest CRAIG version in a project using Manual VPC Address Management, VPC Subnet Address Prefixes will automatically be updated to match custom subnet CIDRs +- Updated resource helper text fields to more accurately display resource names at time of provision + +### Fixes + +- Fixed an issue causing encryption keys with no Key Ring value to populate with a `null` key ring +- Fixed an issue where VPC address prefixes were not being updated when advanced subnets were created with Manual Address Management enabled +- Fixed an issue preventing Terraform from being created when using an existing VPC +- Fixed an issue causing Routing Tables to not have correct reference to an imported VPC +- Clusters with names longer than 32 characters are now correctly shown as invalid +- Fixed an issue where the VPN as a service template had an incorrect VPC address prefix + ## 1.14.1 ### Upgrade Notes diff --git a/ansible/template-test/main.yml b/ansible/template-test/main.yml index 7d55d038..e4012723 100644 --- a/ansible/template-test/main.yml +++ b/ansible/template-test/main.yml @@ -12,8 +12,14 @@ - ./vars/template_override_vars/{{template}}.yml roles: - role: get_iam_token + - role: pause + vars: + pause_time: 1 - role: download_tar + - role: get_workspace_data + when: use_existing_workspace == "true" - role: create_schematics_workspace + when: use_existing_workspace == "false" vars: description: Automated CRAIG Testing Workspace - role: upload_tar @@ -22,6 +28,9 @@ vars_files: ./vars/vars.template.yml roles: - role: update_variablestore + - role: pause + vars: + pause_time: 1 - role: update_workspace_variables - name: Deploy CRAIG terraform template hosts: localhost @@ -78,4 +87,6 @@ roles: - role: get_iam_token - role: delete_schematics_workspace - when: job_status != "job_failed" \ No newline at end of file + when: + - job_status != "job_failed" + - use_existing_workspace == "false" \ No newline at end of file diff --git a/ansible/template-test/roles/action/tasks/main.yml b/ansible/template-test/roles/action/tasks/main.yml index 661382e8..d846f271 100644 --- a/ansible/template-test/roles/action/tasks/main.yml +++ b/ansible/template-test/roles/action/tasks/main.yml @@ -2,7 +2,7 @@ # tasks file for action - name: Start {{ action_type }} action uri: - url: https://schematics.cloud.ibm.com/v1/workspaces/{{ workspace.json.id }}/{{ action_type }} + url: "https://schematics.cloud.ibm.com/v1/workspaces/{{ existing_workspace_id if use_existing_workspace == 'true' else new_workspace_id }}/{{ action_type }}" method: "{{ 'POST' if action_type == 'plan' else 'PUT' }}" body_format: json headers: diff --git a/ansible/template-test/roles/create_schematics_workspace/tasks/main.yml b/ansible/template-test/roles/create_schematics_workspace/tasks/main.yml index 3e286dca..dc22315a 100644 --- a/ansible/template-test/roles/create_schematics_workspace/tasks/main.yml +++ b/ansible/template-test/roles/create_schematics_workspace/tasks/main.yml @@ -16,4 +16,8 @@ "tags": ["craig"] "template_data": [{ "type": "terraform_v1.5"}] status_code: 201 - register: workspace \ No newline at end of file + register: workspace +- name: Store Workspace IDs + set_fact: + new_workspace_id: "{{ workspace.json.id }}" + template_id: "{{ workspace.json.template_data[0].id }}" \ No newline at end of file diff --git a/ansible/template-test/roles/delete_schematics_workspace/tasks/main.yml b/ansible/template-test/roles/delete_schematics_workspace/tasks/main.yml index 33db1ffd..95ba5547 100644 --- a/ansible/template-test/roles/delete_schematics_workspace/tasks/main.yml +++ b/ansible/template-test/roles/delete_schematics_workspace/tasks/main.yml @@ -2,7 +2,7 @@ # tasks file for delete_schematics_workspace - name: Delete Schematics Workspace uri: - url: https://schematics.cloud.ibm.com/v1/workspaces/{{workspace.json.id}} + url: https://schematics.cloud.ibm.com/v1/workspaces/{{ new_workspace_id }} method: DELETE headers: Authorization: Bearer {{token.json.access_token}} diff --git a/ansible/template-test/roles/get_workspace_data/README.md b/ansible/template-test/roles/get_workspace_data/README.md new file mode 100644 index 00000000..225dd44b --- /dev/null +++ b/ansible/template-test/roles/get_workspace_data/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/ansible/template-test/roles/get_workspace_data/defaults/main.yml b/ansible/template-test/roles/get_workspace_data/defaults/main.yml new file mode 100644 index 00000000..a6fd895e --- /dev/null +++ b/ansible/template-test/roles/get_workspace_data/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for get_workspace_data diff --git a/ansible/template-test/roles/get_workspace_data/handlers/main.yml b/ansible/template-test/roles/get_workspace_data/handlers/main.yml new file mode 100644 index 00000000..d8cdb732 --- /dev/null +++ b/ansible/template-test/roles/get_workspace_data/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for get_workspace_data diff --git a/ansible/template-test/roles/get_workspace_data/meta/main.yml b/ansible/template-test/roles/get_workspace_data/meta/main.yml new file mode 100644 index 00000000..c572acc9 --- /dev/null +++ b/ansible/template-test/roles/get_workspace_data/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/ansible/template-test/roles/get_workspace_data/tasks/main.yml b/ansible/template-test/roles/get_workspace_data/tasks/main.yml new file mode 100644 index 00000000..05dd1337 --- /dev/null +++ b/ansible/template-test/roles/get_workspace_data/tasks/main.yml @@ -0,0 +1,12 @@ +--- +# tasks file for get_workspace_data +- name: Get workspace data + uri: + url: "https://schematics.cloud.ibm.com/v1/workspaces/{{existing_workspace_id}}" + method: GET + headers: + Authorization: Bearer {{token.json.access_token}} + register: workspace_data +- name: Store template_id from workspace + set_fact: + template_id: "{{workspace_data.json.template_data[0].id}}" diff --git a/ansible/template-test/roles/get_workspace_data/tests/inventory b/ansible/template-test/roles/get_workspace_data/tests/inventory new file mode 100644 index 00000000..878877b0 --- /dev/null +++ b/ansible/template-test/roles/get_workspace_data/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/ansible/template-test/roles/get_workspace_data/tests/test.yml b/ansible/template-test/roles/get_workspace_data/tests/test.yml new file mode 100644 index 00000000..54820e40 --- /dev/null +++ b/ansible/template-test/roles/get_workspace_data/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - get_workspace_data diff --git a/ansible/template-test/roles/get_workspace_data/vars/main.yml b/ansible/template-test/roles/get_workspace_data/vars/main.yml new file mode 100644 index 00000000..c5cd5670 --- /dev/null +++ b/ansible/template-test/roles/get_workspace_data/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for get_workspace_data diff --git a/ansible/template-test/roles/pause/tasks/main.yml b/ansible/template-test/roles/pause/tasks/main.yml index ce695ae1..9d45c93d 100644 --- a/ansible/template-test/roles/pause/tasks/main.yml +++ b/ansible/template-test/roles/pause/tasks/main.yml @@ -1,4 +1,4 @@ --- -- name: Pause playbook for 5 minutes +- name: Pause playbook for "{{ pause_time }}" minute(s) ansible.builtin.pause: - minutes: "{{ pause_time }}" + minutes: "{{ pause_time }}" \ No newline at end of file diff --git a/ansible/template-test/roles/update_workspace_variables/tasks/main.yml b/ansible/template-test/roles/update_workspace_variables/tasks/main.yml index 24620002..77cf18ff 100644 --- a/ansible/template-test/roles/update_workspace_variables/tasks/main.yml +++ b/ansible/template-test/roles/update_workspace_variables/tasks/main.yml @@ -2,7 +2,7 @@ # tasks file for update_workspace_variables - name: Update Workspace Variables uri: - url: https://schematics.cloud.ibm.com/v1/workspaces/{{ workspace.json.id }}/template_data/{{ workspace.json.template_data[0].id }}/values + url: "https://schematics.cloud.ibm.com/v1/workspaces/{{ existing_workspace_id if use_existing_workspace == 'true' else new_workspace_id }}/template_data/{{ template_id }}/values" method: PUT headers: Authorization: Bearer {{token.json.access_token}} diff --git a/ansible/template-test/roles/upload_tar/tasks/main.yml b/ansible/template-test/roles/upload_tar/tasks/main.yml index dc25fd1a..21dc9ac3 100644 --- a/ansible/template-test/roles/upload_tar/tasks/main.yml +++ b/ansible/template-test/roles/upload_tar/tasks/main.yml @@ -2,13 +2,13 @@ # tasks file for upload_tar - name: Upload {{template}}.tar to Schematics Workspace ansible.builtin.shell: "curl -s --request PUT \ - --url 'https://schematics.cloud.ibm.com/v1/workspaces/{{ workspace.json.id }}/template_data/{{ workspace.json.template_data[0].id }}/template_repo_upload' \ + --url 'https://schematics.cloud.ibm.com/v1/workspaces/{{ existing_workspace_id if use_existing_workspace == 'true' else new_workspace_id }}/template_data/{{ template_id }}/template_repo_upload' \ -H 'Authorization: Bearer {{ token.json.access_token }}' \ -H 'Content-Type: multipart/form-data' \ --form 'file=@{{playbook_dir}}/{{template}}.tar'" - name: Wait until {{template}}.tar has been successfully uploaded uri: - url: https://schematics.cloud.ibm.com/v1/workspaces/{{ workspace.json.id }} + url: "https://schematics.cloud.ibm.com/v1/workspaces/{{ existing_workspace_id if use_existing_workspace == 'true' else new_workspace_id }}" method: GET body_format: json headers: diff --git a/ansible/template-test/test-inside-action.yml b/ansible/template-test/test-inside-action.yml index 467a5299..afcee45f 100644 --- a/ansible/template-test/test-inside-action.yml +++ b/ansible/template-test/test-inside-action.yml @@ -34,5 +34,9 @@ metadata: secure: true - name: tf_var_ssh_key - value: "{{ tf_var_ssh_key }}" + value: "{{ tf_var_ssh_key }}" + - name: use_existing_workspace + value: "{{ use_existing_workspace }}" + - name: existing_workspace_id + value: "{{ existing_workspace_id }}" - role: run_schematics_action \ No newline at end of file diff --git a/ansible/template-test/vars/template_override_vars/from-scratch.yml b/ansible/template-test/vars/template_override_vars/from-scratch.yml new file mode 100644 index 00000000..e69de29b diff --git a/ansible/template-test/vars/template_override_vars/power-vs-poc.yml b/ansible/template-test/vars/template_override_vars/power-vs-poc.yml index f982ae31..ac6c2405 100644 --- a/ansible/template-test/vars/template_override_vars/power-vs-poc.yml +++ b/ansible/template-test/vars/template_override_vars/power-vs-poc.yml @@ -85,7 +85,7 @@ override_craig: - name: "pvm" ip_address: "" ssh_key: "powervs-ssh-key" - image: "IBMi-75-01-2924-2" + image: "IBMi-75-03-2984-1" pi_sys_type: "s922" pi_proc_type: "shared" pi_processors: "0.25" diff --git a/ansible/template-test/vars/vars.template.yml b/ansible/template-test/vars/vars.template.yml index dfcc7c79..2aa767a9 100644 --- a/ansible/template-test/vars/vars.template.yml +++ b/ansible/template-test/vars/vars.template.yml @@ -2,14 +2,19 @@ # To run this playbook , copy this file to `vars.yml` and fill in your data # tf_var_preshared_key is only needed for the POC template +# Terrafrom variabes tf_var_api_key: "" tf_var_ssh_key: "" tf_var_prefix: "" tf_var_preshared_key: "" # 6-128 characters -workspace_name: "" -template: "