transmission/tasks/main.yaml
changeset 28 d289eab1ea52
parent 2 2556522a2a45
child 34 ecbdaed7f151
equal deleted inserted replaced
27:8fddefdd948b 28:d289eab1ea52
     6   notify: restart transmission service
     6   notify: restart transmission service
     7 
     7 
     8 - name: stop transmission service
     8 - name: stop transmission service
     9   systemd: name="transmission-daemon" state="stopped" daemon_reload="yes"
     9   systemd: name="transmission-daemon" state="stopped" daemon_reload="yes"
    10   become: yes
    10   become: yes
       
    11   changed_when: false
    11 
    12 
    12 - name: config ip whitelist
    13 - name: config ip whitelist
    13   become: yes
    14   become: yes
    14   lineinfile:
    15   lineinfile:
    15     path: "{{transmission_config}}"
    16     path: "{{transmission_config}}"
    31     path: "{{transmission_config}}"
    32     path: "{{transmission_config}}"
    32     regexp: '^    "rpc-port":'
    33     regexp: '^    "rpc-port":'
    33     line: "    \"rpc-port\": {{transmission_port}},"
    34     line: "    \"rpc-port\": {{transmission_port}},"
    34   notify: restart transmission service
    35   notify: restart transmission service
    35 
    36 
       
    37 # the password is hashed at start of server so this always changes
    36 - name: config password
    38 - name: config password
    37   become: yes
    39   become: yes
    38   lineinfile:
    40   lineinfile:
    39     path: "{{transmission_config}}"
    41     path: "{{transmission_config}}"
    40     regexp: '^    "rpc-password":'
    42     regexp: '^    "rpc-password":'
    41     line: "    \"rpc-password\": \"{{transmission_passwd}}\","
    43     line: "    \"rpc-password\": \"{{transmission_passwd}}\","
    42   notify: restart transmission service
    44   changed_when: false
    43 
    45 
    44 - name: config download dir
    46 - name: config download dir
    45   become: yes
    47   become: yes
    46   lineinfile:
    48   lineinfile:
    47     path: "{{transmission_config}}"
    49     path: "{{transmission_config}}"
    66   notify: restart transmission service
    68   notify: restart transmission service
    67 
    69 
    68 - name: start transmission service
    70 - name: start transmission service
    69   systemd: name="transmission-daemon" state="started" daemon_reload="yes"
    71   systemd: name="transmission-daemon" state="started" daemon_reload="yes"
    70   become: yes
    72   become: yes
       
    73   changed_when: false