Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify GCP VM name generation #1765

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/ci/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
gcp_project: "acs-san-stackroxci"
gcp_auth_kind: "serviceaccount"
gcp_service_account_file: /tmp/secret/stackrox-collector-e2e-tests/GOOGLE_CREDENTIALS_COLLECTOR_SVC_ACCT
gcp_instance_prefix: collector-ci
gcp_instance_prefix: ci
gcp_available_zones:
- us-central1-a
- us-central1-b
Expand Down
2 changes: 1 addition & 1 deletion ansible/ci/inventory_gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugin: gcp_compute
projects:
- acs-san-stackroxci
filters:
- name = collector-ci-*
- name = ci-*
keyed_groups:
# This will group the VMs by their labels, which means that on
# creation, we can use a unique identifier to group VMs
Expand Down
2 changes: 1 addition & 1 deletion ansible/dev/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gcp_project: "acs-team-sandbox"
gcp_auth_kind: "application"
gcp_service_account_file: null
gcp_instance_prefix: collector-dev
gcp_instance_prefix: dev
gcp_available_zones:
- us-central1-a
- us-central1-b
Expand Down
2 changes: 1 addition & 1 deletion ansible/dev/inventory_gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugin: gcp_compute
projects:
- acs-team-sandbox
filters:
- name = collector-dev-*
- name = dev-*
keyed_groups:
# This will group the VMs by their labels, which means that on
# creation, we can use a unique identifier to group VMs
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/create-all-vms/tasks/by-family.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

- set_fact:
arch: "{{ item.0.value.arch | default('amd64') }}"
hashed_job_id: "{{ job_id | hash('md5') | truncate(16, True, '') }}"

- set_fact:
ibm_env: "{{ s390x.env }}"
Expand All @@ -20,7 +21,7 @@
apply:
environment: "{{ ibm_env | default({}) }}"
vars:
vm_name: "{{ gcp_instance_prefix }}-{{ normalized_collection_method }}-{{ item.1 }}-{{ job_id }}"
vm_name: "{{ gcp_instance_prefix }}-{{ item.1 }}-{{ hashed_job_id }}"
vm_project: "{{ item.0.value.project }}"
vm_family: "{{ item.1 }}"
vm_platform: "{{ item.0.key }}"
Expand Down
3 changes: 0 additions & 3 deletions ansible/roles/create-all-vms/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---

- set_fact:
normalized_collection_method: "{{ collection_method | default('any') | replace('core_bpf', 'core') }}"

- name: Create VMs From Family
include_tasks: by-family.yml
#
Expand Down
Loading