/ansible-znc

An Ansible role to install and configure the ZNC IRC bouncer server.

MIT LicenseMIT

Ansible ZNC

Install and configure the ZNC IRC bouncer.

Includes the ClientBuffer module to support multiple separate client buffers per account.

Requirements

None.

Role Variables

For more details on ZNC's configuration, see the ZNC configuration documentation.

For more information on ZNC's global, user, and network modules, see the ZNC module documentation.

ZNC Install

znc_install_version: 1.6.1  # The version of znc to install
znc_force_install: False    # Force a reinstallation of ZNC
znc_exec_user: znc-admin    # The user to create under which znc will run
znc_config_root: /etc/znc   # The root location of znc's configuration file structure
znc_exec_with_debug: false  # Should znc be executed in debug mode?  The logs will show up in /var/log/upstart/znc.log

ZNC Global Configuration

znc_max_buffer_size: 100000    # The max size of any user buffer.  This is used as the default if no user-specific value is given.
znc_port: 6666                 # What port will znc listen on?
znc_ipv4: true                 # Should ZNC listen for ipv4 connections?
znc_ipv6: false                # ipv6?
znc_ssl: true                  # Should ZNC expect connections over ssl?
znc_ssl_certfile: "{{ znc_config_root }}/znc.pem"   # If ssl is enabled, where is the PEM file? This is generated by the Ansible build.
znc_global_modules:                                 # Which global modules should be installed for use across all users and networks?  Note that these are separate from user and network modules defined below.
  - webadmin

ZNC User Definition Configuration

znc_users:                                # It's advisable to have a separate admin user with no networks, for administering the ZNC server directly.  Here we just have the one user, for brevity.
  - name: admin
    password:                             # These can be generated with `znc --makepass`.  This one is for password "admin".
      method: "sha256"
      hash: "481fe84cc70161b20eb0c487d212e8b94cabb45cb9f08b6c51cc2c0131c1b42e"
      salt: "J*;s-Z!gjJ:oJ.kThRZv"
    nick: adminuser
    realname: Admin ZNC User
    admin: true                           # There should be at least one admin user, but your typical user probably shouldn't be an admin.
    allow: "*"                            # Optional
    altnick: adminuser_                   # Optional
    autoclearchanbuffer: true             # Optional
    autoclearquerybuffer: true            # Optional
    buffer: 100000                        # Optional
    chanmodes: "+stn"                     # Optional
    ident: adminuser_                     # Optional
    multiclients: false                   # Optional
    networks:                             # Optional, though without any networks the user won't connect to any external IRC servers.
      freenode:
        server: chat.freenode.net
        port: 6697
        ssl: true
        password: ""                      # Optional, this is the password with which the user will log into the remote chat server.
        channels:                         # Optional list, the user will connect to each of these channels on the remote chat server.
          - "#freenode"                   # These need to be commented for YAML, if there's a hash in the channel name.
        modules:                          # Optional list, thes are the network-specific modules.
          - route_replies
          - keepnick
          - clientbuffer
    modules:                              # These are the user-specific modules.
      - chansaver
      - controlpanel
      - webadmin

Dependencies

None.

Example Playbook

- hosts: whatever
  sudo: yes
  roles:
    - triplepoint.znc

License

MIT