Ingen beskrivning
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

znc.yml 2.1KB

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