From aed916dc76f5cf71b872d76a25083fd27af90b3d Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 15 Mar 2018 09:10:49 +0800 Subject: znc: move data dir to /home/znc, listen on ipv4 & ipv6, fix reload --- roles/znc/tasks/main.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'roles/znc/tasks/main.yml') 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: -- cgit v1.2.2