This repository has been archived on 2023-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
max/playbooks/nucs.yml

62 lines
1.5 KiB
YAML

---
- name: Setup ansible
hosts: nucs
tasks:
- name: Create Ansible directory
file:
path: /ansible
state: directory
- name: Install essential packages
apt:
pkg:
- python3-pip
state: latest
update_cache: true
- name: Install Docker
hosts: nucs
tasks:
- name: Install prerequisites
apt:
pkg:
- ca-certificates
- curl
- gnupg
- lsb-release
state: latest
update_cache: true
- name: Add Docker APT key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
- name: Add Docker repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable # TODO: parameterize distro
- name: Install Docker packages
apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose-plugin
state: latest
update_cache: true
- name: Install Docker module for Python
pip:
name:
- docker
- docker-compose
- name: Install pizzeria static website
hosts: nucs
tasks:
- name: Clone pizzeria repository
git:
repo: https://github.com/pizzapim/pizzeria
dest: /ansible/pizzeria
- name: Start the Docker compose
community.docker.docker_compose:
project_src: /ansible/pizzeria
pull: true
remove_orphans: true
- name: Install Syncthing
hosts: nucs
roles:
- syncthing