mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-opentofu-private.git
synced 2025-10-27 15:53:06 +00:00
[deploy-opentofu]
This commit is contained in:
@ -25,10 +25,37 @@ resource "vaultwarden_organization_collection" "vaultwarden-collection-iac" {
|
|||||||
name = "iac-collection"
|
name = "iac-collection"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
resource "bitwarden_item_login" "administrative-user" {
|
resource "bitwarden_item_login" "administrative-user" {
|
||||||
name = "teste"
|
name = "teste"
|
||||||
username = "teste"
|
username = "teste"
|
||||||
password = "teste"
|
password = "teste"
|
||||||
collection_ids = [vaultwarden_organization_collection.vaultwarden-collection-iac.id]
|
collection_ids = [vaultwarden_organization_collection.vaultwarden-collection-iac.id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
resource "bitwarden_item_secure_note" "hosts-ini" {
|
||||||
|
name = "iac.ansible.hosts.ini"
|
||||||
|
notes = <<EOT
|
||||||
|
${local.hosts_ini}
|
||||||
|
EOT
|
||||||
|
organization_id = vaultwarden_organization.vaultwarden-organization-fenix-iac.id
|
||||||
|
collection_ids = [vaultwarden_organization_collection.vaultwarden-collection-iac.id]
|
||||||
|
reprompt = true
|
||||||
|
}
|
||||||
|
|
||||||
|
locals{
|
||||||
|
|
||||||
|
hosts_ini = <<EOT
|
||||||
|
|
||||||
|
[master]
|
||||||
|
master ansible_host=${var.k8s_vms[0].ip} ansible_user=${var.k8s_vms[0].extra_users[0].name} ansible_ssh_pass=${var.k8s_vms[0].extra_users[0].password}
|
||||||
|
|
||||||
|
[workers]
|
||||||
|
%{ for vm in var.k8s_vms ~}
|
||||||
|
%{ if i != 0 }
|
||||||
|
worker-${replace(vm.ip, ".", "-")} ansible_host=${vm.ip} ansible_user=${vm.extra_users[0].name} ansible_ssh_pass=${vm.extra_users[0].password}
|
||||||
|
%{ endif }
|
||||||
|
%{ endfor }
|
||||||
|
|
||||||
|
EOT
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user