From 8b3d64ceebbfbd7c632e4c6dc6119cc58b403c8c Mon Sep 17 00:00:00 2001 From: Paul Brinkmeier Date: Sat, 3 Sep 2022 04:19:31 +0200 Subject: [PATCH] Split misc.yaml into different files --- ansible/README.md | 15 +++++++++- ansible/misc-docker.yaml | 55 ++++++++++++++++++++++++++++++++++ ansible/misc-sites.yaml | 16 ++++++++++ ansible/misc.yaml | 64 ---------------------------------------- 4 files changed, 85 insertions(+), 65 deletions(-) create mode 100644 ansible/misc-docker.yaml create mode 100644 ansible/misc-sites.yaml diff --git a/ansible/README.md b/ansible/README.md index 10d122a..abbdb0e 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -11,4 +11,17 @@ pip install -r requirements.txt ## `misc.yaml` Server for miscellaneous stuff, e.g. the website. -Expects to have a user `andi` who can `sudo`. \ No newline at end of file +Expects to have a user `andi` who can `sudo`. +Sets up: + +- Some basic packages +- Docker and `docker-compose` (the latter via `pip`) +- Nix multi-user installation + +## `misc-docker.yaml` + +- Deploys Docker configurations from `../docker` + +## `misc-sites.yaml` + +Checks out static sites into `/home/paul/Sites` which is mounted into `/srv` in the Caddy container. diff --git a/ansible/misc-docker.yaml b/ansible/misc-docker.yaml new file mode 100644 index 0000000..a67d6e9 --- /dev/null +++ b/ansible/misc-docker.yaml @@ -0,0 +1,55 @@ +--- +- hosts: misc + tasks: + - name: Upload docker configuration + become: yes + copy: + src: ../docker + dest: /etc/pbri + - name: Create global docker volumes + become: yes + docker_volume: + name: "{{ item.name }}" + state: "{{ item.state }}" + loop: + - name: codi_database + state: present + - name: codi_uploads + state: present + - name: gitlab_data + state: present + - name: gitlab_logs + state: present + - name: gitlab_config + state: present + - name: gitlab_runner_config + state: present + - name: gitlab_runner_cache + state: present + - name: Set up docker stuff + become: yes + docker_compose: + project_src: "/etc/pbri/docker/{{ item.name }}" + state: "{{ item.state }}" + build: yes + debug: yes + loop: + - name: web + state: present + - name: runner + state: present + - name: Add jupyter user with UID 42000 + become: yes + ansible.builtin.user: + name: jupyter + uid: 42000 + state: present + - name: Add Notebooks folder + become: yes + ansible.builtin.file: + path: /home/jupyter/Notebooks + owner: jupyter + group: jupyter + state: directory + mode: 0755 + diff --git a/ansible/misc-sites.yaml b/ansible/misc-sites.yaml new file mode 100644 index 0000000..6be0e77 --- /dev/null +++ b/ansible/misc-sites.yaml @@ -0,0 +1,16 @@ +--- +- hosts: misc + tasks: + - include_role: + name: checkout_static_sites + vars: + checkout_static_sites: + checkouts: + - path: /home/paul/Sites/pbrinkmeier.de + url: https://git.pbrinkmeier.de/paul/pbrinkmeier.de + commit: 680ac7d9c44752f57436d0ecb9c8018205a5fc0f + owner: paul + - path: /home/paul/Sites/tichy.click + url: https://github.com/pbrinkmeier/tichy-clicker + commit: 7dfb14183c765e3661fda84a7e89c2f73ca86f26 + owner: paul diff --git a/ansible/misc.yaml b/ansible/misc.yaml index 7772fa8..4e8e2d6 100644 --- a/ansible/misc.yaml +++ b/ansible/misc.yaml @@ -30,67 +30,3 @@ - docker - docker-compose - requests - - name: Upload docker configuration - become: yes - copy: - src: ../docker - dest: /etc/pbri - - name: Create global docker volumes - become: yes - docker_volume: - name: "{{ item.name }}" - state: "{{ item.state }}" - loop: - - name: codi_database - state: present - - name: codi_uploads - state: present - - name: gitlab_data - state: present - - name: gitlab_logs - state: present - - name: gitlab_config - state: present - - name: gitlab_runner_config - state: present - - name: gitlab_runner_cache - state: present - - name: Set up docker stuff - become: yes - docker_compose: - project_src: "/etc/pbri/docker/{{ item.name }}" - state: "{{ item.state }}" - build: yes - debug: yes - loop: - - name: web - state: present - - name: runner - state: present - - include_role: - name: checkout_static_sites - vars: - checkout_static_sites: - checkouts: - - path: /home/paul/Sites/pbrinkmeier.de - url: https://git.pbrinkmeier.de/paul/pbrinkmeier.de - commit: 680ac7d9c44752f57436d0ecb9c8018205a5fc0f - owner: paul - - path: /home/paul/Sites/tichy.click - url: https://github.com/pbrinkmeier/tichy-clicker - commit: 7dfb14183c765e3661fda84a7e89c2f73ca86f26 - owner: paul - - name: Add jupyter user with UID 42000 - become: yes - ansible.builtin.user: - name: jupyter - uid: 42000 - state: present - - name: Add Notebooks folder - become: yes - ansible.builtin.file: - path: /home/jupyter/Notebooks - owner: jupyter - group: jupyter - state: directory - mode: 0755