-
Notifications
You must be signed in to change notification settings - Fork 5
/
homepage.yml
73 lines (62 loc) · 1.92 KB
/
homepage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
- hosts: homelab
vars:
application: homepage
docker_network: "{{ networks.pub }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0771"
tags:
- config
- name: Create icons folder
ansible.builtin.file:
path: "{{ homepage_icons_remote_dir }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0771"
- name: Synchronise config
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ config_directory }}/config/{{ item | basename | regex_replace('\\.j2$', '') }}"
mode: "0664"
owner: "{{ common_user }}"
group: "{{ common_group }}"
with_fileglob:
- "{{ files_directory }}/config/*"
tags:
- config
- name: Copy icons
ansible.builtin.copy:
src: "{{ files_directory }}/icons/"
dest: "{{ homepage_icons_remote_dir }}/"
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0775"
notify: Restart
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: ghcr.io/gethomepage/homepage:v0.9.12
ipv4_address: "{{ docker_network.prefix }}.251"
volumes:
- "{{ config_directory }}/config:/app/config"
- "{{ homepage_icons_remote_dir }}:/app/public/icons"
- "{{ common_directory_storage }}:{{ common_directory_storage }}:ro"
- /var/run/docker.sock:/var/run/docker.sock:ro
traefik:
- port: 3000
rule: Host(`{{ common_tld }}`)