Skip to content

Commit

Permalink
add forgejo
Browse files Browse the repository at this point in the history
  • Loading branch information
artyorsh committed Nov 16, 2024
1 parent f3bda59 commit 0c449a6
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 54 deletions.
4 changes: 2 additions & 2 deletions host_vars/github_ci/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ authelia_port: 3019
duplicati_docker_settings: "{{ docker_bridge_network_settings }}"
duplicati_port: 3009

filebrowser_docker_settings: "{{ docker_bridge_network_settings }}"
filebrowser_port: 3010
forgejo_docker_settings: "{{ docker_bridge_network_settings }}"
forgejo_webui_port: 3010

glances_docker_settings: "{{ docker_host_network_settings }}"
glances_webui_port: 61208
Expand Down
4 changes: 0 additions & 4 deletions playbook-github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
tags:
- "docker"

- role: "storage"
tags:
- "storage"

- role: "monitoring"
tags:
- "monitoring"
Expand Down
25 changes: 21 additions & 4 deletions playbook-pi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@

pre_tasks:
- ansible.builtin.import_tasks: "tasks/docker-registry-login.yml"
tags:
- "docker"

- ansible.builtin.import_tasks: "tasks/mount-smb-share.yml"
vars:
src: "{{ smb_share_base_url }}"
path: "{{ smb_share_local_dir }}"
tags:
- "media"
- "duplicati"

- ansible.builtin.import_tasks: "tasks/mount-smb-share.yml"
vars:
src: "{{ smb_share_base_url }}/repositories"
path: "{{ forgejo_repositories_dir }}"
tags:
- "forgejo"

roles:
- role: "system"
Expand Down Expand Up @@ -33,10 +50,6 @@
tags:
- "wireguard"

- role: "storage"
tags:
- "storage"

- role: "artyorsh.yams.yams"
tags:
- "media"
Expand Down Expand Up @@ -75,6 +88,10 @@
tags:
- "wallos"

- role: "artyorsh.selfhosted.forgejo"
tags:
- "forgejo"

- role: "artyorsh.selfhosted.authelia"
vars:
authelia_version: "4.38.9"
Expand Down
4 changes: 0 additions & 4 deletions roles/storage/defaults/main.yml

This file was deleted.

8 changes: 0 additions & 8 deletions roles/storage/tasks/main.yml

This file was deleted.

30 changes: 0 additions & 30 deletions roles/storage/tasks/smb.yml

This file was deleted.

2 changes: 0 additions & 2 deletions roles/storage/templates/smb-credentials.j2

This file was deleted.

34 changes: 34 additions & 0 deletions tasks/mount-smb-share.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
- name: "Prepare task variables"
block:
- ansible.builtin.set_fact:
smb_share_credentials_file: "/home/{{ system_user.name }}/.smb"
- ansible.builtin.set_fact:
smb_share_default_mount_opts: "credentials={{ smb_share_credentials_file }},uid={{ system_user.uid }},gid={{ system_user.gid }},file_mode=0740,dir_mode=0740,sec=ntlmv2,x-systemd.automount"

- name: "Ensure mount directory exists"
ansible.builtin.file:
path: "{{ path }}"
owner: "{{ system_user.name }}"
group: "{{ system_user.group }}"
mode: "{{ mode | default('0740') }}"
state: "directory"

- name: "Create credentials file"
ansible.builtin.copy:
content: |
username={{ smb_share_user.name }}
password={{ smb_share_user.password }}
dest: "{{ smb_share_credentials_file }}"
owner: "{{ system_user.name }}"
group: "{{ system_user.group }}"
mode: "0440"

- name: "Mount SMB share"
ansible.posix.mount:
boot: true
src: "{{ src }}"
path: "{{ path }}"
state: "mounted"
fstype: "cifs"
opts: "{{ opts | default(smb_share_default_mount_opts) }}"

0 comments on commit 0c449a6

Please sign in to comment.