Skip to content

Commit

Permalink
Changes 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
x86-39 committed Dec 29, 2023
1 parent d1def95 commit 0288c6b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
stages:
- deploy

upload:
stage: deploy
image: curlimages/curl:latest
variables:
TERRAFORM_MODULE_DIR: ${CI_PROJECT_DIR} # The relative path to the root directory of the Terraform project.
TERRAFORM_MODULE_NAME: ${CI_PROJECT_NAME} # The name of your Terraform module, must not have any spaces or underscores (will be translated to hyphens).
TERRAFORM_MODULE_SYSTEM: libvirt # The system or provider your Terraform module targets (ex. local, aws, google).
TERRAFORM_MODULE_VERSION: ${CI_COMMIT_TAG} # The version - it's recommended to follow SemVer for Terraform Module Versioning.
script:
- TERRAFORM_MODULE_NAME=$(echo "${TERRAFORM_MODULE_NAME}" | tr " _" -) # module-name must not have spaces or underscores, so translate them to hyphens
- tar -vczf /tmp/${TERRAFORM_MODULE_NAME}-${TERRAFORM_MODULE_SYSTEM}-${TERRAFORM_MODULE_VERSION}.tgz -C ${TERRAFORM_MODULE_DIR} --exclude=./.git .
- 'curl --fail-with-body --location --header "JOB-TOKEN: ${CI_JOB_TOKEN}"
--upload-file /tmp/${TERRAFORM_MODULE_NAME}-${TERRAFORM_MODULE_SYSTEM}-${TERRAFORM_MODULE_VERSION}.tgz
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/terraform/modules/${TERRAFORM_MODULE_NAME}/${TERRAFORM_MODULE_SYSTEM}/${TERRAFORM_MODULE_VERSION}/file'
rules:
- if: $CI_COMMIT_TAG
15 changes: 15 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
output "primary_ipv4_address" {
value = var.network_interface[0].primary_ipv4_address
}

output "server_name" {
value = var.hostname
}

output "server_domain" {
value = var.domain
}

output "server_id" {
value = var.hostname
}
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ variable "ansible_host" {
variable "ansible_user" {
type = string
default = "root"
nullable = false
}

variable "ansible_ssh_pass" {
Expand All @@ -161,4 +162,5 @@ variable "ansible_groups" {
default = [
"libvirt",
]
nullable = false
}

0 comments on commit 0288c6b

Please sign in to comment.