aboutsummaryrefslogtreecommitdiffstats
path: root/roles/znc/tasks/main.yml
blob: bf6ecb445e905bd2bc705348d848e7993652853c (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
41
42
43
44
45
46
47
48
49
50
51
---
- 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 - generate SSL cert deploy script
  template:
    src: deploy_ssl.sh.j2
    dest: "{{ znc.data_dir }}/deploy_ssl.sh"
    mode: 0755

- name: znc - deploy SSL cert
  command: sh {{ znc.data_dir }}/deploy_ssl.sh

- 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
  service:
    name: znc
    state: started

- name: acme - add znc to deploy
  lineinfile:
    path: "{{ web.acme_home }}/deploy.local.sh"
    line: sh {{ znc.data_dir }}/deploy_ssl.sh
  tags: acme