t_systems_mms / t_systems_mms.icinga_director / 1.33.1 / module / icinga_service Manage services in Icinga2 | "added in version" 1.0.0 of t_systems_mms.icinga_director" Authors: Sebastian Gumprich (@rndmh3ro)t_systems_mms.icinga_director.icinga_service (1.33.1) — module
Install with ansible-galaxy collection install t_systems_mms.icinga_director:==1.33.1
collections: - name: t_systems_mms.icinga_director version: 1.33.1
Add or remove a service to Icinga2 through the director API.
- name: Create service tags: service t_systems_mms.icinga_director.icinga_service: state: present url: "{{ icinga_url }}" url_username: "{{ icinga_user }}" url_password: "{{ icinga_pass }}" object_name: "foo service" display_name: "foo service" check_command: hostalive use_agent: false host: foohost vars: procs_argument: consul procs_critical: '1:' procs_warning: '1:'
- name: Update service tags: service t_systems_mms.icinga_director.icinga_service: state: present url: "{{ icinga_url }}" url_username: "{{ icinga_user }}" url_password: "{{ icinga_pass }}" object_name: "foo service" display_name: "foo service" host: foohost notes: "example note" notes_url: "'http://url1' 'http://url2'" append: true
- name: Create serviceset service t_systems_mms.icinga_director.icinga_service: state: present url: "{{ icinga_url }}" url_username: "{{ icinga_user }}" url_password: "{{ icinga_pass }}" object_name: "foo service serviceset" service_set: "foo_serviceset"
url: description: - HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path required: true type: str host: description: - Choose the host this single service should be assigned to. - This field will be required when `service_set` is not defined. required: false type: str vars: default: {} description: - Custom properties of the service. type: dict force: default: false description: - If V(yes) do not get a cached copy. type: bool notes: description: - Additional notes for this object. type: str version_added: 1.8.0 version_added_collection: t_systems_mms.icinga_director state: choices: - present - absent default: present description: - Apply feature state. type: str append: choices: - true - false description: - Do not overwrite the whole object but instead append the defined properties. - Note - Appending to existing vars, imports or any other list/dict is not possible. You have to overwrite the complete list/dict. - Note - Variables that are set by default will also be applied, even if not set. type: bool version_added: 1.25.0 version_added_collection: t_systems_mms.icinga_director groups: default: [] description: - Service groups that should be directly assigned to this service. - Servicegroups can be useful for various reasons. - They are helpful to provided service-type specific view in Icinga Web 2, either for custom dashboards or as an instrument to enforce restrictions. - Service groups can be directly assigned to single services or to service templates. elements: str type: list imports: default: [] description: - Importable templates, add as many as you want. - Please note that order matters when importing properties from multiple templates - last one wins. elements: str type: list disabled: choices: - true - false default: false description: - Disabled objects will not be deployed. type: bool volatile: description: - Whether this check is volatile. type: bool notes_url: description: - An URL pointing to additional notes for this object. - Separate multiple urls like this "'http://url1' 'http://url2'". - Maximum length is 255 characters. type: str version_added: 1.8.0 version_added_collection: t_systems_mms.icinga_director use_agent: description: - Whether the check command for this service should be executed on the Icinga agent. type: bool use_proxy: default: true description: - If V(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts. type: bool client_key: description: - PEM formatted file that contains your private key to be used for SSL client authentication. - If O(client_cert) contains both the certificate and key, this option is not required. type: path http_agent: default: ansible-httpget description: - Header to identify as, generally appears in web server logs. type: str use_gssapi: default: false description: - Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos through Negotiate authentication. - Requires the Python library L(gssapi,https://github.com/pythongssapi/python-gssapi) to be installed. - Credentials for GSSAPI can be specified with O(url_username)/O(url_password) or with the GSSAPI env var C(KRB5CCNAME) that specified a custom Kerberos credential cache. - NTLM authentication is B(not) supported even if the GSSAPI mech for NTLM has been installed. type: bool version_added: '2.11' version_added_collection: ansible.builtin client_cert: description: - PEM formatted certificate chain file to be used for SSL client authentication. - This file can also include the key as well, and if the key is included, O(client_key) is not required. type: path object_name: aliases: - name description: - Name of the service. required: true type: str service_set: description: - Choose the service set name this single service should be assigned to. - This field will be required when `host` is not defined. type: str version_added: 1.29.0 version_added_collection: t_systems_mms.icinga_director check_period: description: - The name of a time period which determines when this object should be monitored. Not limited by default. type: str display_name: description: - Alternative name for this service. type: str url_password: description: - The password for use in HTTP basic authentication. - If the O(url_username) parameter is not specified, the O(url_password) parameter will not be used. type: str url_username: description: - The username for use in HTTP basic authentication. - This parameter can be used without O(url_password) for sites that allow empty passwords type: str check_command: description: - Check command definition. type: str check_timeout: description: - Check command timeout in seconds. Overrides the CheckCommand's timeout attribute. type: str check_interval: description: - Your regular check interval. type: str retry_interval: description: - Retry interval, will be applied after a state change unless the next hard state is reached. type: str validate_certs: default: true description: - If V(no), SSL certificates will not be validated. - This should only be used on personally controlled sites using self-signed certificates. type: bool enable_perfdata: description: - Whether to process performance data provided by this object. type: bool force_basic_auth: default: false description: - Credentials specified with O(url_username) and O(url_password) should be passed in HTTP Header. type: bool max_check_attempts: description: - Defines after how many check attempts a new hard state is reached. type: str enable_active_checks: description: - Whether to actively check this object. type: bool enable_event_handler: description: - Whether to enable event handlers this object. type: bool enable_notifications: description: - Whether to send notifications for this object. type: bool enable_passive_checks: description: - Whether to accept passive check results for this object. type: bool