src.nth.io/

summaryrefslogtreecommitdiff
path: root/adguard-home/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'adguard-home/tasks')
-rw-r--r--adguard-home/tasks/main.yaml49
1 files changed, 49 insertions, 0 deletions
diff --git a/adguard-home/tasks/main.yaml b/adguard-home/tasks/main.yaml
new file mode 100644
index 0000000..362db53
--- /dev/null
+++ b/adguard-home/tasks/main.yaml
@@ -0,0 +1,49 @@
+---
+
+- name: unarchive adguard home
+ become: yes
+ unarchive:
+ remote_src: yes
+ src: "{{adguard_home_tar}}"
+ dest: "/tmp/"
+ creates: "/tmp/AdGuardHome/"
+ owner: "root"
+ group: "root"
+
+- name: install adguard home binary
+ become: yes
+ copy:
+ src: "/tmp/AdGuardHome/AdGuardHome"
+ dest: "/usr/local/bin/"
+ remote_src: yes
+ owner: "root"
+ group: "root"
+ mode: "0755"
+ notify: restart adguard home
+
+- name: create dirs
+ become: yes
+ file:
+ path: "{{item}}"
+ state: "directory"
+ owner: "root"
+ group: "root"
+ mode: "0755"
+ loop:
+ - "/etc/AdGuardHome"
+ - "{{adguard_home_data_dir}}"
+ notify: restart adguard home
+
+- name: configure adguard home service
+ become: yes
+ template: src="AdGuardHome.service.j2" dest="/etc/systemd/system/AdGuardHome.service"
+ notify: restart adguard home
+
+- name: configure adguard home
+ become: yes
+ template: src="AdGuardHome.yaml.j2" dest="/etc/AdGuardHome/AdGuardHome.yaml"
+ notify: restart adguard home
+
+- name: ensure adguard home is started
+ become: yes
+ systemd: name="AdGuardHome.service" enabled="yes" state="started"