restrucure

This commit is contained in:
Pim Kunis 2023-03-17 09:27:52 +01:00
parent e1cf88ad73
commit 3544581bde
6 changed files with 17 additions and 3 deletions

6
ansible/ansible.cfg Normal file
View file

@ -0,0 +1,6 @@
[defaults]
inventory=inventory
interpreter_python=/usr/bin/python3
[diff]
always = True

View file

@ -50,7 +50,7 @@ resource "libvirt_domain" "ubuntu" {
cloudinit = libvirt_cloudinit_disk.cloudinit.id
provisioner "local-exec" {
command = "ansible-playbook -e internal_ip=${var.internal_ip} -T 60 -u root -i inventory hermes.yml"
command = "ansible-playbook -e internal_ip=${var.internal_ip} -T 60 -u root -i ${var.ansible_inventory} ${var.ansible_playbook}"
environment = {
ANSIBLE_HOST_KEY_CHECKING = "False"

View file

@ -3,15 +3,23 @@ variable "name" {
}
variable "libvirt_endpoint" {
type = string
type = string
default = "qemu+ssh://root@atlas.lan/system"
}
variable "host_public_key" {
type = string
type = string
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOodpLr+FDRyKyHjucHizNLVFHZ5AQmE9GmxMnOsSoaw pimkunis@thinkpadpim"
}
variable "internal_ip" {
default = "192.168.30.7"
}
variable "ansible_inventory" {
default = "ansible/inventory"
}
variable "ansible_playbook" {
default = "ansible/hermes.yml"
}