This commit is contained in:
Gleb Koval 2023-09-25 20:52:30 +01:00
parent 72a790c038
commit 270560a483
Signed by: cyclane
GPG Key ID: 15E168A8B332382C
4 changed files with 57 additions and 29 deletions

View File

@ -1,5 +1,5 @@
- name: Provision joplin Proxmox VM
hosts: joplin
- name: Provision cloud Proxmox VM
hosts: cloud
connection: ansible.builtin.local
gather_facts: false
vars:

View File

@ -0,0 +1,53 @@
- name: Setup Software
hosts: joplin
gather_facts: false
tasks:
- name: Wait for connection
ansible.builtin.wait_for_connection:
timeout: 300
- name: Install system packages
ansible.builtin.apt:
package: qemu-guest-agent
state: latest
become: true
- name: Install docker
block:
- name: Install dependencies
ansible.builtin.apt:
package:
- curl
- python3-apt
- gpg
state: latest
become: true
- name: Add key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/debian/gpg
become: true
- name: Add repo
ansible.builtin.apt_repository:
update_cache: true
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:
pacakge:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: latest
become: true
- name: Enable docker
ansible.builtin.systemd:
name: docker
state: started
enabled: true
become: true
- name: Enable qemu-guest-agent
ansible.builtin.systemd:
name: qemu-guest-agent
state: started
enabled: true
become: true

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:
managed:
children:
joplin:
cloud:
hosts:
joplin2.srv.home.local.koval.net:
cloud.srv.home.local.koval.net:
vars:
ansible_user: debian
ansible_ssh_private_key_file: ~/.ssh/id_rsa