Skip to content

Instantly share code, notes, and snippets.

View github-somerandomguy-xyz's full-sized avatar

github-somerandomguy-xyz

View GitHub Profile
@github-somerandomguy-xyz
github-somerandomguy-xyz / main.yml
Last active April 27, 2020 18:39
/role/terraform-libvirt-provider/defaults/main.yml
---
#@#https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz
go_version: 1.14.1
go_download_url: "https://dl.google.com/go/go{{ go_version }}.linux-amd64.tar.gz"
terraform_provider_libvirt: github.com/dmacvicar/terraform-provider-libvirt
terraform_plugin_dir: "{{remote_home_dir}}/.terraform.d/plugins/"
go_libvirt_plugin_dir: "{{remote_home_dir}}/go/bin/terraform-provider-libvirt"
@github-somerandomguy-xyz
github-somerandomguy-xyz / main.yml
Last active April 27, 2020 18:04
role/terraform/defaults/main.yml
---
#@https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zip
terraform_version: 0.12.24
terraform_download_url: "https://releases.hashicorp.com/terraform/{{ terraform_version }}/terraform_{{ terraform_version }}_linux_amd64.zip"
---
- name: make a project directory for the terraform
file:
path: "{{remote_home_dir}}/{{terraform_project}}"
state: directory
owner: "{{ansible_user}}"
group: "{{ansible_user}}"
- name: copy terraform project files to the remote terraform directory
@github-somerandomguy-xyz
github-somerandomguy-xyz / debian.yml
Created April 20, 2020 17:37
install terraform-libvirsh-provider
---
- name: download golang tar
get_url:
url: "{{ go_download_url }}"
dest: /tmp/
mode: 0440
become: yes
- name: remove old installation of go
file:
@github-somerandomguy-xyz
github-somerandomguy-xyz / debian.yml
Last active April 20, 2020 17:34
install terraform
---
- name: Ensure required packages are available.
package:
name:
- unzip
state: present
- name: "Download terraform {{ terraform_version }} binary."
get_url:
url: "{{ terraform_download_url }}"
@github-somerandomguy-xyz
github-somerandomguy-xyz / main.yml
Created April 16, 2020 10:09
main task for the kvm role
---
- name: include kvm debian
import_tasks: debian.yml
tags:
- kvm
@github-somerandomguy-xyz
github-somerandomguy-xyz / debian.yml
Created April 14, 2020 07:42
complete kvm role
---
- name: install kvm packages on Debian
package:
name:
- bridge-utils
- genisoimage
- libguestfs-tools
- libnss-libvirt
- libosinfo-bin
- libvirt-clients
---
- hosts: host-servers
remote_user: "{{ ansible_user }}"
become: no
roles:
- { role: common, tags: [ 'common' ] }
- { role: kvm, tags: [ 'kvm' ] }
@github-somerandomguy-xyz
github-somerandomguy-xyz / main.yml
Created April 13, 2020 19:49
roles/kvm/defaults/main.yml
---
libvirt_folder: "/var/lib/libvirt/"
image_pool_dir: "/var/lib/libvirt/"
image_pool_name: "images2"
#change the uri to "qemu:///system" would execute the virt_pool module as a root even if the remote_user/become_user in ansible is set to a non root user.
libvirt_uri: "qemu:///session"
@github-somerandomguy-xyz
github-somerandomguy-xyz / main.yml
Created April 11, 2020 07:37
role starting point
---
- name: include common debian
import_tasks: debian.yml
tags:
- common