Skip to content

Commit

Permalink
Introduce a variable version of TFE.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed Feb 2, 2024
1 parent 442f959 commit 72d327c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ The default values for the variables are set in [`defaults/main.yml`](https://gi
---
# defaults file for tfe
# Select the image to use for Terraform Enterprise. This includes the version.
# The latest tfe version can be found [here](https://developer.hashicorp.com/terraform/enterprise/releases/2023/v202303-1).
tfe_image: "images.releases.hashicorp.com/hashicorp/terraform-enterprise:v202309-1"
# Paste the license of Terraform Enterprise here. It's a long string.
# If the license is not set, may tasks will be skipped, resulting in a non-working
# Terraform Enterprise instance. Not setting a license can help with testing.
Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
# defaults file for tfe

# Select the image to use for Terraform Enterprise. This includes the version.
# The latest tfe version can be found [here](https://developer.hashicorp.com/terraform/enterprise/releases/2023/v202303-1).
tfe_image: "images.releases.hashicorp.com/hashicorp/terraform-enterprise:v202309-1"

# Paste the license of Terraform Enterprise here. It's a long string.
# If the license is not set, may tasks will be skipped, resulting in a non-working
# Terraform Enterprise instance. Not setting a license can help with testing.
Expand Down
5 changes: 2 additions & 3 deletions files/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
version: "3"
services:
tfe:
# The latest tfe version can be found [here](https://developer.hashicorp.com/terraform/enterprise/releases/2023/v202303-1).
image: "images.releases.hashicorp.com/hashicorp/terraform-enterprise:v202309-1"
image: "${TFE_IMAGE}"
restart: on-failure
environment:
TFE_LICENSE: "${TFE_LICENSE}"
Expand All @@ -26,7 +25,7 @@ services:
TFE_OBJECT_STORAGE_S3_SECRET_ACCESS_KEY: "${TFE_OBJECT_STORAGE_S3_SECRET_ACCESS_KEY}"
TFE_OBJECT_STORAGE_S3_REGION: "${TFE_OBJECT_STORAGE_S3_REGION}"
TFE_OBJECT_STORAGE_S3_BUCKET: "${TFE_OBJECT_STORAGE_S3_BUCKET}"
TFE_REDIS_HOST: "${TFE_REDIS_HOST}" # Read from .env file
TFE_REDIS_HOST: "${TFE_REDIS_HOST}"
TFE_REDIS_USER: "tfe"
TFE_REDIS_PASSWORD: "my_redis_password.123"
TFE_REDIS_USE_TLS: "false"
Expand Down
4 changes: 4 additions & 0 deletions meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ argument_specs:
Install and configure tfe on your system.
author: Robert de Bock
options:
tfe_image:
type: "str"
default: "images.releases.hashicorp.com/hashicorp/terraform-enterprise:v202309-1"
description: "Select the image to use for Terraform Enterprise. This includes the version."
tfe_license:
type: "str"
default: "XYZ123"
Expand Down
8 changes: 8 additions & 0 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
---

- name: assert | Test tfe_image
ansible.builtin.assert:
that:
- tfe_image is defined
- tfe_image is string
- tfe_image is not none
quiet: yes

- name: assert | Test tfe_license
ansible.builtin.assert:
that:
Expand Down
1 change: 1 addition & 0 deletions templates/docker-compose.env.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# needs to run.

# Terraform Enterprise settings.
TFE_IMAGE = {{ tfe_image }}
TFE_LICENSE = {{ tfe_license }}
TFE_HOSTNAME = {{ tfe_hostname }}
TFE_ENCRYPTION_PASSWORD = {{ tfe_encryption_password }}
Expand Down

0 comments on commit 72d327c

Please sign in to comment.