adguard-home/tasks/main.yaml
changeset 50 15edca738a31
child 53 9e4f750f5d36
equal deleted inserted replaced
49:05924a38d51f 50:15edca738a31
       
     1 ---
       
     2 
       
     3 - name: unarchive adguard home
       
     4   become: yes
       
     5   unarchive:
       
     6     remote_src: yes
       
     7     src: "{{adguard_home_tar}}"
       
     8     dest: "/tmp/"
       
     9     creates: "/tmp/AdGuardHome/"
       
    10     owner: "root"
       
    11     group: "root"
       
    12 
       
    13 - name: install adguard home binary
       
    14   become: yes
       
    15   copy:
       
    16     src: "/tmp/AdGuardHome/AdGuardHome"
       
    17     dest: "/usr/local/bin/"
       
    18     remote_src: yes
       
    19     owner: "root"
       
    20     group: "root"
       
    21     mode: "0755"
       
    22   notify: restart adguard home
       
    23 
       
    24 - name: create dirs
       
    25   become: yes
       
    26   file:
       
    27     path: "{{item}}"
       
    28     state: "directory"
       
    29     owner: "root"
       
    30     group: "root"
       
    31     mode: "0755"
       
    32   loop:
       
    33     - "/etc/AdGuardHome"
       
    34     - "{{adguard_home_data_dir}}"
       
    35   notify: restart adguard home
       
    36 
       
    37 - name: configure adguard home service
       
    38   become: yes
       
    39   template: src="AdGuardHome.service.j2" dest="/etc/systemd/system/AdGuardHome.service"
       
    40   notify: restart adguard home
       
    41 
       
    42 - name: configure adguard home
       
    43   become: yes
       
    44   template: src="AdGuardHome.yaml.j2" dest="/etc/AdGuardHome/AdGuardHome.yaml"
       
    45   notify: restart adguard home
       
    46 
       
    47 - name: ensure adguard home is started
       
    48   become: yes
       
    49   systemd: name="AdGuardHome.service" enabled="yes" state="started"