make everything more configurable

This commit is contained in:
hybris 2019-01-22 15:28:46 +01:00
parent ad8e3cc155
commit 0482b34923
6 changed files with 63 additions and 16 deletions

View file

@ -2,10 +2,10 @@
users:
- name: {{ remote_user }}
lock-passwd: false
passwd: $1$tG6Uv4$BPCIRF6RFuLrJ.lQO1GB8.
passwd: {{ remote_user_pass }}
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDXh0iMMtbTEhRSgIbgCunAuE+Q1iKycRVRBYWDCQ45xE8nHsg7K98fdv6LqQwkTqlojEHKp2/TPawk8V6w3MTgOHXi/WO9FyvhMjUcfdxTvny1z3Pj1j0NglKjyQ3t30snwOBYJiC2qDDtvRYNJs+Re/aSdVbygOHMf0UqCyP8DL7Tcj5sNPgnleEC7jE+YNbyDJo2KtNFXy3+AMbwa742D5Ygi5FqaBO090gVQfb3hbnZLw9CNSK7vjo7k5hJo8d1kcPDth1Vo12IDejL8Al3ArfGSy5IqYXs8Stj4YVRW+78AOpQZiInCaFybqjsGG+5tezrXHrxhjJPHuSCuXk9vxkcUk7aC5eSDqoCP7RTB+iQCPJ1ZvkVbaebExZGgHpD9t2Xo2bd/3BRagIxPTzKo9q4+qCCClhWR4iUSOr/YKAZBFDdoVWg2IMqbUHzvHX7TE7I8hbAdg6CpgwBoJm8OWmfjkDU6aYnF8z9l36VV7xjvvuYbOrhpCJ9LGFSfmG3wswo8OH4XyRSHd3y7qrSYIGujtymrzozXo2MrMU3Rj2bW5MIEZSxleIVje4PHWOfZwwn3hwvqM/nyknzfNwPCidTsP3Q2FwfBtZYo1cIXH41bzjs4Bxb8+KJqwTcerzB1pT4qsoPnoYW0fnZE7NHVNhfNx53LdctclFerHTLMw== hybris@sparks
- {{ remote_user_ssh_pubkey }}
write_files:
- content: |
#!/bin/bash

View file

@ -1,6 +1,6 @@
resource "libvirt_cloudinit_disk" "cloud-init-{{ item.hostname }}" {
name = "cloud-init-{{ item.hostname }}.iso"
pool = "kubernetes"
pool = "{{ libvirt_storage_pool }}"
user_data = "${data.template_file.user-data-{{ item.hostname }}.rendered}"
}
@ -8,17 +8,17 @@ data "template_file" "user-data-{{ item.hostname }}" {
template = "${file("${path.module}/{{ item.hostname }}.cloud_init.cfg")}"
}
resource "libvirt_volume" "centos-7-generic-{{ item.hostname }}" {
name = "centos-7-generic-{{ item.hostname }}"
source = "CentOS-7-x86_64-GenericCloud.qcow2"
pool = "kubernetes"
resource "libvirt_volume" "{{ item.hostname }}" {
name = "{{ item.hostname }}"
source = "{{ source_cloud_image_name }}"
pool = "{{ libvirt_storage_pool }}"
format = "qcow2"
}
resource "libvirt_domain" "domain-{{ item.hostname }}" {
name = "{{ item.hostname }}"
memory = "1024"
vcpu = 1
memory = "{{ item.memory }}"
vcpu = "{{ item.vcpu }}"
cloudinit = "${libvirt_cloudinit_disk.cloud-init-{{ item.hostname }}.id}"
@ -35,7 +35,7 @@ resource "libvirt_domain" "domain-{{ item.hostname }}" {
}
network_interface {
bridge = "home-lan"
bridge = "{{ libvirt_network_bridge }}"
mac = "{{ item.mac_address }}"
}
@ -44,7 +44,7 @@ resource "libvirt_domain" "domain-{{ item.hostname }}" {
}
disk {
volume_id = "${libvirt_volume.centos-7-generic-{{ item.hostname }}.id}"
volume_id = "${libvirt_volume.{{ item.hostname }}.id}"
}
graphics {

View file

@ -1,3 +1,3 @@
provider "libvirt" {
uri = "qemu+ssh://[2001:470:6d:22c:1::1]/system?socket=/var/run/libvirt/libvirt-sock"
uri = "qemu+ssh://{{ libvirt_host }}/system?socket=/var/run/libvirt/libvirt-sock"
}