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

RE-1001: Move GitHub Secrets into Variables that have no Secrecy need #583

Merged
merged 1 commit into from
Jan 9, 2025
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
48 changes: 25 additions & 23 deletions .github/workflows/openstack-centos-7.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
name: "Test Run: centos-7"

on:
workflow_dispatch:
inputs:
message:
description: 'Build description CentOS 7'

workflow_run:
workflows: ["TestSuite"]
types:
- completed

workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-openstack-centos-7
cancel-in-progress: true

env:
# secrets
TF_VAR_application_credential_id: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
TF_VAR_application_credential_secret: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
TF_VAR_github_repository: ${{ github.repository }}
TF_VAR_github_run_id: ${{ github.run_id }}
TF_VAR_ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
TF_VAR_ssh_public_key: ${{ secrets.SSH_PUBLIC_KEY }}
TF_VAR_os_auth_region: ${{ secrets.OS_AUTH_REGION }}
TF_VAR_os_auth_url: ${{ secrets.OS_AUTH_URL }}
TF_VAR_os_interface: ${{ secrets.OS_INTERFACE }}
TF_VAR_os_project_domain_name: ${{ secrets.OS_PROJECT_DOMAIN_NAME }}
TF_VAR_os_password: ${{ secrets.OS_PASSWORD }}
TF_VAR_os_project_id: ${{ secrets.OS_PROJECT_ID }}
TF_VAR_os_project_domain_id: ${{ secrets.OS_PROJECT_DOMAIN_ID }}
TF_VAR_os_project_name: ${{ secrets.OS_PROJECT_NAME }}
TF_VAR_os_region_name: ${{ secrets.OS_REGION_NAME }}
TF_VAR_os_username: ${{ secrets.OS_USERNAME }}

# vars
TF_VAR_os_auth_url: ${{ vars.OS_AUTH_URL }}
TF_VAR_os_auth_type: ${{ vars.OS_AUTH_TYPE }}
TF_VAR_os_identity_api_version: ${{ vars.OS_IDENTITY_API_VERSION }}
TF_VAR_os_interface: ${{ vars.OS_INTERFACE }}
TF_VAR_os_region_name: ${{ vars.OS_REGION_NAME }}

# github
TF_VAR_github_repository: ${{ github.repository }}
TF_VAR_github_run_id: ${{ github.run_id }}
tf_working_directory: "${{ github.workspace }}/.github/workflows/openstack/centos-7"

jobs:
Expand All @@ -44,6 +34,18 @@ jobs:
working-directory: "${{ github.workspace }}/.github/workflows/openstack/centos-7"
steps:
- uses: actions/checkout@v4

- name: Dump all GitHub variables
run: |
echo "Dumping all GitHub variables:"
echo "github.ref: ${{ github.ref }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.job: ${{ github.job }}"
echo "github.workflow: ${{ github.workflow }}"
echo "github.triggering_actor: ${{ github.triggering_actor }}"
echo "github.event_name: ${{ github.event_name }}"
echo "github.event.repository.master_branch: ${{ github.event.repository.master_branch }}"

- name: Terraform fmt
id: fmt
run: |
Expand Down Expand Up @@ -553,7 +555,7 @@ jobs:
/scripts/status_marker 5
tail -n40 -F /var/log/elevate-cpanel.log &
sleep 2.5
SKIP_PID_CHECK=1 REBOOT_STRING="Doing final reboot" RETVAL=1 /scripts/reboot_watch
REBOOT_STRING="Doing final reboot" RETVAL=1 /scripts/reboot_watch

wait_for_final_reboot:
runs-on: self-hosted
Expand Down
48 changes: 25 additions & 23 deletions .github/workflows/openstack-cloudlinux-7.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
name: "Test Run: cloudlinux-7"

on:
workflow_dispatch:
inputs:
message:
description: 'Build description CloudLinux 7'

workflow_run:
workflows: ["TestSuite"]
types:
- completed

workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-openstack-cloudlinux-7
cancel-in-progress: true

env:
# secrets
TF_VAR_application_credential_id: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
TF_VAR_application_credential_secret: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
TF_VAR_github_repository: ${{ github.repository }}
TF_VAR_github_run_id: ${{ github.run_id }}
TF_VAR_ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
TF_VAR_ssh_public_key: ${{ secrets.SSH_PUBLIC_KEY }}
TF_VAR_os_auth_region: ${{ secrets.OS_AUTH_REGION }}
TF_VAR_os_auth_url: ${{ secrets.OS_AUTH_URL }}
TF_VAR_os_interface: ${{ secrets.OS_INTERFACE }}
TF_VAR_os_project_domain_name: ${{ secrets.OS_PROJECT_DOMAIN_NAME }}
TF_VAR_os_password: ${{ secrets.OS_PASSWORD }}
TF_VAR_os_project_id: ${{ secrets.OS_PROJECT_ID }}
TF_VAR_os_project_domain_id: ${{ secrets.OS_PROJECT_DOMAIN_ID }}
TF_VAR_os_project_name: ${{ secrets.OS_PROJECT_NAME }}
TF_VAR_os_region_name: ${{ secrets.OS_REGION_NAME }}
TF_VAR_os_username: ${{ secrets.OS_USERNAME }}

# vars
TF_VAR_os_auth_url: ${{ vars.OS_AUTH_URL }}
TF_VAR_os_auth_type: ${{ vars.OS_AUTH_TYPE }}
TF_VAR_os_identity_api_version: ${{ vars.OS_IDENTITY_API_VERSION }}
TF_VAR_os_interface: ${{ vars.OS_INTERFACE }}
TF_VAR_os_region_name: ${{ vars.OS_REGION_NAME }}

# github
TF_VAR_github_repository: ${{ github.repository }}
TF_VAR_github_run_id: ${{ github.run_id }}
tf_working_directory: "${{ github.workspace }}/.github/workflows/openstack/cloudlinux-7"

jobs:
Expand All @@ -44,6 +34,18 @@ jobs:
working-directory: "${{ github.workspace }}/.github/workflows/openstack/cloudlinux-7"
steps:
- uses: actions/checkout@v4

- name: Dump all GitHub variables
run: |
echo "Dumping all GitHub variables:"
echo "github.ref: ${{ github.ref }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.job: ${{ github.job }}"
echo "github.workflow: ${{ github.workflow }}"
echo "github.triggering_actor: ${{ github.triggering_actor }}"
echo "github.event_name: ${{ github.event_name }}"
echo "github.event.repository.master_branch: ${{ github.event.repository.master_branch }}"

- name: Terraform fmt
id: fmt
run: |
Expand Down Expand Up @@ -566,7 +568,7 @@ jobs:
/scripts/status_marker 5
tail -n40 -F /var/log/elevate-cpanel.log &
sleep 2.5
SKIP_PID_CHECK=1 REBOOT_STRING="Doing final reboot" RETVAL=1 /scripts/reboot_watch
REBOOT_STRING="Doing final reboot" RETVAL=1 /scripts/reboot_watch

wait_for_final_reboot:
runs-on: self-hosted
Expand Down
51 changes: 27 additions & 24 deletions .github/workflows/openstack-ubuntu-20.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
name: "Test Run: ubuntu-20.04"
name: "Test Run: ubuntu-20"

on:
workflow_dispatch:
inputs:
message:
description: 'Build description Ubuntu 20.04'

workflow_run:
workflows: ["TestSuite"]
types:
- completed

workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-openstack-ubuntu-20.04
cancel-in-progress: true

env:
# secrets
TF_VAR_application_credential_id: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
TF_VAR_application_credential_secret: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
TF_VAR_github_repository: ${{ github.repository }}
TF_VAR_github_run_id: ${{ github.run_id }}
TF_VAR_ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
TF_VAR_ssh_public_key: ${{ secrets.SSH_PUBLIC_KEY }}
TF_VAR_os_auth_region: ${{ secrets.OS_AUTH_REGION }}
TF_VAR_os_auth_url: ${{ secrets.OS_AUTH_URL }}
TF_VAR_os_interface: ${{ secrets.OS_INTERFACE }}
TF_VAR_os_project_domain_name: ${{ secrets.OS_PROJECT_DOMAIN_NAME }}
TF_VAR_os_password: ${{ secrets.OS_PASSWORD }}
TF_VAR_os_project_id: ${{ secrets.OS_PROJECT_ID }}
TF_VAR_os_project_domain_id: ${{ secrets.OS_PROJECT_DOMAIN_ID }}
TF_VAR_os_project_name: ${{ secrets.OS_PROJECT_NAME }}
TF_VAR_os_region_name: ${{ secrets.OS_REGION_NAME }}
TF_VAR_os_username: ${{ secrets.OS_USERNAME }}

# vars
TF_VAR_os_auth_url: ${{ vars.OS_AUTH_URL }}
TF_VAR_os_auth_type: ${{ vars.OS_AUTH_TYPE }}
TF_VAR_os_identity_api_version: ${{ vars.OS_IDENTITY_API_VERSION }}
TF_VAR_os_interface: ${{ vars.OS_INTERFACE }}
TF_VAR_os_region_name: ${{ vars.OS_REGION_NAME }}

# github
TF_VAR_github_repository: ${{ github.repository }}
TF_VAR_github_run_id: ${{ github.run_id }}
tf_working_directory: "${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04"

jobs:
Expand All @@ -44,6 +34,19 @@ jobs:
working-directory: "${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04"
steps:
- uses: actions/checkout@v4
# Step to dump all GitHub variables

- name: Dump all GitHub variables
run: |
echo "Dumping all GitHub variables:"
echo "github.ref: ${{ github.ref }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.job: ${{ github.job }}"
echo "github.workflow: ${{ github.workflow }}"
echo "github.triggering_actor: ${{ github.triggering_actor }}"
echo "github.event_name: ${{ github.event_name }}"
echo "github.event.repository.master_branch: ${{ github.event.repository.master_branch }}"

- name: Terraform fmt
id: fmt
run: |
Expand Down Expand Up @@ -553,7 +556,7 @@ jobs:
/scripts/status_marker 5
tail -n40 -F /var/log/elevate-cpanel.log &
sleep 2.5
SKIP_PID_CHECK=1 REBOOT_STRING="Doing final reboot" RETVAL=1 /scripts/reboot_watch
REBOOT_STRING="Great SUCCESS" RETVAL=1 /scripts/reboot_watch

wait_for_final_reboot:
runs-on: self-hosted
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/openstack/centos-7/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ provider "openstack" {
user_name = var.user
application_credential_id = var.application_credential_id
application_credential_secret = var.application_credential_secret
auth_url = "https://keystone.hou-01.cloud.prod.cpanel.net:5000/v3"
region = var.os_auth_region
auth_url = var.os_auth_url
region = var.os_region_name
}

data "openstack_images_image_ids_v2" "images" {
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/openstack/centos-7/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,14 @@ variable "github_run_id" {
type = string
}

variable "os_password" {
type = string
}

variable "os_auth_region" {
type = string
}

variable "os_auth_url" {
type = string
type = string
default = "https://keystone.hou-01.cloud.prod.cpanel.net:5000/v3"
}

variable "os_project_domain_name" {
type = string
variable "os_region_name" {
type = string
default = "RegionOne"
}

variable "ssh_private_key" {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/openstack/cloudlinux-7/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ provider "openstack" {
user_name = var.user
application_credential_id = var.application_credential_id
application_credential_secret = var.application_credential_secret
auth_url = "https://keystone.hou-01.cloud.prod.cpanel.net:5000/v3"
region = var.os_auth_region
auth_url = var.os_auth_url
region = var.os_region_name
}

data "openstack_images_image_ids_v2" "images" {
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/openstack/cloudlinux-7/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,15 @@ variable "github_run_id" {
type = string
}

variable "os_password" {
type = string
}

variable "os_auth_region" {
variable "os_region_name" {
type = string
default = "RegionOne"
}

variable "os_auth_url" {
type = string
}

variable "os_project_domain_name" {
type = string
}

variable "ssh_private_key" {
type = string
description = "SSH private key matching the public key added to the VMs /root/.ssh/authorized_keys file to allow user access."
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/openstack/ubuntu-20.04/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ provider "openstack" {
user_name = var.user
application_credential_id = var.application_credential_id
application_credential_secret = var.application_credential_secret
auth_url = "https://keystone.hou-01.cloud.prod.cpanel.net:5000/v3"
region = var.os_auth_region
auth_url = var.os_auth_url
region = var.os_region_name
}

data "openstack_images_image_ids_v2" "images" {
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/openstack/ubuntu-20.04/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ variable "application_credential_secret" {
type = string
}

variable "os_password" {
type = string
}

variable "github_repository" {
type = string
}
Expand All @@ -23,16 +19,14 @@ variable "github_run_id" {
type = string
}

variable "os_auth_region" {
type = string
}

variable "os_auth_url" {
type = string
type = string
default = "https://keystone.hou-01.cloud.prod.cpanel.net:5000/v3"
}

variable "os_project_domain_name" {
type = string
variable "os_region_name" {
type = string
default = "RegionOne"
}

variable "ssh_private_key" {
Expand Down
Loading
Loading