aboutsummaryrefslogtreecommitdiffstats
path: root/roles/znc/tasks/main.yml
blob: 93754ff73de861859645b0b00de1c5fda0eb466e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
- name: znc - install package
  pkgng:
    name: znc
    state: present

- name: znc - create data and config directory
  file:
    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: "{{ znc.data_dir }}/configs/znc.conf"
    owner: znc
    group: znc
    mode: 0600
  notify: reload-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:
    src: acme/znc.j2
    dest: /usr/local/etc/acme/deploy.d/znc
  tags: acme