Compare commits
No commits in common. "995e99c1e6efe14e1cf262002a481c5fe23e40a1" and "8c793d3d5949afe00576d2bd7adab7a9ce175762" have entirely different histories.
995e99c1e6
...
8c793d3d59
@ -1,22 +0,0 @@
|
||||
---
|
||||
- name: Deploy a Terraform infrastructure
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
|
||||
- name: Create a VM
|
||||
cloud.terraform.terraform:
|
||||
project_path: /home/vez/homelab/terraform/projects/terransible
|
||||
state: present
|
||||
register: tf_return
|
||||
|
||||
- name: Refresh inventory
|
||||
ansible.builtin.meta: refresh_inventory
|
||||
|
||||
- name: Ping
|
||||
hosts: servers
|
||||
gather_facts: false
|
||||
tasks:
|
||||
|
||||
- name: Ping the host group
|
||||
ansible.builtin.ping:
|
@ -1,4 +0,0 @@
|
||||
---
|
||||
plugin: cloud.terraform.terraform_provider
|
||||
project_path:
|
||||
- /home/vez/homelab/terraform/projects/terransible
|
@ -1,24 +0,0 @@
|
||||
module "pve_vm" {
|
||||
source = "../../modules/pve_vm"
|
||||
node_name = "zenith"
|
||||
vm_name = "zenith-vm"
|
||||
vm_cpu = 2
|
||||
vm_ram = 2048
|
||||
vm_vlan = 66
|
||||
}
|
||||
|
||||
output "vm_ip" {
|
||||
value = module.pve_vm.vm_ip
|
||||
}
|
||||
|
||||
resource "ansible_group" "servers" {
|
||||
name = "servers"
|
||||
}
|
||||
resource "ansible_host" "vm" {
|
||||
name = "zenith-vm.lab.vezpi.me"
|
||||
groups = ["servers"]
|
||||
variables = {
|
||||
ansible_host = module.pve_vm.vm_ip
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "bpg/proxmox"
|
||||
}
|
||||
ansible = {
|
||||
source = "ansible/ansible"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "proxmox" {
|
||||
endpoint = var.proxmox_endpoint
|
||||
api_token = var.proxmox_api_token
|
||||
insecure = false
|
||||
ssh {
|
||||
agent = false
|
||||
private_key = file("~/.ssh/id_ed25519")
|
||||
username = "root"
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
variable "proxmox_endpoint" {
|
||||
description = "Proxmox URL endpoint"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "proxmox_api_token" {
|
||||
description = "Proxmox API token"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user