Skip to content

Commit

Permalink
Merge remote-tracking branch 'internal/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jvallexm committed Apr 12, 2024
2 parents b35d322 + fb9d954 commit 4cc1cf3
Show file tree
Hide file tree
Showing 89 changed files with 3,829 additions and 774 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion ansible/template-test/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -78,4 +87,6 @@
roles:
- role: get_iam_token
- role: delete_schematics_workspace
when: job_status != "job_failed"
when:
- job_status != "job_failed"
- use_existing_workspace == "false"
2 changes: 1 addition & 1 deletion ansible/template-test/roles/action/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
"tags": ["craig"]
"template_data": [{ "type": "terraform_v1.5"}]
status_code: 201
register: workspace
register: workspace
- name: Store Workspace IDs
set_fact:
new_workspace_id: "{{ workspace.json.id }}"
template_id: "{{ workspace.json.template_data[0].id }}"
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
38 changes: 38 additions & 0 deletions ansible/template-test/roles/get_workspace_data/README.md
Original file line number Diff line number Diff line change
@@ -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).
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# defaults file for get_workspace_data
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# handlers file for get_workspace_data
52 changes: 52 additions & 0 deletions ansible/template-test/roles/get_workspace_data/meta/main.yml
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 12 additions & 0 deletions ansible/template-test/roles/get_workspace_data/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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}}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
localhost

5 changes: 5 additions & 0 deletions ansible/template-test/roles/get_workspace_data/tests/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- get_workspace_data
2 changes: 2 additions & 0 deletions ansible/template-test/roles/get_workspace_data/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# vars file for get_workspace_data
4 changes: 2 additions & 2 deletions ansible/template-test/roles/pause/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
4 changes: 2 additions & 2 deletions ansible/template-test/roles/upload_tar/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion ansible/template-test/test-inside-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 7 additions & 2 deletions ansible/template-test/vars/vars.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "<api-key>"
tf_var_ssh_key: "<public-ssh-key>"
tf_var_prefix: "<unique-prefix>"
tf_var_preshared_key: "<preshared-key>" # 6-128 characters

workspace_name: "<schematics-workspace-name>"
template: "<template>"
#Schematics variables
use_existing_workspace: "<boolean>"
workspace_name: "<new-schematics-workspace-name>" # Only needed when use_existing_workspace is false
existing_workspace_id: "<existing-schematics-workspace-id>" # Only needed when use_existing_workspace is true
action_name: "<schematics-action-name>"

template: "<craig-template-name>"
git_branch: "<branch-of-playbook>"

craig_url: https://craig.119gqgw56ti1.us-south.codeengine.appdomain.cloud/api/craig/template-tar
Expand Down
12 changes: 6 additions & 6 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "craig",
"version": "1.14.1",
"version": "1.15.0",
"private": true,
"license": "Apache-2.0",
"scripts": {
Expand All @@ -26,7 +26,7 @@
"html-to-image": "^1.11.11",
"json-to-tf": "^0.3.1",
"jszip": "^3.10.1",
"lazy-z": "^1.11.17",
"lazy-z": "^1.11.18",
"react": "^18.0.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.0.0",
Expand Down
Loading

0 comments on commit 4cc1cf3

Please sign in to comment.