adc/ansible/roles/home-net/tasks/main.yml
josiah 7b38b89acb Fuck with ansible layout.
1. Fuck around with Goof configuration. I think ultimately this never
went anywhere, and I'll probably rip it out, but I forgot to commit it
at the time so i'm including it just to be safe.

2. Home services and home net refactor. Smaller clean ups

3. Removal of wg stuff.
2023-07-28 09:47:04 -05:00

82 lines
2.1 KiB
YAML

---
# deploy a halo host
# boot strap server
- name: Install aptitude using apt
apt: name=aptitude state=latest update_cache=yes force_apt_get=yes
- name: Install required system packages for docker install
apt: name={{ item }} state=latest update_cache=yes
loop: [ 'apt-transport-https', 'ca-certificates', 'software-properties-common']
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
- name: Add tailscale GPG apt Key
apt_key:
url: https://pkgs.tailscale.com/stable/debian/bullseye.noarmor.gpg
state: present
- name: Add tailscsale Repository
apt_repository:
repo: deb https://pkgs.tailscale.com/stable/debian bullseye main
state: present
- name: Update apt
apt: update_cache=yes
- name: Install required system packages
apt: name={{ sys_packages }} state=latest
- name: add 'josiah' to docker group
user:
name='josiah'
groups=docker
append=yes
- name: install python packages
pip:
name: ["jsondiff", "docker"]
# init new swarm, set up
- name: Init a new swarm with default parameters
docker_swarm:
state: present
advertise_addr: "100.76.26.36"
- name: copy over awful-All config files
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0777
with_items:
- {src: 'home-compose.yml', dest: '/home/josiah/apps/home-compose.yml'}
# you have to force remove the whole stack for some changes to take effect
# I have no idea which ones, but this solved a problem for me with traefik conifgs + multi networks.
- name: Remove the home-net stack
block:
- name: Remove the home-net stack
docker_stack:
state: absent
name: halo
compose:
- /home/josiah/apps/home-compose
- name: Pause so the network gets deleted too
pause:
seconds: 15
- name: Redpeploy
docker_stack:
state: present
name: home-net
compose:
- /home/josiah/apps/home-compose.yml