salt.modules.icinga2 module

Module to provide icinga2 compatibility to salt.

New in version 2017.7.0.

depends
  • icinga2 server

salt.modules.icinga2.generate_cert(domain)

Generate an icinga2 client certificate and key.

Returns::

icinga2 pki new-cert --cn domain.tld --key /etc/icinga2/pki/domain.tld.key --cert /etc/icinga2/pki/domain.tld.crt

CLI Example:

salt '*' icinga2.generate_cert domain.tld
salt.modules.icinga2.generate_ticket(domain)

Generate and save an icinga2 ticket.

Returns::

icinga2 pki ticket --cn domain.tld

CLI Example:

salt '*' icinga2.generate_ticket domain.tld
salt.modules.icinga2.node_setup(domain, master, ticket)

Setup the icinga2 node.

Returns::

icinga2 node setup --ticket TICKET_ID --endpoint master.domain.tld --zone domain.tld --master_host master.domain.tld --trustedcert /etc/icinga2/pki/trusted-master.crt

CLI Example:

salt '*' icinga2.node_setup domain.tld master.domain.tld TICKET_ID
salt.modules.icinga2.request_cert(domain, master, ticket, port)

Request CA cert from master icinga2 node.

Returns::

icinga2 pki request --host master.domain.tld --port 5665 --ticket TICKET_ID --key /etc/icinga2/pki/domain.tld.key --cert /etc/icinga2/pki/domain.tld.crt --trustedcert /etc/icinga2/pki/trusted-master.crt --ca /etc/icinga2/pki/ca.crt

CLI Example:

salt '*' icinga2.request_cert domain.tld master.domain.tld TICKET_ID
salt.modules.icinga2.save_cert(domain, master)

Save the certificate for master icinga2 node.

Returns::

icinga2 pki save-cert --key /etc/icinga2/pki/domain.tld.key --cert /etc/icinga2/pki/domain.tld.crt --trustedcert /etc/icinga2/pki/trusted-master.crt --host master.domain.tld

CLI Example:

salt '*' icinga2.save_cert domain.tld master.domain.tld