Move playbooks to playbooks folder

This commit is contained in:
2022-09-15 04:56:14 +02:00
parent 39a18a603d
commit a86b3e6a43
5 changed files with 2 additions and 1 deletions
+8
View File
@@ -0,0 +1,8 @@
# All tasks for misc, use this to check whether everything is deployed.
---
- name: Set up basic packages, Docker, Nix, sshd
import_playbook: misc-setup.yaml
- name: Deploy Docker configuration
import_playbook: misc-docker.yaml
- name: Check out static websites from git
import_playbook: misc-sites.yaml
+64
View File
@@ -0,0 +1,64 @@
---
- hosts: misc
tasks:
- name: Add users for running containers
become: yes
ansible.builtin.user:
name: "{{ item.name }}"
uid: "{{ item.uid }}"
create_home: no
state: present
loop:
- name: jupyter
uid: 42000
state: present
- name: gitea
uid: 42001
state: present
# All services that are behind Caddy need to be in this network
- name: Create Caddy network
become: yes
docker_network:
name: caddy-network
state: present
- name: Upload docker configuration
become: yes
copy:
src: ../../docker
dest: /etc/pbri
# Files should inaccessible to non-root users.
mode: u=rw,g=,o=
# Directories should be listable
directory_mode: u=rwx,g=rx,o=rx
- name: Create directory for docker volumes
become: yes
file:
path: /var/lib/pbri/docker
state: directory
# Hide contents from non-root users
mode: u=rwx,g=,o=
- 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: caddy
state: present
- name: gitea
state: present
- name: drone
state: present
- name: codi
state: present
- name: Add Notebooks folder
become: yes
ansible.builtin.file:
path: /home/jupyter/Notebooks
owner: jupyter
group: jupyter
state: directory
mode: 0755
+52
View File
@@ -0,0 +1,52 @@
---
- hosts: misc
tasks:
- name: Install basic packages
become: yes
apt:
name:
- vim
- git
- htop
- tmux
update_cache: yes
tags:
- apt
- include_role:
name: docker
- include_role:
name: install_nix
- name: Install pip prerequisites
become: yes
apt:
name:
- python3-pip
- python3-setuptools
- python3-virtualenv
- name: Install global python docker package
become: yes
pip:
name:
- docker
- docker-compose
- requests
- name: Configure sshd
register: sshdconfig
become: yes
copy:
dest: /etc/ssh/sshd_config.d/00_pbri.conf
mode: u=rw,g=r,o=r
# Included by /etc/ssh/sshd_config before other configuration
content: |
Port 2309
PermitRootLogin no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
validate: /usr/sbin/sshd -T -f %s
- name: Restart sshd
when: sshdconfig.changed
become: yes
service:
name: sshd
state: restarted
+16
View File
@@ -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