Skip to content

peering-manager/ansible-role-peering-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI Ansible Galaxy

Ansible Role: Peering Manager

An Ansible Role that installs Peering Manager on Debian/Ubuntu.

This role install all dependencies required by Peering Manager including the PostgreSQL database. So it can be used to setup Peering Manager as an appliance including everything in the same machine.

Web backend and frontend setups can be disabled if you already have your own way to handle them.

Dependencies

None.

Roles Variables

Available variables are listed below, along with default values:

Setup for the PostgreSQL database:

peering_manager_database: peering-manager
peering_manager_database_user: peering-manager
peering_manager_database_password: peering-manager
peering_manager_database_host: localhost # This will force PostgreSQL to be setup

Where to get Peering Manager and which version:

peering_manager_version: latest
peering_manager_git_url: https://github.com/peering-manager/peering-manager.git

By default, it will always get the latest stable version. A specific version can be enforced by using, v1.7.0 for example.

Where to install Peering Manager:

peering_manager_install_directory: /opt/peering-manager

The username, password and email for the super user.

peering_manager_superuser_username: admin
peering_manager_superuser_password: admin
peering_manager_superuser_email: admin@example.com

Extra Python packages can be listed in order for this role to install them in the virtual environment:

peering_manager_local_requirements: []

LDAP can be used as authentication mechanism. It must be enabled, and the whole LDAP configuration has to be provided in the following variables (see Peering Manager documentation):

peering_manager_setup_ldap_auth: false
peering_manager_ldap_config: ""

The configuration for Peering Manager must be given as key: value pairs like the following, please note that the secret key does not need to be given as it will be generated automatically:

peering_manager_config:
  ALLOWED_HOSTS:
    - localhost
    - 127.0.0.1
  TIME_ZONE: "Europe/Paris"
  …

Scheduled tasks are run using systemd timers You can use on_unit_active_sec or on_calendar to specify times for each tasks:

peering_manager_tasks:
  peeringdb-sync:
    enabled: true
    command: "{{ peering_manager_virtualenv_path }}/bin/python {{ peering_manager_install_directory }}/manage.py peeringdb_sync"
    on_calendar: "*-*-* 2:30:00"
  prefix-fetch:
    enabled: true
    command: "{{ peering_manager_virtualenv_path }}/bin/python {{ peering_manager_install_directory }}/manage.py grab_prefixes"
    on_calendar: "*-*-* 4:30:00"
  poll-bgp-sessions:
    enabled: true
    command: "{{ peering_manager_virtualenv_path }}/bin/python {{ peering_manager_install_directory }}/manage.py poll_bgp_sessions --all"
    on_unit_active_sec: "30m"
  configure-routers:
    enabled: true
    command: "{{ peering_manager_virtualenv_path }}/bin/python {{ peering_manager_install_directory }}/manage.py configure_routers"
    on_calendar: "*-*-* *:55:00"

Configuration for the backend web server and systemd:

peering_manager_setup_systemd: false
peering_manager_gunicorn_address: 127.0.0.1
peering_manager_gunicorn_port: 8001
peering_manager_gunicorn_workers_number: 5

Whether or not to configure the frontend web server:

peering_manager_setup_web_frontend: false

Example Playbook

- hosts: peering_manager
  roles:
    - { role: gmazoyer.peering_manager }

License

This Ansible Role is released under the terms of the GNU GPLv3. Please read the LICENSE file for more information.

Author Information

This role was created in 2019 by Guillaume Mazoyer.