good start

This commit is contained in:
2023-04-26 15:34:45 +02:00
parent 73f7d667bf
commit 11bda1cc7b
12 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
- mame: Proxmox VM provisioning
community.general.proxmox_kvm:
api_host: "{{ proxmox_host }}"
api_user: "{{ proxmox_user }}"
api_token: "{{ proxmox_token }}"
node: "{{ proxmox_node }}"
name: "{{ item }}"
cores: 6
# 2 * 6 = 12 -> leaving 4 cores for OMV + hypervisor itself
net:
net0: 'virtio,bridge=vmbr1,rate=200'
net1: 'e1000,bridge=vmbr2'
# TODO check me!
sshkeys: "{{ lookup('file', '~/.ssh/default.pub') }}"
ipconfig:
ipconfig0: 'ip=10.0.0.1/24'
sata:
sata0: 'VMs_LVM:10,format=raw'
# automatically boot from fedora iso:
boot: cdn
# first try dist, then cdrom
cdrom: fedora_37_server_x86-64.iso
loop:
- fedora-node-1
- fedora-node-2

View File

View File

@@ -0,0 +1,13 @@
- name: Download k3s install script
get_url:
url: https://get.k3s.io
dest: /tmp/install-k3s.sh
mode: 0755
- name: Create k3s config file
template:
src: ../templates/config.yml.j2
dest: /tmp/config.yml
- name: Execute k3s install script providing a config.yml
shell: /tmp/install-k3s.sh --config /tmp/config.yml server

View File

@@ -0,0 +1,7 @@
disable:
- traefik
- servicelb
cluster-init: "{{ inventory_hostname == groups['fedora-server'][0] }}"
server: "{{ groups['fedora-server'][0] }}"
token: {{ k3s_token }}

View File

@@ -0,0 +1,2 @@
- name: update
include_tasks: update.yml

View File

@@ -0,0 +1,7 @@
- name: Update all installed packages
become: yes
apt:
update_cache: yes
name: '*'
state: latest

View File

@@ -0,0 +1,7 @@
- name: add ssh keys
ansible.posix.authorized_key:
user: "{{ ansible_user }}"
state: present
# copy file present on the controller to the remote host
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html
key: "{{ lookup('file', '~/.ssh/default.pub') }}"

View File

@@ -0,0 +1,2 @@
- name: copy
include_tasks: copy.yml