-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ env: | |
TF_CLOUD_ORGANIZATION: "nolan" | ||
TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" | ||
TF_WORKSPACE: "golden-image-builder" | ||
TF_MAX_TIMEOUT: "1h" | ||
CONFIG_DIRECTORY: "./" | ||
|
||
jobs: | ||
|
@@ -183,8 +184,8 @@ jobs: | |
run: ${{ steps.create-run.outputs.run_id }} | ||
comment: "Confirmed from GitHub Actions CI" | ||
|
||
awx-ansible-tower: | ||
needs: azure-image-gallery | ||
packer-build: | ||
needs: awx-ansible-tower-on-tfc | ||
if: | | ||
always() && | ||
(needs.run-run-dot-sh.result == 'success' || needs.run-run-dot-sh.result == 'skipped') && | ||
|
@@ -194,6 +195,49 @@ jobs: | |
image: ghcr.io/${{ github.repository_owner }}/golden-image-builder-container:latest | ||
options: --user 1001 | ||
|
||
steps: | ||
# Checking out the repo | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Ansible version | ||
run: ansible --version | ||
|
||
- name: Ansible Galaxy install roles | ||
run: ansible-galaxy install -f -r ansible/roles/requirements.yml -p ansible/roles/ | ||
|
||
- name: Packer version | ||
run: packer -v | ||
|
||
- name: Packer init | ||
run: packer init -upgrade packer/all | ||
|
||
- name: Packer build | ||
# https://developer.hashicorp.com/packer/docs/templates/hcl_templates/onlyexcept | ||
run: packer build -force -only='amazon-ebs.ubuntu-2204' packer/all | ||
# run: packer build -force -except='vagrant.*' packer/all | ||
# run: PACKER_LOG=1 packer build -debug -force -only='googlecompute.ubuntu-2204' packer/all | ||
env: | ||
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} | ||
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} | ||
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} | ||
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} | ||
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} | ||
|
||
awx-ansible-tower: | ||
needs: packer-build | ||
if: | | ||
always() && | ||
(needs.run-run-dot-sh.result == 'success' || needs.run-run-dot-sh.result == 'skipped') && | ||
(needs.packer-build.result == 'success' || needs.packer-build.result == 'skipped') | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/${{ github.repository_owner }}/golden-image-builder-container:latest | ||
options: --user 1001 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
|
@@ -229,11 +273,11 @@ jobs: | |
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} | ||
|
||
awx-ansible-tower-on-tfc: | ||
needs: azure-image-gallery-on-tfc | ||
needs: packer-build | ||
if: | | ||
always() && | ||
(needs.run-run-dot-sh.result == 'success' || needs.run-run-dot-sh.result == 'skipped') && | ||
(needs.azure-image-gallery.result == 'success' || needs.azure-image-gallery.result == 'skipped' || needs.azure-image-gallery-on-tfc.result == 'success' || needs.azure-image-gallery-on-tfc.result == 'skipped') | ||
(needs.packer-build.result == 'success' || needs.packer-build.result == 'skipped') | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/${{ github.repository_owner }}/golden-image-builder-container:latest | ||
|
@@ -292,49 +336,7 @@ jobs: | |
- name: Apply Run | ||
uses: hashicorp/tfc-workflows-github/actions/[email protected] | ||
id: apply | ||
continue-on-error: true | ||
with: | ||
run: ${{ steps.create-run.outputs.run_id }} | ||
comment: "Confirmed from GitHub Actions CI" | ||
|
||
packer-build: | ||
needs: awx-ansible-tower-on-tfc | ||
if: | | ||
always() && | ||
(needs.run-run-dot-sh.result == 'success' || needs.run-run-dot-sh.result == 'skipped') && | ||
(needs.azure-image-gallery.result == 'success' || needs.azure-image-gallery.result == 'skipped' || needs.azure-image-gallery-on-tfc.result == 'success' || needs.azure-image-gallery-on-tfc.result == 'skipped') | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/${{ github.repository_owner }}/golden-image-builder-container:latest | ||
options: --user 1001 | ||
|
||
steps: | ||
# Checking out the repo | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Ansible version | ||
run: ansible --version | ||
|
||
- name: Ansible Galaxy install roles | ||
run: ansible-galaxy install -f -r ansible/roles/requirements.yml -p ansible/roles/ | ||
|
||
- name: Packer version | ||
run: packer -v | ||
|
||
- name: Packer init | ||
run: packer init -upgrade packer/all | ||
|
||
- name: Packer build | ||
# https://developer.hashicorp.com/packer/docs/templates/hcl_templates/onlyexcept | ||
run: packer build -force -only='amazon-ebs.ubuntu-2204' packer/all | ||
# run: packer build -force -except='vagrant.*' packer/all | ||
# run: PACKER_LOG=1 packer build -debug -force -only='googlecompute.ubuntu-2204' packer/all | ||
env: | ||
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} | ||
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} | ||
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} | ||
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} | ||
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,9 +29,11 @@ provider "azurerm" { | |
provider "google" {} | ||
|
||
module "aws_hashiqube" { | ||
source = "star3am/hashiqube/hashicorp" | ||
# source = "star3am/hashiqube/hashicorp" | ||
source = "[email protected]:star3am/terraform-hashicorp-hashiqube.git?ref=riaan" | ||
deploy_to_aws = true | ||
aws_instance_type = "t2.large" | ||
use_packer_image = true | ||
deploy_to_azure = false | ||
deploy_to_gcp = false | ||
debug_user_data = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters