File tree 10 files changed +487
-0
lines changed
website/docs/applications/system-tools
10 files changed +487
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ If you have a spare domain name you can configure applications to be accessible
18
18
## Available Applications
19
19
20
20
* [ Airsonic] ( https://airsonic.github.io/ ) - catalog and stream music
21
+ * [ Apcupsd] ( http://www.apcupsd.org/ ) - A daemon for controlling APC UPSes
21
22
* [ Bazarr] ( https://github.com/morpheus65535/bazarr ) - companion to Radarr and Sonarr for downloading subtitles
22
23
* [ Bitwarden] ( https://github.com/dani-garcia/vaultwarden ) - Password Manger (Technically Vaultwarden, a lightweight implementation in Rust)
23
24
* [ Booksonic] ( https://booksonic.org/ ) - The selfhosted audiobook server
Original file line number Diff line number Diff line change 57
57
tags :
58
58
- airsonic
59
59
60
+ - role : apcupsd
61
+ tags :
62
+ - apcupsd
63
+
60
64
- role : bazarr
61
65
tags :
62
66
- bazarr
Original file line number Diff line number Diff line change
1
+ ---
2
+ apcupsd_enabled : false
3
+
4
+ # directories
5
+ apcupsd_data_directory : " {{ docker_home }}/apcupsd"
6
+
7
+ # network
8
+ apcupsd_port : " 3551"
9
+
10
+ # specs
11
+ apcupsd_memory : 1g
12
+
13
+ # docker
14
+ apcupsd_container_name : apcupsd
15
+
16
+ # ups config
17
+ apcupsd_onbatterydelay : 6
18
+ apcupsd_batterylevel : 5
19
+ apcupsd_minutes : 5
20
+ apcupsd_timeout : 0
21
+ apcupsd_annoy : 300
22
+ apcupsd_annoydelay : 60
23
+ apcupsd_nologon : " disable"
24
+ apcupsd_killdelay : 0
Original file line number Diff line number Diff line change
1
+ ---
2
+ provisioner :
3
+ inventory :
4
+ group_vars :
5
+ all :
6
+ apcupsd_enabled : true
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Stop
3
+ hosts : all
4
+ become : true
5
+ tasks :
6
+ - name : " Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
7
+ include_role :
8
+ name : " {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
9
+ vars :
10
+ apcupsd_enabled : false
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Verify
3
+ hosts : all
4
+ gather_facts : false
5
+ tasks :
6
+ - include_vars :
7
+ file : ../../defaults/main.yml
8
+
9
+ - name : Get container state
10
+ docker_container_info :
11
+ name : " {{ apcupsd_container_name }}"
12
+ register : result
13
+
14
+ - name : Check Apcupsd is running
15
+ assert :
16
+ that :
17
+ - result.container['State']['Status'] == "running"
18
+ - result.container['State']['Restarting'] == false
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Verify
3
+ hosts : all
4
+ gather_facts : false
5
+ tasks :
6
+ - include_vars :
7
+ file : ../../defaults/main.yml
8
+
9
+ - name : Try and stop and remove Apcupsd
10
+ docker_container :
11
+ name : " {{ apcupsd_container_name }}"
12
+ state : absent
13
+ register : result
14
+
15
+ - name : Check Apcupsd is stopped
16
+ assert :
17
+ that :
18
+ - not result.changed
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - name : Start Apcupsd
4
+ block :
5
+ - name : Create Apcupsd Directories
6
+ ansible.builtin.file :
7
+ path : " {{ item }}"
8
+ state : directory
9
+ with_items :
10
+ - " {{ apcupsd_data_directory }}"
11
+
12
+ - name : " Check if Apcupsd config exists"
13
+ ansible.builtin.stat :
14
+ path : " {{ apcupsd_data_directory }}/apcupsd.conf"
15
+ register : apcupsd_config_path
16
+
17
+ - name : Template Apcupsd config
18
+ ansible.builtin.template :
19
+ src : apcupsd.conf
20
+ dest : " {{ apcupsd_data_directory }}/apcupsd.conf"
21
+ when : not apcupsd_config_path.stat.exists
22
+
23
+ - name : Apcupsd Docker Container
24
+ community.docker.docker_container :
25
+ name : " {{ apcupsd_container_name }}"
26
+ image : gregewing/apcupsd
27
+ pull : true
28
+ privileged : true
29
+ volumes :
30
+ - " /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket"
31
+ - " {{ apcupsd_data_directory }}/apcupsd.conf:/etc/apcupsd/apcupsd.conf"
32
+ ports :
33
+ - " {{ apcupsd_port }}:3551"
34
+ devices :
35
+ - " {{ apcupsd_device }}:{{ apcupsd_device }}"
36
+ env :
37
+ TZ : " {{ ansible_nas_timezone }}"
38
+ restart_policy : unless-stopped
39
+ memory : " {{ apcupsd_memory }}"
40
+ when : apcupsd_enabled is true
41
+
42
+ - name : Stop Apcupsd
43
+ block :
44
+ - name : Stop Apcupsd
45
+ community.docker.docker_container :
46
+ name : " {{ apcupsd_container_name }}"
47
+ state : absent
48
+ when : apcupsd_enabled is false
You can’t perform that action at this time.
0 commit comments