Since we can't look into the variable `pythoncheck.rc`, as it doesn't exist, we skip the `when` check for checkmode -- its installation cannot run under any circumstance in the mode anyways.
98 lines
2.4 KiB
YAML
98 lines
2.4 KiB
YAML
---
|
|
# TODO: Add to bootstrapping role / make less dependent on apt-get & debian (python3)
|
|
- name: Bootstrap python everywhere
|
|
hosts: all
|
|
gather_facts: False
|
|
become: true
|
|
tags:
|
|
- system
|
|
- bootstrap
|
|
tasks:
|
|
- name: check for python
|
|
ansible.builtin.raw: python3 --version
|
|
changed_when: false
|
|
failed_when: false
|
|
register: pythoncheck
|
|
- name: install debian python
|
|
ansible.builtin.raw: apt-get update && apt-get install python3 -y
|
|
when: not ansible_check_mode and pythoncheck.rc == 127
|
|
- name: pretend installing debian python for check mode
|
|
ansible.builtin.debug:
|
|
msg: Pretending to install python...
|
|
when: ansible_check_mode
|
|
|
|
- name: Prepare incus server host
|
|
hosts: host_system
|
|
tasks:
|
|
- name: Prepare host filesystems
|
|
ansible.builtin.import_role:
|
|
name: filesystem
|
|
tags: filesystem
|
|
|
|
- name: Prepare system
|
|
ansible.builtin.import_role:
|
|
name: system
|
|
tags: system
|
|
|
|
- name: Set up incus
|
|
ansible.builtin.import_role:
|
|
name: incus-install
|
|
tags: incus
|
|
|
|
- name: Set up nfs shares
|
|
ansible.builtin.import_role:
|
|
name: nfs
|
|
tags: nfs
|
|
|
|
# FIXME: Role needs much fixup before it can run
|
|
# - name: Prepare incus
|
|
# ansible.builtin.import_role:
|
|
# name: incus-install
|
|
# tags: incus
|
|
|
|
# ansible-galaxy install geerlingguy.docker
|
|
- name: Install docker
|
|
hosts: instance_system
|
|
tags: docker
|
|
tasks:
|
|
- name: Install docker and docker compose
|
|
ansible.builtin.import_role:
|
|
name: geerlingguy.docker
|
|
|
|
- name: Install docker python requirements
|
|
ansible.builtin.package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
loop:
|
|
- python3-yaml # for docker compose_v2
|
|
- python3-requests # for docker network
|
|
|
|
- name: Prepare all docker hosted containers
|
|
gather_facts: True
|
|
hosts: instance_system
|
|
tags:
|
|
- containers
|
|
tasks:
|
|
- name: Set up Caddy stack
|
|
ansible.builtin.import_role:
|
|
name: caddy
|
|
tags: caddy
|
|
|
|
- name: Set up Restic stack
|
|
ansible.builtin.import_role:
|
|
name: restic
|
|
|
|
- name: Set up Arr stack
|
|
ansible.builtin.import_role:
|
|
name: arr
|
|
tags: arr
|
|
|
|
- name: Set up Paperless stack
|
|
ansible.builtin.import_role:
|
|
name: paperless
|
|
tags: paperless
|
|
|
|
- name: Set up Grocy stack
|
|
ansible.builtin.import_role:
|
|
name: grocy
|
|
tags: grocy
|