diff options
author | Aaron LI <aly@aaronly.me> | 2018-03-15 09:10:49 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-03-15 09:10:49 +0800 |
commit | aed916dc76f5cf71b872d76a25083fd27af90b3d (patch) | |
tree | a9de8c41fec0946defa2a706cf8c6de45818a4dc /roles/znc/tasks | |
parent | f2402b66976e57c457b36141444a3687ce918bfe (diff) | |
download | ansible-dfly-vps-aed916dc76f5cf71b872d76a25083fd27af90b3d.tar.bz2 |
znc: move data dir to /home/znc, listen on ipv4 & ipv6, fix reload
Diffstat (limited to 'roles/znc/tasks')
-rw-r--r-- | roles/znc/tasks/main.yml | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/roles/znc/tasks/main.yml b/roles/znc/tasks/main.yml index e64949f..93754ff 100644 --- a/roles/znc/tasks/main.yml +++ b/roles/znc/tasks/main.yml @@ -4,23 +4,34 @@ name: znc state: present -- name: znc - create config directory +- name: znc - create data and config directory file: - path: /usr/local/etc/znc/configs + path: "{{ znc.data_dir }}/configs" state: directory + recurse: true + owner: znc + group: znc + mode: 0700 - name: znc - generate config file template: src: znc.conf.j2 - dest: /usr/local/etc/znc/configs/znc.conf + dest: "{{ znc.data_dir }}/configs/znc.conf" owner: znc group: znc mode: 0600 - backup: yes notify: reload-znc -- name: znc - enable and start service - command: rcenable znc +- name: znc - enable service + blockinfile: + path: /etc/rc.conf + marker: "# {mark} ANSIBLE MANAGED - znc" + block: | + znc_conf_dir="{{ znc.data_dir }}" + znc_enable="YES" + +- name: znc - start service + command: rcstart znc - name: acme - generate deployment script template: |