Needed to modify the nginx configuration to allow streaming of ssh. Using docker compose for this service, will probably migrate all others soon.
72 lines
1.6 KiB
YAML
72 lines
1.6 KiB
YAML
---
|
|
- name: Frontend setup
|
|
hosts: gitea
|
|
|
|
vars:
|
|
username: matt
|
|
nas_host: nas.localdomain
|
|
|
|
mounts:
|
|
gitea_repos:
|
|
local: "/mnt/gitea-repos"
|
|
remote: "/volume1/gitea-repos"
|
|
gitea_backups:
|
|
local: "/mnt/gitea-backups"
|
|
remote: "/volume1/gitea-backups"
|
|
|
|
|
|
|
|
docker_add_repo: true
|
|
docker_users:
|
|
- "{{ username }}"
|
|
|
|
roles:
|
|
- role: geerlingguy.git
|
|
become: true
|
|
- role: geerlingguy.docker
|
|
become: true
|
|
|
|
tasks:
|
|
- name: Create myapp directory in home
|
|
ansible.builtin.file:
|
|
path: "{{ ansible_env.HOME }}/gitea"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Copy the gitea compose file to the host
|
|
ansible.builtin.copy:
|
|
src: gitea/compose.yaml
|
|
dest: "{{ ansible_env.HOME }}/gitea/compose.yaml"
|
|
|
|
# - name: Install NFS client
|
|
# ansible.builtin.apt:
|
|
# name: nfs-common
|
|
# state: present
|
|
# update_cache: true
|
|
# become: true
|
|
|
|
- name: Create mountpoint directories for gitea
|
|
ansible.builtin.file:
|
|
path: "{{ item.value.local }}"
|
|
state: directory
|
|
mode: "0755"
|
|
loop: "{{mounts | dict2items }}"
|
|
become: true
|
|
|
|
- name: Mount an NFS volume for repositories
|
|
ansible.posix.mount:
|
|
src: "nas.localdomain:{{ item.value.remote }}"
|
|
path: "{{ item.value.local }}"
|
|
opts: nfsvers=3,proto=tcp,rw
|
|
state: mounted
|
|
fstype: nfs
|
|
loop: "{{ mounts | dict2items }}"
|
|
become: true
|
|
|
|
|
|
- name: Create and start services
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ ansible_env.HOME }}/gitea/"
|
|
state: present
|
|
|