Configuration
~~~~~~~~~~~~~

Sample ``/etc/racks/settings.yaml`` content:

.. code-block:: yaml

  DATABASES:
    default:
      ENGINE: django.db.backends.mysql
      NAME: racks
      USER: 'user'
      PASSWORD: 'password'

  SECRET_KEY: ...

  ZABBIX_URL: 'http://<zabbix host>/'
  ZABBIX_USER: 'user'
  ZABBIX_PASSWORD: 'password'

  PUPPET:
    puppet_ssl_cert: '<puppet ssl cert>'
    puppet_ssl_key: '<puppet ssl key>'
    puppet_ssl_verify: <path to ca or False>
    puppet_url: '<puppet host>'
    ignore_regex: '<regex for names of ignored attributes>'


  DCIM_URL: "http://<dcim host>/"
  DCIM_API: "http://<dcim host>/api/v1/"

  DCIM_USER: '<user>'
  DCIM_PASSWORD: '<password>'
  # List of ids to use in filter 'Owner' in DCIM
  DCIM_SERVER_OWNER_IDS_LIST:
    - 3
    - 4
    - 5
  DCIM_API_TIMEOUT: 1
  # DCIM custom field id with JIRA issue
  DCIM_JIRA_ISSUE_CUSTOM_VALUE_ID: 2
  # DCIM custom field id with User name and surname
  DCIM_CUSTOM_REPORTER_VALUE_ID: 5

  # Disables create/edit/delete functionality for Jenkins instances/slaves in web UI.
  JENKINS_DISABLE_UI_FORMS: True

  AUTH_LDAP_SERVER_URI: "ldap://<ldap host>"
  AUTH_LDAP_BIND_DN: "o=<organization>,dc=<domain component>"
  AUTH_LDAP_USER_DN_TEMPLATE: "uid=%(user)s,ou=<organizational unit for people>,o=<organization>,dc=<domain component>"
  AUTH_LDAP_REQUIRE_GROUP: "cn=<common name>,ou=<organizational unit for groups>,o=<organization>,dc=<domain component>"
  AUTH_LDAP_GROUP_SEARCH:
    base_dn: "ou=<organizational unit for groups>,o=<organization>,dc=<domain component>"
    scope: "SCOPE_SUBTREE"
    filterstr: "(objectClass=groupOfNames)"
  AUTH_LDAP_USER_ATTR_MAP:
      "first_name": "givenName"
      "last_name": "sn"
      "email": "mail"
  AUTH_LDAP_CACHE_GROUPS: true
  AUTH_LDAP_GROUP_CACHE_TIMEOUT: 3600

  CELERYBEAT_SCHEDULE:
    import-all-every-hour:
      task: importers.tasks.import_all
      schedule:
        crontab:
          minute: 0

For ``SECRET_KEY`` and ``DATABASES`` refer to `Django documentation`_. You can also
override other Django settings.

Settings starting with ``ZABBIX_`` and ``DCIM_`` are for Zabbix and DCIM importers respectively.

``DCIM_JIRA_ISSUE_CUSTOM_VALUE_ID`` is an id of Jira Issue in ``CustomValues`` associated with object in DCIM, if applicable.

``PUPPET`` is configuration for Puppet importer. If it's not specified, puppet importer won't run.

Settings starting with ``AUTH_LDAP_`` are documented in `django-auth-ldap reference`_.

``CELERYBEATH_SCHEDULE`` is basically documented at `Celery documentation`_. But to specify
``crontab`` [1]_ schedule you have to use ``crontab`` [1]_ mapping. It's keys are converted to keyword
arguments used to instantiate Celery ``crontab`` [1]_ object.

.. _Django documentation: http://django.readthedocs.org/en/1.6.x/ref/settings.html
.. _django-auth-ldap reference: https://pythonhosted.org/django-auth-ldap/reference.html#settings
.. _Celery documentation: http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#beat-entries

.. [1] http://docs.celeryproject.org/en/latest/reference/celery.schedules.html#celery.schedules.crontab
