unifi_poller

Ansible Role: Unifi Poller

ubuntu-18 ubuntu-20 License GitHub issues GitHub tag GitHub action

Description

Deploy and manage prometheus Unifi Poller using ansible. This in an Prometheus Exporter for Unifi Controller.

For detailed configuration see Unifi Poller config example.

Requirements

  • Ansible >= 2.9 (It might work on previous versions, but we cannot guarantee it)

Role Variables

All variables which can be overridden are stored in defaults/main.yml file as well as in table below.

Name Default Value Description
proxy_env {} Proxy environment variables
unifi_poller_version 2.1.3 Version
unifi_poller_system_user unifi_poller System user name
unifi_poller_system_group unifi_poller System user group
unifi_poller_binary_install_dir /usr/local/bin Binary install folder
unifi_poller_config_path /etc/unifi_poller Config folder
unifi_poller_config {} Configuration

Example

# For detailed configuration see https://github.com/unpoller/unpoller/blob/master/examples/up.json.example
unifi_poller_config:
  poller:
    quiet: false
    debug: false
    plugins: []
  prometheus:
    disable: false
    http_listen: "0.0.0.0:9130"
    ssl_cert_path: ""
    ssl_key_path: ""
    report_errors: false
  loki:
    url: "http://localhost:3100/api/v1/push"
    # The rest of this is advanced & optional. See wiki.
    user: ""
    pass: ""
    verify_ssl: false
    tenant_id: ""
    interval: "2m"
    timeout: "10s"
  influxdb:
    disable: false
    interval: "30s"
    url: "http://127.0.0.1:8086"
    user: "unifipoller"
    pass: "unifipoller"
    db: "unifi"
    verify_ssl: false
    dead_ports: false
  webserver:
    enable: false
    port: 37288
    html_path: "{{ unifi_poller_config_path }}/web"
    ssl_cert_path: ""
    ssl_key_path: ""
    max_events: 200
    accounts:
      captain: "$2a$04$mxw6i0LKH6u46oaLK2cq5eCTAAFkfNiRpzNbz.EyvJZZWNa2FzIlS"
  unifi:
    dynamic: false
    defaults:
      url:  "https://127.0.0.1:8443"
      user: "unifipoller"
      pass: "unifipoller"
      sites:
        - all
      save_ids: false
      save_events: false
      save_alarms: false
      save_anomalies: false
      save_dpi: false
      save_sites: true
      hash_pii: false
      verify_ssl: false
    controllers:
    # Repeat the following stanza to poll multiple controllers.
      - url:  "https://127.0.0.1:8443"
        user: "unifipoller"
        pass: "unifipoller"
        sites:
          - all
        save_ids: false
        save_events: false
        save_alarms: false
        save_anomalies: false
        save_dpi: false
        save_sites: true
        hash_pii: false
        verify_ssl: false

Playbook

- hosts: all
  become: yes
  roles:
    - onkeldom.unifi_poller

Contributing

See contributor guideline.

License

This project is licensed under MIT License. See LICENSE for more details.

About

Ansible role for installing and configuring Unifi Poller

Install
ansible-galaxy install OnkelDom/ansible-role-unifi-poller
GitHub repository
License
mit
Downloads
15