diff --git a/.gitignore b/.gitignore index f18d8ac0..cfe36b94 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,4 @@ tfxjs.tfvars /build .icse/ tf-test/ -dev/ - -vars.yml \ No newline at end of file +dev/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 016af664..6342f339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file. +## 1.14.0 + +### Upgrade Notes + + +### Features + +- Users can now update existing CRAIG templates and download the updated tar file by using the endpoint POST `/api/craig/template-tar/:template` +- From the options page, users can now enable Manual Power VSI naming. When this is enabled, the environment prefix will not be prepended to the names of Power VS Virtual Server or FalconStor VTL instances +- Users can now provision VPC VSI deployments using an existing volume snapshot by using the `Create VSI From Snapshot` toggle. A list of snapshots will be dynamically retrieved using the IBM Cloud API based on the region selected in your project +- When creating a VSI Deployment, users can select a new toggle `Include Name Variables`. When this value is set to true, VSI names will be populated as variables in Terrafrom. This allows for users to have full control over VSI names without needing to directly modify Terraform scripts +- Power VS Virtual Server and FalconStor VTL system types are now retrieved dynamically using the Power VS API based on the zone +- Power Edge Router is now supported for `syd05` +- CRAIG now supports the Power VS region `osa21` +- When updating a VPC's Public Gateways, invalid gateways will automatically be removed from subnets where they are enabled + +### Fixes + +- Fixed an issue causing Power VS API endpoints for Sao Palo availability zones to fail +- Fixed an issue causing VPC subnets to incorrectly have `public_gateway` set to true when no public gateway is created in the corresponding zone +- Fixed an issue causing the Resource Group field for Key Management services to not be rendered when using a resource from data + ## 1.13.1 ### Upgrade Notes @@ -11,6 +33,8 @@ All notable changes to this project will be documented in this file. - `.env.example` has been updated to include a warning that included quotation marks in .env values will cause the application to crash - When fetching VSI Images, the Craig API has no limit on the number of images that can be retrieved. In addition, only available images are retrieved - Power VS Network interface outputs now use the Terraform field `pi_network_name` instead of the depricated field `name` +- When updating a project's region, VSI images are now reset to ensure that images are available in the selected region +- When updating a Power VS workspace availability zone, storage tiers and storage pools are now reset for Power VS Instances, Volumes, and FalconStor VTLs ### Features diff --git a/ansible/template-test/main.yml b/ansible/template-test/main.yml index 292a6cd6..76f2c765 100644 --- a/ansible/template-test/main.yml +++ b/ansible/template-test/main.yml @@ -16,19 +16,17 @@ - role: create_schematics_workspace vars: description: Automated CRAIG Testing Workspace - tags: ["craig"] - name: TODO - convert to roles hosts: localhost vars_files: ./vars/vars.yml tasks: - name: Upload {{template}}.tar to Schematics Workspace - command: "curl -s --request PUT \ + 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' \ -H 'Authorization: Bearer {{ token.json.access_token }}' \ -H 'Content-Type: multipart/form-data' \ --form 'file=@{{playbook_dir}}/{{template}}.tar'" - async: 120 - name: Wait until {{template}}.tar has been successfully uploaded uri: url: https://schematics.cloud.ibm.com/v1/workspaces/{{ workspace.json.id }} @@ -45,13 +43,6 @@ vars_files: ./vars/vars.yml roles: - role: update_variablestore - vars: - # Additional variables can be added to the variablestore by adding elements to the array below. - # Each element must be a map of the following key/value pairs: - # {'name': string, 'secure': bool, 'use_default': bool, 'value': variable_value} - # Note: If using a variable defined in /vars/vars.yml, specify the map using the following syntax: - # {'name': string, 'secure': bool, 'use_default': bool, 'value': "{{variable}}"} - additional_variables: [{'name': ssh_key_public_key, 'secure': true, 'use_default': false, 'value': "{{ssh_key}}"}] - role: update_workspace_variables - name: Start generate plan action hosts: localhost @@ -60,29 +51,29 @@ - role: get_iam_token - role: action vars: - action: plan + action_type: plan - role: get_iam_token - role: await_action vars: - action: plan + action_type: plan register_name: await_plan - role: get_iam_token - role: action vars: - action: apply + action_type: apply - role: get_iam_token - role: await_action vars: - action: apply + action_type: apply register_name: await_apply - role: get_iam_token - role: action vars: - action: destroy + action_type: destroy - role: get_iam_token - role: await_action vars: - action: destroy + action_type: destroy register_name: await_destroy - role: get_iam_token - role: delete_schematics_workspace \ 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 9ad4bec3..661382e8 100644 --- a/ansible/template-test/roles/action/tasks/main.yml +++ b/ansible/template-test/roles/action/tasks/main.yml @@ -1,9 +1,9 @@ --- # tasks file for action -- name: Start {{ action }} action +- name: Start {{ action_type }} action uri: - url: https://schematics.cloud.ibm.com/v1/workspaces/{{ workspace.json.id }}/{{ action }} - method: "{{ 'POST' if action == 'plan' else 'PUT' }}" + url: https://schematics.cloud.ibm.com/v1/workspaces/{{ workspace.json.id }}/{{ action_type }} + method: "{{ 'POST' if action_type == 'plan' else 'PUT' }}" body_format: json headers: Authorization: Bearer {{token.json.access_token}} diff --git a/ansible/template-test/roles/await_action/tasks/main.yml b/ansible/template-test/roles/await_action/tasks/main.yml index 969284ae..8fd981d2 100644 --- a/ansible/template-test/roles/await_action/tasks/main.yml +++ b/ansible/template-test/roles/await_action/tasks/main.yml @@ -1,4 +1,4 @@ -- name: Ensure {{ action }} finishes +- name: Ensure {{ action_type }} finishes uri: url: https://schematics.cloud.ibm.com/v2/jobs/{{ action_result.json.activityid }} method: GET 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 6f9e9b49..3e286dca 100644 --- a/ansible/template-test/roles/create_schematics_workspace/tasks/main.yml +++ b/ansible/template-test/roles/create_schematics_workspace/tasks/main.yml @@ -12,8 +12,8 @@ "resource_group": "{{ resource_group }}" "type": ["terraform_v1.5"] "location": "{{ region }}" - "description": "{{ description }}" - "tags": "{{ tags }}" + "description": "Automated CRAIG Testing Workspace" + "tags": ["craig"] "template_data": [{ "type": "terraform_v1.5"}] status_code: 201 register: workspace \ 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 9a02962b..7b98c631 100644 --- a/ansible/template-test/roles/delete_schematics_workspace/tasks/main.yml +++ b/ansible/template-test/roles/delete_schematics_workspace/tasks/main.yml @@ -8,6 +8,6 @@ Authorization: Bearer {{token.json.access_token}} status_code: 200 register: delete_response - until: delete_response.status == 200 + until: delete_response.status == 200 or delete_response.status == 404 retries: 2 delay: 120 \ No newline at end of file diff --git a/ansible/template-test/roles/download_tar/tasks/main.yml b/ansible/template-test/roles/download_tar/tasks/main.yml index 35686117..f941132c 100644 --- a/ansible/template-test/roles/download_tar/tasks/main.yml +++ b/ansible/template-test/roles/download_tar/tasks/main.yml @@ -4,5 +4,5 @@ get_url: url: "{{craig_url}}/{{template}}" dest: "{{playbook_dir}}/{{template}}.tar" - async: 120 + timeout: 300 retries: 10 \ No newline at end of file diff --git a/ansible/template-test/roles/get_iam_token/tasks/main.yml b/ansible/template-test/roles/get_iam_token/tasks/main.yml index 2e1c2090..1019ca86 100644 --- a/ansible/template-test/roles/get_iam_token/tasks/main.yml +++ b/ansible/template-test/roles/get_iam_token/tasks/main.yml @@ -6,5 +6,5 @@ method: POST headers: Content-Type: application/x-www-form-urlencoded - body: "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey={{api_key}}" + body: "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey={{tf_var_api_key}}" register: token diff --git a/ansible/template-test/roles/update_variablestore/tasks/main.yml b/ansible/template-test/roles/update_variablestore/tasks/main.yml index 315992d8..92c9f9af 100644 --- a/ansible/template-test/roles/update_variablestore/tasks/main.yml +++ b/ansible/template-test/roles/update_variablestore/tasks/main.yml @@ -1,6 +1,6 @@ --- # tasks file for update_variablestore -- name: Add variable to variable store +- name: Update variablestore set_fact: - variablestore: "{{ variablestore + additional_variables }}" + variablestore: "{{ variablestore + [{'name': item, 'secure': true, 'use_default': false, 'value': tf_var_ssh_key}] }}" loop: "{{template_map[template]}}" \ No newline at end of file diff --git a/ansible/template-test/vars/vars.yml b/ansible/template-test/vars/vars.yml new file mode 100644 index 00000000..0be0931d --- /dev/null +++ b/ansible/template-test/vars/vars.yml @@ -0,0 +1,38 @@ +--- +# To run this in schematics actions, you will need to update the below commented out variables inside of schematics +# DO NOT ENTER YOUR VARIBLES HERE. THIS FILE SHOULD NEVER BE EDITED +# Do not alter the other variables. + +# tf_var_api_key: +# tf_var_ssh_key: +# tf_var_prefix: +# template: