aboutsummaryrefslogtreecommitdiffstats
path: root/terraform/ansible.tf
diff options
context:
space:
mode:
authorColin Wilk <colin.wilk@tum.de>2023-06-01 19:12:30 +0200
committerColin Wilk <colin.wilk@tum.de>2023-06-01 19:12:30 +0200
commit1ff00c5658839a640bae5831103b02b513c224f5 (patch)
tree90776d158ebb49a4680d7c9477ccb5afd641afa6 /terraform/ansible.tf
parentce047c36fe9137fd222f7ae9dc498434794558f1 (diff)
downloadterraform-github-1ff00c5658839a640bae5831103b02b513c224f5.tar.gz
terraform-github-1ff00c5658839a640bae5831103b02b513c224f5.zip
Move terraform config into own subdirectory
Signed-off-by: Colin Wilk <colin.wilk@tum.de>
Diffstat (limited to 'terraform/ansible.tf')
-rw-r--r--terraform/ansible.tf56
1 files changed, 56 insertions, 0 deletions
diff --git a/terraform/ansible.tf b/terraform/ansible.tf
new file mode 100644
index 0000000..7ea0701
--- /dev/null
+++ b/terraform/ansible.tf
@@ -0,0 +1,56 @@
+resource "github_repository" "ansible" {
+ for_each = { for idx, repo in var.repos : idx => repo }
+
+ name = "ansible-role-${each.value.name}"
+ description = each.value.description
+ topics = each.value.topics
+ homepage_url = each.value.homepage_url
+ visibility = each.value.visibility
+ archived = each.value.archived
+
+ has_discussions = false
+ has_issues = true
+ allow_merge_commit = false
+ archive_on_destroy = true
+ vulnerability_alerts = true
+}
+
+resource "github_actions_secret" "example_secret" {
+ for_each = { for idx, repo in var.repos : idx => repo if repo.galaxy }
+
+ repository = "ansible-role-${each.value.name}"
+ secret_name = "GALAXY_API_KEY"
+ plaintext_value = var.galaxy_api_key
+}
+
+variable "repos" {
+ type = list(object({
+ name = string
+ description = string
+ topics = list(string)
+ homepage_url = string
+ visibility = string
+ galaxy = bool
+ archived = bool
+ }))
+ default = [
+ {
+ name = "prometheus-target"
+ description = "Ansible role for pushing targets to prometheus instance"
+ topics = ["ansible", "role", "galaxy", "prometheus", "monitoring", "metrics", "prometheus-exporter", "node-exporter"]
+ homepage_url = "https://galaxy.ansible.com/kliwniloc/prometheus_target"
+ visibility = "public"
+ galaxy = true
+ archived = false
+ },
+ {
+ name = "borgbackup"
+ description = "Ansible role for deploying borgbackup on client and server"
+ topics = ["ansible", "role", "galaxy", "backup", "borgbackup"]
+ homepage_url = "https://galaxy.ansible.com/kliwniloc/borgbackup"
+ visibility = "private"
+ galaxy = false
+ archived = false
+ },
+ ]
+}