No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

znc.yml 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # more or less as per http://wiki.znc.in/Running_ZNC_as_a_system_daemon
  2. - name: Install znc dependencies
  3. apt: pkg={{ item }} state=installed
  4. with_items:
  5. - automake
  6. - build-essential
  7. - checkinstall
  8. - g++
  9. - libperl-dev
  10. - libsasl2-dev
  11. - libssl-dev
  12. - libtool
  13. - openssl
  14. - pkg-config
  15. - python3-dev
  16. - swig
  17. tags:
  18. - dependencies
  19. - name: Download znc release
  20. get_url: url=http://znc.in/releases/archive/znc-{{ znc_version }}.tar.gz dest=/root/znc-{{ znc_version }}.tar.gz
  21. - name: Decompress znc source
  22. command: tar xzf /root/znc-{{ znc_version }}.tar.gz chdir=/root creates=/root/znc-{{ znc_version }}/configure
  23. - name: Build and install znc
  24. shell: ./configure --enable-python && make && make install executable=/bin/bash chdir=/root/znc-{{ znc_version }} creates=/usr/local/bin/znc
  25. notify: restart znc
  26. - name: Create znc group
  27. group: name=znc state=present
  28. - name: Create znc user
  29. user: name=znc state=present home=/var/lib/znc system=yes group=znc shell=/usr/sbin/nologin
  30. - name: Copy znc init file into place
  31. copy: src=etc_init.d_znc dest=/etc/init.d/znc mode=0755
  32. - name: Create a combined version of the private key with public cert and intermediate + root CAs
  33. shell: cat /etc/ssl/private/wildcard_private.key /etc/ssl/certs/wildcard_combined.pem >
  34. /var/lib/znc/znc.pem creates=/var/lib/znc/znc.pem
  35. notify: restart znc
  36. - name: Ensure znc user and group can read cert
  37. file: path=/var/lib/znc/znc.pem group=znc owner=znc mode=640
  38. notify: restart znc
  39. - name: Check for existing config file
  40. command: cat /var/lib/znc/configs/znc.conf
  41. register: znc_config
  42. ignore_errors: True
  43. changed_when: False # never report as "changed"
  44. - name: Create znc config directory
  45. file: state=directory path=/var/lib/znc/configs group=znc owner=znc
  46. - name: Copy znc configuration file into place
  47. template: src=var_lib_znc_configs_znc.conf.j2 dest=/var/lib/znc/configs/znc.conf owner=znc group=znc
  48. when: znc_config.rc != 0
  49. notify: restart znc
  50. - name: Set firewall rule for znc
  51. ufw: rule=allow port=6697 proto=tcp
  52. - name: Ensure znc is a system service
  53. service: name=znc state=started enabled=true