Compare commits

14 Commits

Author SHA1 Message Date
00cad09f37 become root for filesystem
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 4m23s
2023-09-26 00:23:05 +01:00
d005032c97 create data filesystem
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 3m29s
2023-09-26 00:15:19 +01:00
69e609d522 mount partition
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 3m30s
2023-09-25 23:54:41 +01:00
46303021f5 fix parted
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 3m24s
2023-09-25 23:48:06 +01:00
2506402fae logging :)
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 3m23s
2023-09-25 23:39:20 +01:00
51a0ca3938 fix playbook
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 2m38s
2023-09-25 23:30:22 +01:00
e1c0eb6265 data disk
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 2m52s
2023-09-25 23:23:58 +01:00
2bba6dfa85 rename 0002
Some checks reported warnings
Infrastructure / Check and run Ansbile playbooks (pull_request) Has been cancelled
2023-09-25 22:51:05 +01:00
04e660c838 fix cloud playbooks
All checks were successful
Infrastructure / Check and run Ansbile playbooks (pull_request) Successful in 6m3s
2023-09-25 22:30:52 +01:00
97995a95dd fix keyring
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 6m33s
2023-09-25 22:12:03 +01:00
f75abf978a always update cache
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 6m13s
2023-09-25 21:57:43 +01:00
0a479039e2 separate playbooks
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 6m14s
2023-09-25 21:48:29 +01:00
edbd1cd9f9 update hosts target 0001
Some checks failed
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 2m25s
2023-09-25 21:01:50 +01:00
72d3bded74 cloud-vm
All checks were successful
Infrastructure / Check and run Ansbile playbooks (pull_request) Successful in 4m47s
2023-09-25 20:54:51 +01:00
7 changed files with 108 additions and 34 deletions

View File

@@ -72,4 +72,4 @@ jobs:
PROXMOX_TOKEN_ID: ${{ secrets.PROXMOX_TOKEN_ID }} PROXMOX_TOKEN_ID: ${{ secrets.PROXMOX_TOKEN_ID }}
PROXMOX_TOKEN_SECRET: ${{ secrets.PROXMOX_TOKEN_SECRET }} PROXMOX_TOKEN_SECRET: ${{ secrets.PROXMOX_TOKEN_SECRET }}
SSH_PUBLIC: ${{ secrets.SSH_PUBLIC }} SSH_PUBLIC: ${{ secrets.SSH_PUBLIC }}
run: ansible-playbook --inventory ./inventory ${{ steps.playbooks.outputs.to_run }} run: ansible-playbook --inventory ./inventory ${{ steps.playbooks.outputs.to_run }} -vv

View File

@@ -1,5 +1,5 @@
- name: Provision joplin Proxmox VM - name: Provision cloud Proxmox VM
hosts: joplin hosts: cloud
connection: ansible.builtin.local connection: ansible.builtin.local
gather_facts: false gather_facts: false
vars: vars:
@@ -77,16 +77,22 @@
community.general.proxmox_kvm: community.general.proxmox_kvm:
state: started state: started
register: start register: start
- name: Wait 3 min # Initial apt update, apt upgrade, cloud-init - name: Wait 1 min # Initial apt update, apt upgrade, cloud-init
ansible.builtin.wait_for: ansible.builtin.wait_for:
timeout: 180 timeout: 60
# VM Configuration # VM Configuration
- name: Resize disk - name: Resize root disk
community.general.proxmox_disk: community.general.proxmox_disk:
disk: scsi0 disk: scsi0
size: 64G size: 16
state: resized state: resized
- name: Create data disk
community.general.proxmox_disk:
disk: scsi1
backup: true
storage: nvme
size: 2048
- name: Update VM - name: Update VM
community.general.proxmox_kvm: community.general.proxmox_kvm:
update: true update: true

View File

@@ -0,0 +1,47 @@
- name: Initialise VM
hosts: cloud
gather_facts: false
tasks:
- name: Wait for connection
ansible.builtin.wait_for_connection:
timeout: 300
- name: Install system packages
ansible.builtin.apt:
update_cache: true
pkg:
- qemu-guest-agent
- parted
become: true
- name: Enable qemu-guest-agent
ansible.builtin.systemd:
name: qemu-guest-agent
state: started
enabled: true
become: true
- name: Create data partition
community.general.parted:
device: /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:1
label: gpt
name: data
number: 1
state: present
become: true
- name: Create data filesystem
community.general.filesystem:
dev: /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:1-part1
fstype: ext4
become: true
- name: Mount data partition
ansible.posix.mount:
src: /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:1-part1
path: /mnt/data
fstype: ext4
state: mounted
become: true
- name: Set data partition permissions
ansible.builtin.file:
path: /mnt/data
owner: debian
group: debian
become: true

View File

@@ -0,0 +1,46 @@
- name: Install software
hosts: cloud
gather_facts: false
tasks:
- name: Wait for connection
ansible.builtin.wait_for_connection:
timeout: 300
- name: Install dependencies
ansible.builtin.apt:
update_cache: true
pkg:
- curl
- python3-apt
- gpg
become: true
- name: Add docker key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/debian/gpg
keyring: /etc/apt/keyrings/docker.gpg
become: true
- name: Add docker repo
ansible.builtin.apt_repository:
repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable
become: true
- name: Install docker
ansible.builtin.apt:
update_cache: true
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
become: true
- name: Enable docker
ansible.builtin.systemd:
name: docker
state: started
enabled: true
become: true
- name: Add user to docker group
ansible.builtin.user:
user: debian
groups:
- docker
append: true

View File

View File

@@ -1,25 +0,0 @@
- name: Setup Software
hosts: joplin
gather_facts: false
tasks:
- name: Wait for connection
ansible.builtin.wait_for_connection:
timeout: 300
- name: Test some stuff
ansible.builtin.shell: |
touch ~/hmm
echo test > ~/test
echo test2 >> ~/test
mkdir ~/dir
touch ~/dir/testing
- name: Install some stuff
ansible.builtin.apt:
update_cache: true
name: qemu-guest-agent
become: true
- name: Enable some stuff
ansible.builtin.systemd:
name: qemu-guest-agent
state: started
enabled: true
become: true

View File

@@ -8,9 +8,9 @@ proxmox:
pve2.mgmt.home.local.koval.net: pve2.mgmt.home.local.koval.net:
managed: managed:
children: children:
joplin: cloud:
hosts: hosts:
joplin2.srv.home.local.koval.net: cloud.srv.home.local.koval.net:
vars: vars:
ansible_user: debian ansible_user: debian
ansible_ssh_private_key_file: ~/.ssh/id_rsa ansible_ssh_private_key_file: ~/.ssh/id_rsa