From 64b65ad45f4a240ec7b604f949aa96a43d6008c8 Mon Sep 17 00:00:00 2001 From: Deutsche Telekom MMS Date: Mon, 20 Nov 2023 15:04:57 +0000 Subject: [PATCH 1/9] update due to new release --- changelogs/changelog.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index ac491287..7b88cbdb 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -285,4 +285,6 @@ releases: - Update test matrix (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/223) - exclude old python versions with ansible devel (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/225) - Update actions/checkout action to v4 (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/224) + - use telekom-mms renovate preset (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/229) + - Pin dependencies (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/230) release_date: '2023-11-13' From 767f289ad54dc2ac32f6c7d370ca767187db1470 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Mon, 20 Nov 2023 16:23:10 +0100 Subject: [PATCH 2/9] trigger workflow From f23677656a69a2a5136797c893d19fba2bf9242c Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Thu, 24 Jun 2021 09:52:14 +0200 Subject: [PATCH 3/9] add role argument specification --- roles/ansible_icinga/meta/argument_specs.yml | 1130 ++++++++++++++++++ 1 file changed, 1130 insertions(+) create mode 100644 roles/ansible_icinga/meta/argument_specs.yml diff --git a/roles/ansible_icinga/meta/argument_specs.yml b/roles/ansible_icinga/meta/argument_specs.yml new file mode 100644 index 00000000..918ef14e --- /dev/null +++ b/roles/ansible_icinga/meta/argument_specs.yml @@ -0,0 +1,1130 @@ +argument_specs: + main: + short_description: Configure an Icinga instance with Icinga Director + description: + - The main entry point includes all tasks for objects that can be created with the role. + options: + icinga_url: + description: + - 'HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path' + type: str + icinga_url_password: + description: + - "The password for use in HTTP basic authentication. If the `url_username' parameter is not specified, the `url_password' parameter will not be used." + type: str + icinga_url_username: + description: + - "The username for use in HTTP basic authentication. This parameter can be used without `url_password' for sites that allow empty passwords" + type: str + icinga_use_gssapi: + description: + - "Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos through Negotiate authentication. Requires the Python library gssapi to be installed. Credentials for GSSAPI can be specified with `url_username'/`url_password' or with the GSSAPI env var `KRB5CCNAME' that specified a custom Kerberos credential cache. NTLM authentication is `not' supported even if the GSSAPI mech for NTLM has been installed." + default: false + type: bool + icinga_use_proxy: + description: + - "If `no', it will not use a proxy, even if one is defined in an environment variable on the target hosts." + default: true + type: bool + icinga_validate_certs: + description: + - "If `no', SSL certificates will not be validated. icinga_This should only be used on personally controlled sites using selfigned certificates." + default: true + type: bool + icinga_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, `client_key' is not required." + type: path + icinga_client_key: + description: + - "PEM formatted file that contains your private key to be used for SSL client authentication. If `client_cert' contains both the certificate and key, this option is not required." + type: path + icinga_timeperiods: + description: + - A list of Icinga timeperiods to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Name of the time period. + aliases: + - name + type: str + display_name: + description: + - Alternative name for this timeperiod. + type: str + imports: + description: + - 'Importable templates, add as many as you want.' + - Please note that order matters when importing properties from multiple templates - last one wins. + type: list + elements: str + ranges: + description: A dict of days and timeperiods. + type: dict + icinga_user_templates: + description: + - A list of Icinga user_templates to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Name of the user template. + aliases: + - name + required: true + type: str + imports: + description: + - 'Importable templates, add as many as you want.' + - Please note that order matters when importing properties from multiple templates - last one wins. + type: list + elements: str + period: + description: + - The name of a time period which determines when notifications to this User should be triggered. Not set by default. + type: str + enable_notifications: + description: + - Whether to send notifications for this user. + type: bool + icinga_users: + description: + - A list of Icinga users to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Name of the user. + aliases: + - name + required: true + type: str + display_name: + description: + - Alternative name for this user. + - 'In case your object name is a username, this could be the full name of the corresponding person.' + type: str + imports: + description: + - 'Importable templates, add as many as you want.' + - Please note that order matters when importing properties from multiple templates - last one wins. + type: list + elements: str + pager: + description: + - The pager address of the user. + type: str + period: + description: + - The name of a time period which determines when notifications to this User should be triggered. Not set by default. + type: str + disabled: + description: + - Disabled objects will not be deployed. + type: bool + default: false + choices: + - true + - false + email: + description: + - The Email address of the user. + type: str + groups: + description: + - User groups that should be directly assigned to this user. + - Groups can be useful for various reasons. You might prefer to send notifications to groups instead of single users. + type: list + elements: str + icinga_endpoints: + description: + - A list of Icinga endpoints to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Icinga object name for this endpoint. + - This is usually a fully qualified host name but it could basically be any kind of string. + - To make things easier for your users we strongly suggest to use meaningful names for templates. + - 'For example "generic-endpoint" is ugly, "Standard Linux Server" is easier to understand.' + required: true + aliases: + - name + type: str + host: + description: + - The hostname/IP address of the remote Icinga 2 instance. + type: str + port: + description: + - The service name/port of the remote Icinga 2 instance. Defaults to 5665. + type: int + log_duration: + description: + - 'Duration for keeping replay logs on connection loss. Defaults to 1d (86400 seconds). Attribute is specified in seconds. If log_duration is set to 0, replaying logs is disabled. You could also specify the value in human readable format like 10m for 10 minutes or 1h for one hour.' + type: str + zone: + description: + - The name of the zone this endpoint is part of. + type: str + icinga_zones: + description: + - A list of Icinga zones to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Icinga object name for this zone. + - This is usually a fully qualified host name but it could basically be any kind of string. + - To make things easier for your users we strongly suggest to use meaningful names for templates. + - 'For example "generic-zone" is ugly, "Standard Linux Server" is easier to understand.' + aliases: + - name + required: true + type: str + is_global: + description: + - Whether configuration files for this zone should be synced to all endpoints. + default: false + type: bool + parent: + description: + - The name of the parent zone. + type: str + icinga_hostgroups: + description: + - A list of Icinga hostgroups to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Icinga object name for this hostgroup. + aliases: + - name + required: true + type: str + display_name: + description: + - An alternative display name for this group. + - If you wonder how this could be helpful just leave it blank. + type: str + assign_filter: + description: + - This allows you to configure an assignment filter. + - Please feel free to combine as many nested operators as you want. + type: str + icinga_host_templates: + description: + - A list of Icinga host_templates to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Icinga object name for this host template. + - This is usually a fully qualified host name but it could basically be any kind of string. + - To make things easier for your users we strongly suggest to use meaningful names for templates. + - 'For example "generic-host" is ugly, "Standard Linux Server" is easier to understand.' + aliases: + - name + required: true + type: str + display_name: + description: + - Alternative name for this host. + - Might be a host alias or and kind of string helping your users to identify this host. + type: str + address: + description: + - 'Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with.' + type: str + address6: + description: + - 'Host IPv6 address. Usually an IPv64 address, but may be any kind of address your check plugin is able to deal with.' + type: str + groups: + description: + - Hostgroups that should be directly assigned to this node. Hostgroups can be useful for various reasons. + - You might assign service checks based on assigned hostgroup. They are also often used as an instrument to enforce restricted views in Icinga Web 2. + - Hostgroups can be directly assigned to single hosts or to host templates. + - You might also want to consider assigning hostgroups using apply rules. + type: list + elements: str + default: [] + check_command: + description: + - The name of the check command. + - 'Though this is not required to be defined in the director, you still have to supply a check_command in a host or host-template.' + type: str + event_command: + description: + - Event command for host which gets called on every check execution if one of these conditions matches + - The host is in a soft state + - The host state changes into a hard state + - The host state recovers from a soft or hard state to OK/Up + type: str + check_interval: + description: + - Your regular check interval. + type: str + disabled: + description: + - Disabled objects will not be deployed. + default: false + type: bool + choices: + - true + - false + imports: + description: + - Choose a host-template. + type: list + elements: str + zone: + description: + - Set the zone. + type: str + vars: + description: + - Custom properties of the host. + type: dict + notes: + description: + - Additional notes for this object. + type: str + version_added: 1.8.0 + 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 + has_agent: + description: + - Whether this host has the Icinga 2 Agent installed. + type: bool + choices: + - true + - false + version_added: 1.9.0 + master_should_connect: + description: + - Whether the parent (master) node should actively try to connect to this agent. + type: bool + choices: + - true + - false + version_added: 1.9.0 + accept_config: + description: + - Whether the agent is configured to accept config. + type: bool + choices: + - true + - false + version_added: 1.9.0 + icinga_hosts: + description: + - A list of Icinga hosts to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Icinga object name for this host. + - This is usually a fully qualified host name but it could basically be any kind of string. + - To make things easier for your users we strongly suggest to use meaningful names for templates. + - 'For example "generic-host" is ugly, "Standard Linux Server" is easier to understand.' + aliases: + - name + required: true + type: str + display_name: + description: + - Alternative name for this host. Might be a host alias or and kind of string helping your users to identify this host. + type: str + address: + description: + - 'Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with.' + type: str + address6: + description: + - 'Host IPv6 address. Usually an IPv6 address, but may be any kind of address your check plugin is able to deal with.' + type: str + version_added: 1.4.0 + groups: + description: + - Hostgroups that should be directly assigned to this node. Hostgroups can be useful for various reasons. + - You might assign service checks based on assigned hostgroup. They are also often used as an instrument to enforce restricted views in Icinga Web 2. + - Hostgroups can be directly assigned to single hosts or to host templates. + - You might also want to consider assigning hostgroups using apply rules. + type: list + elements: str + default: [] + disabled: + description: + - Disabled objects will not be deployed. + default: false + type: bool + choices: + - true + - false + imports: + description: + - Choose a Host Template. Required when state is C(present). + type: list + elements: str + zone: + description: + - Set the zone. + type: str + vars: + description: + - Custom properties of the host. + type: dict + check_command: + description: + - The name of the check command. + - 'Though this is not required to be defined in the director, you still have to supply a check_command in a host or host-template.' + type: str + notes: + description: + - Additional notes for this object. + type: str + version_added: 1.8.0 + notes_url: + description: + - An URL pointing to additional notes for this object. + - "Separate multiple urls like this \"'http://url1' 'http://url2'\"." + - The maximum length is 255 characters. + type: str + version_added: 1.8.0 + has_agent: + description: + - Whether this host has the Icinga 2 Agent installed. + type: bool + choices: + - true + - false + version_added: 1.9.0 + master_should_connect: + description: + - Whether the parent (master) node should actively try to connect to this agent. + type: bool + choices: + - true + - false + version_added: 1.9.0 + accept_config: + description: + - Whether the agent is configured to accept config. + type: bool + choices: + - true + - false + version_added: 1.9.0 + icinga_command_templates: + description: + - A list of Icinga command_templat to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + command: + description: + - The command Icinga should run. + - 'Absolute paths are accepted as provided, relative paths are prefixed with "PluginDir + ", similar Constant prefixes are allowed.' + - Spaces will lead to separation of command path and standalone arguments. + - Please note that this means that we do not support spaces in plugin names and paths right now. + type: str + command_type: + description: + - Plugin Check commands are what you need when running checks against your infrastructure. + - Notification commands will be used when it comes to notify your users. + - Event commands allow you to trigger specific actions when problems occur. + - 'Some people use them for auto-healing mechanisms, like restarting services or rebooting systems at specific thresholds.' + choices: + - PluginCheck + - PluginNotification + - PluginEvent + default: PluginCheck + type: str + disabled: + description: + - Disabled objects will not be deployed. + type: bool + default: false + choices: + - true + - false + object_name: + description: + - Name of the command template. + aliases: + - name + required: true + type: str + imports: + description: + - 'Importable templates, add as many as you want. Please note that order matters when importing properties from multiple templates - last one wins.' + type: list + elements: str + timeout: + description: + - Optional command timeout. Allowed values are seconds or durations postfixed with a specific unit (for example 1m or also 3m 30s). + type: str + zone: + description: + - Icinga cluster zone. Allows to manually override Directors decisions of where to deploy your config to. + - You should consider not doing so unless you gained deep understanding of how an Icinga Cluster stack works. + type: str + vars: + description: + - Custom properties of the command template. + type: dict + arguments: + description: + - Arguments of the command template. + type: dict + icinga_commands: + description: + - A list of Icinga commands to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + command: + description: + - The command Icinga should run. Required when state is C(present). + - 'Absolute paths are accepted as provided, relative paths are prefixed with "PluginDir + ", similar Constant prefixes are allowed.' + - Spaces will lead to separation of command path and standalone arguments. + - Please note that this means that we do not support spaces in plugin names and paths right now. + type: str + command_type: + description: + - Plugin Check commands are what you need when running checks against your infrastructure. + - Notification commands will be used when it comes to notify your users. + - Event commands allow you to trigger specific actions when problems occur. + - 'Some people use them for auto-healing mechanisms, like restarting services or rebooting systems at specific thresholds.' + choices: + - PluginCheck + - PluginNotification + - PluginEvent + default: PluginCheck + type: str + disabled: + description: + - Disabled objects will not be deployed. + type: bool + default: false + choices: + - true + - false + object_name: + description: + - Name of the command. + aliases: + - name + required: true + type: str + imports: + description: + - 'Importable templates, add as many as you want. Please note that order matters when importing properties from multiple templates - last one wins.' + type: list + elements: str + timeout: + description: + - Optional command timeout. Allowed values are seconds or durations postfixed with a specific unit (for example 1m or also 3m 30s). + type: str + zone: + description: + - Icinga cluster zone. Allows to manually override Directors decisions of where to deploy your config to. + - You should consider not doing so unless you gained deep understanding of how an Icinga Cluster stack works. + type: str + vars: + description: + - Custom properties of the command. + type: dict + arguments: + description: + - Arguments of the command. + type: dict + icinga_services: + description: + - A list of Icinga services to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Name of the service. + aliases: + - name + required: true + type: str + check_command: + description: + - Check command definition. + type: str + check_interval: + description: + - Your regular check interval. + type: str + check_period: + description: + - The name of a time period which determines when this object should be monitored. Not limited by default. + type: str + check_timeout: + description: + - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + 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 + enable_perfdata: + description: + - Whether to process performance data provided by this object. + type: bool + groups: + 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. + type: list + elements: str + default: [] + host: + description: + - Choose the host this single service should be assigned to. + required: true + type: str + imports: + description: + - 'Importable templates, add as many as you want.' + - Please note that order matters when importing properties from multiple templates - last one wins. + type: list + elements: str + default: [] + max_check_attempts: + description: + - Defines after how many check attempts a new hard state is reached. + type: str + notes: + description: + - Additional notes for this object. + type: str + version_added: 1.8.0 + 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 + retry_interval: + description: + - 'Retry interval, will be applied after a state change unless the next hard state is reached.' + type: str + use_agent: + description: + - Whether the check command for this service should be executed on the Icinga agent. + type: bool + vars: + description: + - Custom properties of the service. + type: dict + default: {} + volatile: + description: + - Whether this check is volatile. + type: bool + disabled: + description: + - Disabled objects will not be deployed. + type: bool + default: false + choices: + - true + - false + icinga_service_templates: + description: + - A list of Icinga service_templat to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Name of the service template. + aliases: + - name + required: true + type: str + check_command: + description: + - Check command definition. + type: str + check_interval: + description: + - Your regular check interval. + type: str + check_period: + description: + - The name of a time period which determines when this object should be monitored. Not limited by default. + type: str + check_timeout: + description: + - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + 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 + enable_perfdata: + description: + - Whether to process performance data provided by this object. + type: bool + event_command: + description: + - Event command for service which gets called on every check execution if one of these conditions matches + - The service is in a soft state + - The service state changes into a hard state + - The service state recovers from a soft or hard state to OK/Up + type: str + groups: + 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. + type: list + elements: str + default: [] + imports: + description: + - 'Importable templates, add as many as you want.' + - Please note that order matters when importing properties from multiple templates - last one wins. + type: list + elements: str + default: [] + max_check_attempts: + description: + - Defines after how many check attempts a new hard state is reached. + type: str + notes: + description: + - Additional notes for this object. + type: str + version_added: 1.8.0 + 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 + retry_interval: + description: + - 'Retry interval, will be applied after a state change unless the next hard state is reached.' + type: str + use_agent: + description: + - Whether the check commmand for this service should be executed on the Icinga agent. + type: bool + vars: + description: + - Custom properties of the service template. + type: dict + default: {} + volatile: + description: + - Whether this check is volatile. + type: bool + disabled: + description: + - Disabled objects will not be deployed. + type: bool + default: false + choices: + - true + - false + icinga_service_applies: + description: + - A list of Icinga service_applies to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Name for the Icinga service apply rule. + aliases: + - name + required: true + type: str + display_name: + description: + - Alternative displayed name of the service apply rule. + type: str + check_command: + description: + - Check command definition. + type: str + version_added: 1.7.0 + check_interval: + description: + - Your regular check interval. + required: false + type: str + check_period: + description: + - The name of a time period which determines when this object should be monitored. Not limited by default. + required: false + type: str + check_timeout: + description: + - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + required: false + type: str + enable_active_checks: + description: + - Whether to actively check this object. + required: false + type: bool + enable_event_handler: + description: + - Whether to enable event handlers this object. + required: false + type: bool + enable_notifications: + description: + - Whether to send notifications for this object. + required: false + type: bool + enable_passive_checks: + description: + - Whether to accept passive check results for this object. + required: false + type: bool + enable_perfdata: + description: + - Whether to process performance data provided by this object. + required: false + type: bool + max_check_attempts: + description: + - Defines after how many check attempts a new hard state is reached. + required: false + type: str + retry_interval: + description: + - 'Retry interval, will be applied after a state change unless the next hard state is reached.' + required: false + type: str + groups: + 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. + type: list + elements: str + apply_for: + description: + - Evaluates the apply for rule for all objects with the custom attribute specified. + - 'For example selecting "host.vars.custom_attr" will generate "for (config in host.vars.array_var)" where "config" will be accessible through "$config$".' + - 'Note - only custom variables of type "Array" are eligible.' + type: str + assign_filter: + description: + - The filter where the service apply rule will take effect. + type: str + command_endpoint: + description: + - The host where the service should be executed on. + type: str + imports: + description: + - 'Importable templates, add as many as you want.' + - Please note that order matters when importing properties from multiple templates - last one wins. + type: list + elements: str + vars: + description: + - Custom properties of the service apply rule. + type: dict + notes: + description: + - Additional notes for this object. + type: str + 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 + icinga_servicegroups: + description: + - A list of Icinga sservicegroups to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Name for the Icinga servicegroup. + aliases: + - name + required: true + type: str + display_name: + description: + - An alternative display name for this group. + - If you wonder how this could be helpful just leave it blank. + type: str + assign_filter: + description: + - This allows you to configure an assignment filter. + - Please feel free to combine as many nested operators as you want. + type: str + icinga_notifications: + description: + - A list of Icinga notifications to configure + type: list + elements: str + options: + state: + description: + - Apply feature state. + choices: + - present + - absent + default: present + type: str + object_name: + description: + - Name of the notification. + aliases: + - name + required: true + type: str + notification_interval: + description: + - The notification interval (in seconds). This interval is used for active notifications. + - 'Defaults to 30 minutes. If set to 0, re-notifications are disabled.' + type: str + types: + description: + - The state transition types you want to get notifications for. + type: list + elements: str + users: + description: + - Users that should be notified by this notification. + type: list + elements: str + states: + description: + - The host or service states you want to get notifications for. + type: list + elements: str + version_added: 1.9.0 + apply_to: + description: + - Whether this notification should affect hosts or services. + required: true + type: str + choices: + - host + - service + assign_filter: + description: + - The filter where the notification will take effect. + type: str + imports: + description: + - 'Importable templates, add as many as you want. Required when state is C(present).' + - Please note that order matters when importing properties from multiple templates - last one wins. + type: list + elements: str + disabled: + description: + - Disabled objects will not be deployed. + type: bool + default: false + choices: + - true + - false + version_added: 1.9.0 + vars: + description: + - Custom properties of the notification. + type: dict + version_added: 1.9.0 + time_period: + description: + - The name of a time period which determines when this notification should be triggered. + type: str + aliases: + - period + version_added: 1.15.0 + times_begin: + description: + - First notification delay. + - Delay unless the first notification should be sent. + type: int + version_added: 1.15.0 + times_end: + description: + - Last notification. + - When the last notification should be sent. + type: int + version_added: 1.15.0 + user_groups: + description: + - User Groups that should be notified by this notification. + type: list + elements: str + version_added: 1.16.0 From bf426f58479d9184502952c6c6481797e05ddae9 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Thu, 24 Jun 2021 10:10:40 +0200 Subject: [PATCH 4/9] fix linting --- roles/ansible_icinga/meta/argument_specs.yml | 463 ++++++++++++++----- 1 file changed, 351 insertions(+), 112 deletions(-) diff --git a/roles/ansible_icinga/meta/argument_specs.yml b/roles/ansible_icinga/meta/argument_specs.yml index 918ef14e..9bab780f 100644 --- a/roles/ansible_icinga/meta/argument_specs.yml +++ b/roles/ansible_icinga/meta/argument_specs.yml @@ -1,43 +1,73 @@ +--- argument_specs: main: short_description: Configure an Icinga instance with Icinga Director description: - - The main entry point includes all tasks for objects that can be created with the role. + - >- + The main entry point includes all tasks for objects that can be created + with the role. options: icinga_url: description: - - 'HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path' + - >- + HTTP, HTTPS, or FTP URL in the form + (http|https|ftp)://[user[:pass]]@host.domain[:port]/path type: str icinga_url_password: description: - - "The password for use in HTTP basic authentication. If the `url_username' parameter is not specified, the `url_password' parameter will not be used." + - >- + The password for use in HTTP basic authentication. If the + `url_username' parameter is not specified, the `url_password' + parameter will not be used. type: str icinga_url_username: description: - - "The username for use in HTTP basic authentication. This parameter can be used without `url_password' for sites that allow empty passwords" + - >- + The username for use in HTTP basic authentication. This parameter + can be used without `url_password' for sites that allow empty + passwords type: str icinga_use_gssapi: description: - - "Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos through Negotiate authentication. Requires the Python library gssapi to be installed. Credentials for GSSAPI can be specified with `url_username'/`url_password' or with the GSSAPI env var `KRB5CCNAME' that specified a custom Kerberos credential cache. NTLM authentication is `not' supported even if the GSSAPI mech for NTLM has been installed." + - >- + Use GSSAPI to perform the authentication, typically this is for + Kerberos or Kerberos through Negotiate authentication. Requires the + Python library gssapi to be installed. Credentials for GSSAPI can be specified + with `url_username'/`url_password' or with the GSSAPI env var + `KRB5CCNAME' that specified a custom Kerberos credential cache. NTLM + authentication is `not' supported even if the GSSAPI mech for NTLM + has been installed. default: false type: bool icinga_use_proxy: description: - - "If `no', it will not use a proxy, even if one is defined in an environment variable on the target hosts." + - >- + If `no', it will not use a proxy, even if one is defined in an + environment variable on the target hosts. default: true type: bool icinga_validate_certs: description: - - "If `no', SSL certificates will not be validated. icinga_This should only be used on personally controlled sites using selfigned certificates." + - >- + If `no', SSL certificates will not be validated. icinga_This should + only be used on personally controlled sites using selfigned + certificates. default: true type: bool icinga_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, `client_key' is not required." + - >- + 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, `client_key' is not required. type: path icinga_client_key: description: - - "PEM formatted file that contains your private key to be used for SSL client authentication. If `client_cert' contains both the certificate and key, this option is not required." + - >- + PEM formatted file that contains your private key to be used for SSL + client authentication. If `client_cert' contains both the + certificate and key, this option is not required. type: path icinga_timeperiods: description: @@ -66,7 +96,9 @@ argument_specs: imports: description: - 'Importable templates, add as many as you want.' - - Please note that order matters when importing properties from multiple templates - last one wins. + - >- + Please note that order matters when importing properties from + multiple templates - last one wins. type: list elements: str ranges: @@ -96,12 +128,16 @@ argument_specs: imports: description: - 'Importable templates, add as many as you want.' - - Please note that order matters when importing properties from multiple templates - last one wins. + - >- + Please note that order matters when importing properties from + multiple templates - last one wins. type: list elements: str period: description: - - The name of a time period which determines when notifications to this User should be triggered. Not set by default. + - >- + The name of a time period which determines when notifications to + this User should be triggered. Not set by default. type: str enable_notifications: description: @@ -131,12 +167,16 @@ argument_specs: display_name: description: - Alternative name for this user. - - 'In case your object name is a username, this could be the full name of the corresponding person.' + - >- + In case your object name is a username, this could be the full + name of the corresponding person. type: str imports: description: - 'Importable templates, add as many as you want.' - - Please note that order matters when importing properties from multiple templates - last one wins. + - >- + Please note that order matters when importing properties from + multiple templates - last one wins. type: list elements: str pager: @@ -145,7 +185,9 @@ argument_specs: type: str period: description: - - The name of a time period which determines when notifications to this User should be triggered. Not set by default. + - >- + The name of a time period which determines when notifications to + this User should be triggered. Not set by default. type: str disabled: description: @@ -162,7 +204,9 @@ argument_specs: groups: description: - User groups that should be directly assigned to this user. - - Groups can be useful for various reasons. You might prefer to send notifications to groups instead of single users. + - >- + Groups can be useful for various reasons. You might prefer to + send notifications to groups instead of single users. type: list elements: str icinga_endpoints: @@ -182,9 +226,15 @@ argument_specs: object_name: description: - Icinga object name for this endpoint. - - This is usually a fully qualified host name but it could basically be any kind of string. - - To make things easier for your users we strongly suggest to use meaningful names for templates. - - 'For example "generic-endpoint" is ugly, "Standard Linux Server" is easier to understand.' + - >- + This is usually a fully qualified host name but it could + basically be any kind of string. + - >- + To make things easier for your users we strongly suggest to use + meaningful names for templates. + - >- + For example "generic-endpoint" is ugly, "Standard Linux Server" + is easier to understand. required: true aliases: - name @@ -195,11 +245,18 @@ argument_specs: type: str port: description: - - The service name/port of the remote Icinga 2 instance. Defaults to 5665. + - >- + The service name/port of the remote Icinga 2 instance. Defaults + to 5665. type: int log_duration: description: - - 'Duration for keeping replay logs on connection loss. Defaults to 1d (86400 seconds). Attribute is specified in seconds. If log_duration is set to 0, replaying logs is disabled. You could also specify the value in human readable format like 10m for 10 minutes or 1h for one hour.' + - >- + Duration for keeping replay logs on connection loss. Defaults to + 1d (86400 seconds). Attribute is specified in seconds. If + log_duration is set to 0, replaying logs is disabled. You could + also specify the value in human readable format like 10m for 10 + minutes or 1h for one hour. type: str zone: description: @@ -222,16 +279,24 @@ argument_specs: object_name: description: - Icinga object name for this zone. - - This is usually a fully qualified host name but it could basically be any kind of string. - - To make things easier for your users we strongly suggest to use meaningful names for templates. - - 'For example "generic-zone" is ugly, "Standard Linux Server" is easier to understand.' + - >- + This is usually a fully qualified host name but it could + basically be any kind of string. + - >- + To make things easier for your users we strongly suggest to use + meaningful names for templates. + - >- + For example "generic-zone" is ugly, "Standard Linux Server" is + easier to understand. aliases: - name required: true type: str is_global: description: - - Whether configuration files for this zone should be synced to all endpoints. + - >- + Whether configuration files for this zone should be synced to + all endpoints. default: false type: bool parent: @@ -267,7 +332,9 @@ argument_specs: assign_filter: description: - This allows you to configure an assignment filter. - - Please feel free to combine as many nested operators as you want. + - >- + Please feel free to combine as many nested operators as you + want. type: str icinga_host_templates: description: @@ -286,9 +353,15 @@ argument_specs: object_name: description: - Icinga object name for this host template. - - This is usually a fully qualified host name but it could basically be any kind of string. - - To make things easier for your users we strongly suggest to use meaningful names for templates. - - 'For example "generic-host" is ugly, "Standard Linux Server" is easier to understand.' + - >- + This is usually a fully qualified host name but it could + basically be any kind of string. + - >- + To make things easier for your users we strongly suggest to use + meaningful names for templates. + - >- + For example "generic-host" is ugly, "Standard Linux Server" is + easier to understand. aliases: - name required: true @@ -296,33 +369,52 @@ argument_specs: display_name: description: - Alternative name for this host. - - Might be a host alias or and kind of string helping your users to identify this host. + - >- + Might be a host alias or and kind of string helping your users + to identify this host. type: str address: description: - - 'Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with.' + - >- + Host address. Usually an IPv4 address, but may be any kind of + address your check plugin is able to deal with. type: str address6: description: - - 'Host IPv6 address. Usually an IPv64 address, but may be any kind of address your check plugin is able to deal with.' + - >- + Host IPv6 address. Usually an IPv64 address, but may be any kind + of address your check plugin is able to deal with. type: str groups: description: - - Hostgroups that should be directly assigned to this node. Hostgroups can be useful for various reasons. - - You might assign service checks based on assigned hostgroup. They are also often used as an instrument to enforce restricted views in Icinga Web 2. - - Hostgroups can be directly assigned to single hosts or to host templates. - - You might also want to consider assigning hostgroups using apply rules. + - >- + Hostgroups that should be directly assigned to this node. + Hostgroups can be useful for various reasons. + - >- + You might assign service checks based on assigned hostgroup. + They are also often used as an instrument to enforce restricted + views in Icinga Web 2. + - >- + Hostgroups can be directly assigned to single hosts or to host + templates. + - >- + You might also want to consider assigning hostgroups using apply + rules. type: list elements: str default: [] check_command: description: - The name of the check command. - - 'Though this is not required to be defined in the director, you still have to supply a check_command in a host or host-template.' + - >- + Though this is not required to be defined in the director, you + still have to supply a check_command in a host or host-template. type: str event_command: description: - - Event command for host which gets called on every check execution if one of these conditions matches + - >- + Event command for host which gets called on every check + execution if one of these conditions matches - The host is in a soft state - The host state changes into a hard state - The host state recovers from a soft or hard state to OK/Up @@ -360,7 +452,7 @@ argument_specs: notes_url: description: - An URL pointing to additional notes for this object. - - "Separate multiple urls like this \"'http://url1' 'http://url2'\"." + - Separate multiple urls like this "http://url1 http://url2" - Maximum length is 255 characters. type: str version_added: 1.8.0 @@ -374,7 +466,9 @@ argument_specs: version_added: 1.9.0 master_should_connect: description: - - Whether the parent (master) node should actively try to connect to this agent. + - >- + Whether the parent (master) node should actively try to connect + to this agent. type: bool choices: - true @@ -405,32 +499,53 @@ argument_specs: object_name: description: - Icinga object name for this host. - - This is usually a fully qualified host name but it could basically be any kind of string. - - To make things easier for your users we strongly suggest to use meaningful names for templates. - - 'For example "generic-host" is ugly, "Standard Linux Server" is easier to understand.' + - >- + This is usually a fully qualified host name but it could + basically be any kind of string. + - >- + To make things easier for your users we strongly suggest to use + meaningful names for templates. + - >- + For example "generic-host" is ugly, "Standard Linux Server" is + easier to understand. aliases: - name required: true type: str display_name: description: - - Alternative name for this host. Might be a host alias or and kind of string helping your users to identify this host. + - >- + Alternative name for this host. Might be a host alias or and + kind of string helping your users to identify this host. type: str address: description: - - 'Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with.' + - >- + Host address. Usually an IPv4 address, but may be any kind of + address your check plugin is able to deal with. type: str address6: description: - - 'Host IPv6 address. Usually an IPv6 address, but may be any kind of address your check plugin is able to deal with.' + - >- + Host IPv6 address. Usually an IPv6 address, but may be any kind + of address your check plugin is able to deal with. type: str version_added: 1.4.0 groups: description: - - Hostgroups that should be directly assigned to this node. Hostgroups can be useful for various reasons. - - You might assign service checks based on assigned hostgroup. They are also often used as an instrument to enforce restricted views in Icinga Web 2. - - Hostgroups can be directly assigned to single hosts or to host templates. - - You might also want to consider assigning hostgroups using apply rules. + - >- + Hostgroups that should be directly assigned to this node. + Hostgroups can be useful for various reasons. + - >- + You might assign service checks based on assigned hostgroup. + They are also often used as an instrument to enforce restricted + views in Icinga Web 2. + - >- + Hostgroups can be directly assigned to single hosts or to host + templates. + - >- + You might also want to consider assigning hostgroups using apply + rules. type: list elements: str default: [] @@ -458,7 +573,9 @@ argument_specs: check_command: description: - The name of the check command. - - 'Though this is not required to be defined in the director, you still have to supply a check_command in a host or host-template.' + - >- + Though this is not required to be defined in the director, you + still have to supply a check_command in a host or host-template. type: str notes: description: @@ -468,7 +585,7 @@ argument_specs: notes_url: description: - An URL pointing to additional notes for this object. - - "Separate multiple urls like this \"'http://url1' 'http://url2'\"." + - Separate multiple urls like this "http://url1 http://url2" - The maximum length is 255 characters. type: str version_added: 1.8.0 @@ -482,7 +599,9 @@ argument_specs: version_added: 1.9.0 master_should_connect: description: - - Whether the parent (master) node should actively try to connect to this agent. + - >- + Whether the parent (master) node should actively try to connect + to this agent. type: bool choices: - true @@ -513,16 +632,31 @@ argument_specs: command: description: - The command Icinga should run. - - 'Absolute paths are accepted as provided, relative paths are prefixed with "PluginDir + ", similar Constant prefixes are allowed.' - - Spaces will lead to separation of command path and standalone arguments. - - Please note that this means that we do not support spaces in plugin names and paths right now. + - >- + Absolute paths are accepted as provided, relative paths are + prefixed with "PluginDir + ", similar Constant prefixes are + allowed. + - >- + Spaces will lead to separation of command path and standalone + arguments. + - >- + Please note that this means that we do not support spaces in + plugin names and paths right now. type: str command_type: description: - - Plugin Check commands are what you need when running checks against your infrastructure. - - Notification commands will be used when it comes to notify your users. - - Event commands allow you to trigger specific actions when problems occur. - - 'Some people use them for auto-healing mechanisms, like restarting services or rebooting systems at specific thresholds.' + - >- + Plugin Check commands are what you need when running checks + against your infrastructure. + - >- + Notification commands will be used when it comes to notify your + users. + - >- + Event commands allow you to trigger specific actions when + problems occur. + - >- + Some people use them for auto-healing mechanisms, like + restarting services or rebooting systems at specific thresholds. choices: - PluginCheck - PluginNotification @@ -546,17 +680,27 @@ argument_specs: type: str imports: description: - - 'Importable templates, add as many as you want. Please note that order matters when importing properties from multiple templates - last one wins.' + - >- + Importable templates, add as many as you want. Please note that + order matters when importing properties from multiple templates + - last one wins. type: list elements: str timeout: description: - - Optional command timeout. Allowed values are seconds or durations postfixed with a specific unit (for example 1m or also 3m 30s). + - >- + Optional command timeout. Allowed values are seconds or + durations postfixed with a specific unit (for example 1m or also + 3m 30s). type: str zone: description: - - Icinga cluster zone. Allows to manually override Directors decisions of where to deploy your config to. - - You should consider not doing so unless you gained deep understanding of how an Icinga Cluster stack works. + - >- + Icinga cluster zone. Allows to manually override Directors + decisions of where to deploy your config to. + - >- + You should consider not doing so unless you gained deep + understanding of how an Icinga Cluster stack works. type: str vars: description: @@ -582,17 +726,34 @@ argument_specs: type: str command: description: - - The command Icinga should run. Required when state is C(present). - - 'Absolute paths are accepted as provided, relative paths are prefixed with "PluginDir + ", similar Constant prefixes are allowed.' - - Spaces will lead to separation of command path and standalone arguments. - - Please note that this means that we do not support spaces in plugin names and paths right now. + - >- + The command Icinga should run. Required when state is + C(present). + - >- + Absolute paths are accepted as provided, relative paths are + prefixed with "PluginDir + ", similar Constant prefixes are + allowed. + - >- + Spaces will lead to separation of command path and standalone + arguments. + - >- + Please note that this means that we do not support spaces in + plugin names and paths right now. type: str command_type: description: - - Plugin Check commands are what you need when running checks against your infrastructure. - - Notification commands will be used when it comes to notify your users. - - Event commands allow you to trigger specific actions when problems occur. - - 'Some people use them for auto-healing mechanisms, like restarting services or rebooting systems at specific thresholds.' + - >- + Plugin Check commands are what you need when running checks + against your infrastructure. + - >- + Notification commands will be used when it comes to notify your + users. + - >- + Event commands allow you to trigger specific actions when + problems occur. + - >- + Some people use them for auto-healing mechanisms, like + restarting services or rebooting systems at specific thresholds. choices: - PluginCheck - PluginNotification @@ -616,17 +777,27 @@ argument_specs: type: str imports: description: - - 'Importable templates, add as many as you want. Please note that order matters when importing properties from multiple templates - last one wins.' + - >- + Importable templates, add as many as you want. Please note that + order matters when importing properties from multiple templates + - last one wins. type: list elements: str timeout: description: - - Optional command timeout. Allowed values are seconds or durations postfixed with a specific unit (for example 1m or also 3m 30s). + - >- + Optional command timeout. Allowed values are seconds or + durations postfixed with a specific unit (for example 1m or also + 3m 30s). type: str zone: description: - - Icinga cluster zone. Allows to manually override Directors decisions of where to deploy your config to. - - You should consider not doing so unless you gained deep understanding of how an Icinga Cluster stack works. + - >- + Icinga cluster zone. Allows to manually override Directors + decisions of where to deploy your config to. + - >- + You should consider not doing so unless you gained deep + understanding of how an Icinga Cluster stack works. type: str vars: description: @@ -667,11 +838,15 @@ argument_specs: type: str check_period: description: - - The name of a time period which determines when this object should be monitored. Not limited by default. + - >- + The name of a time period which determines when this object + should be monitored. Not limited by default. type: str check_timeout: description: - - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + - >- + Check command timeout in seconds. Overrides the CheckCommand's + timeout attribute. type: str enable_active_checks: description: @@ -697,8 +872,13 @@ argument_specs: 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. + - >- + 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. type: list elements: str default: [] @@ -710,13 +890,17 @@ argument_specs: imports: description: - 'Importable templates, add as many as you want.' - - Please note that order matters when importing properties from multiple templates - last one wins. + - >- + Please note that order matters when importing properties from + multiple templates - last one wins. type: list elements: str default: [] max_check_attempts: description: - - Defines after how many check attempts a new hard state is reached. + - >- + Defines after how many check attempts a new hard state is + reached. type: str notes: description: @@ -726,17 +910,21 @@ argument_specs: notes_url: description: - An URL pointing to additional notes for this object. - - "Separate multiple urls like this \"'http://url1' 'http://url2'\"." + - Separate multiple urls like this "http://url1 http://url2" - Maximum length is 255 characters. type: str version_added: 1.8.0 retry_interval: description: - - 'Retry interval, will be applied after a state change unless the next hard state is reached.' + - >- + Retry interval, will be applied after a state change unless the + next hard state is reached. type: str use_agent: description: - - Whether the check command for this service should be executed on the Icinga agent. + - >- + Whether the check command for this service should be executed on + the Icinga agent. type: bool vars: description: @@ -786,11 +974,15 @@ argument_specs: type: str check_period: description: - - The name of a time period which determines when this object should be monitored. Not limited by default. + - >- + The name of a time period which determines when this object + should be monitored. Not limited by default. type: str check_timeout: description: - - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + - >- + Check command timeout in seconds. Overrides the CheckCommand's + timeout attribute. type: str enable_active_checks: description: @@ -814,7 +1006,9 @@ argument_specs: type: bool event_command: description: - - Event command for service which gets called on every check execution if one of these conditions matches + - >- + Event command for service which gets called on every check + execution if one of these conditions matches - The service is in a soft state - The service state changes into a hard state - The service state recovers from a soft or hard state to OK/Up @@ -823,21 +1017,30 @@ argument_specs: 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. + - >- + 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. type: list elements: str default: [] imports: description: - 'Importable templates, add as many as you want.' - - Please note that order matters when importing properties from multiple templates - last one wins. + - >- + Please note that order matters when importing properties from + multiple templates - last one wins. type: list elements: str default: [] max_check_attempts: description: - - Defines after how many check attempts a new hard state is reached. + - >- + Defines after how many check attempts a new hard state is + reached. type: str notes: description: @@ -847,17 +1050,21 @@ argument_specs: notes_url: description: - An URL pointing to additional notes for this object. - - "Separate multiple urls like this \"'http://url1' 'http://url2'\"." + - Separate multiple urls like this "http://url1 http://url2" - Maximum length is 255 characters. type: str version_added: 1.8.0 retry_interval: description: - - 'Retry interval, will be applied after a state change unless the next hard state is reached.' + - >- + Retry interval, will be applied after a state change unless the + next hard state is reached. type: str use_agent: description: - - Whether the check commmand for this service should be executed on the Icinga agent. + - >- + Whether the check commmand for this service should be executed + on the Icinga agent. type: bool vars: description: @@ -913,12 +1120,16 @@ argument_specs: type: str check_period: description: - - The name of a time period which determines when this object should be monitored. Not limited by default. + - >- + The name of a time period which determines when this object + should be monitored. Not limited by default. required: false type: str check_timeout: description: - - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + - >- + Check command timeout in seconds. Overrides the CheckCommand's + timeout attribute. required: false type: str enable_active_checks: @@ -948,27 +1159,41 @@ argument_specs: type: bool max_check_attempts: description: - - Defines after how many check attempts a new hard state is reached. + - >- + Defines after how many check attempts a new hard state is + reached. required: false type: str retry_interval: description: - - 'Retry interval, will be applied after a state change unless the next hard state is reached.' + - >- + Retry interval, will be applied after a state change unless the + next hard state is reached. required: false type: str groups: 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. + - >- + 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. type: list elements: str apply_for: description: - - Evaluates the apply for rule for all objects with the custom attribute specified. - - 'For example selecting "host.vars.custom_attr" will generate "for (config in host.vars.array_var)" where "config" will be accessible through "$config$".' - - 'Note - only custom variables of type "Array" are eligible.' + - >- + Evaluates the apply for rule for all objects with the custom + attribute specified. + - >- + For example selecting "host.vars.custom_attr" will generate "for + (config in host.vars.array_var)" where "config" will be + accessible through "$config$". + - Note - only custom variables of type "Array" are eligible. type: str assign_filter: description: @@ -981,7 +1206,9 @@ argument_specs: imports: description: - 'Importable templates, add as many as you want.' - - Please note that order matters when importing properties from multiple templates - last one wins. + - >- + Please note that order matters when importing properties from + multiple templates - last one wins. type: list elements: str vars: @@ -995,7 +1222,7 @@ argument_specs: notes_url: description: - An URL pointing to additional notes for this object. - - "Separate multiple urls like this \"'http://url1' 'http://url2'\"." + - Separate multiple urls like this "http://url1 http://url2" - Maximum length is 255 characters. type: str icinga_servicegroups: @@ -1027,7 +1254,9 @@ argument_specs: assign_filter: description: - This allows you to configure an assignment filter. - - Please feel free to combine as many nested operators as you want. + - >- + Please feel free to combine as many nested operators as you + want. type: str icinga_notifications: description: @@ -1052,8 +1281,12 @@ argument_specs: type: str notification_interval: description: - - The notification interval (in seconds). This interval is used for active notifications. - - 'Defaults to 30 minutes. If set to 0, re-notifications are disabled.' + - >- + The notification interval (in seconds). This interval is used + for active notifications. + - >- + Defaults to 30 minutes. If set to 0, re-notifications are + disabled. type: str types: description: @@ -1085,8 +1318,12 @@ argument_specs: type: str imports: description: - - 'Importable templates, add as many as you want. Required when state is C(present).' - - Please note that order matters when importing properties from multiple templates - last one wins. + - >- + Importable templates, add as many as you want. Required when + state is C(present). + - >- + Please note that order matters when importing properties from + multiple templates - last one wins. type: list elements: str disabled: @@ -1105,7 +1342,9 @@ argument_specs: version_added: 1.9.0 time_period: description: - - The name of a time period which determines when this notification should be triggered. + - >- + The name of a time period which determines when this + notification should be triggered. type: str aliases: - period From a62db6fdf4a963c7acd48b1622c888f5e1d84de0 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Mon, 7 Aug 2023 08:41:07 +0200 Subject: [PATCH 5/9] Add role argument spec for icinga role --- roles/ansible_icinga/meta/argument_specs.yml | 196 ++++++++----------- 1 file changed, 86 insertions(+), 110 deletions(-) diff --git a/roles/ansible_icinga/meta/argument_specs.yml b/roles/ansible_icinga/meta/argument_specs.yml index 9bab780f..f0ae6208 100644 --- a/roles/ansible_icinga/meta/argument_specs.yml +++ b/roles/ansible_icinga/meta/argument_specs.yml @@ -7,68 +7,6 @@ argument_specs: The main entry point includes all tasks for objects that can be created with the role. options: - icinga_url: - description: - - >- - HTTP, HTTPS, or FTP URL in the form - (http|https|ftp)://[user[:pass]]@host.domain[:port]/path - type: str - icinga_url_password: - description: - - >- - The password for use in HTTP basic authentication. If the - `url_username' parameter is not specified, the `url_password' - parameter will not be used. - type: str - icinga_url_username: - description: - - >- - The username for use in HTTP basic authentication. This parameter - can be used without `url_password' for sites that allow empty - passwords - type: str - icinga_use_gssapi: - description: - - >- - Use GSSAPI to perform the authentication, typically this is for - Kerberos or Kerberos through Negotiate authentication. Requires the - Python library gssapi to be installed. Credentials for GSSAPI can be specified - with `url_username'/`url_password' or with the GSSAPI env var - `KRB5CCNAME' that specified a custom Kerberos credential cache. NTLM - authentication is `not' supported even if the GSSAPI mech for NTLM - has been installed. - default: false - type: bool - icinga_use_proxy: - description: - - >- - If `no', it will not use a proxy, even if one is defined in an - environment variable on the target hosts. - default: true - type: bool - icinga_validate_certs: - description: - - >- - If `no', SSL certificates will not be validated. icinga_This should - only be used on personally controlled sites using selfigned - certificates. - default: true - type: bool - icinga_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, `client_key' is not required. - type: path - icinga_client_key: - description: - - >- - PEM formatted file that contains your private key to be used for SSL - client authentication. If `client_cert' contains both the - certificate and key, this option is not required. - type: path icinga_timeperiods: description: - A list of Icinga timeperiods to configure @@ -83,11 +21,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Name of the time period. - aliases: - - name type: str display_name: description: @@ -118,11 +54,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Name of the user template. - aliases: - - name required: true type: str imports: @@ -157,11 +91,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Name of the user. - aliases: - - name required: true type: str display_name: @@ -223,7 +155,7 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Icinga object name for this endpoint. - >- @@ -236,8 +168,6 @@ argument_specs: For example "generic-endpoint" is ugly, "Standard Linux Server" is easier to understand. required: true - aliases: - - name type: str host: description: @@ -276,7 +206,7 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Icinga object name for this zone. - >- @@ -288,8 +218,6 @@ argument_specs: - >- For example "generic-zone" is ugly, "Standard Linux Server" is easier to understand. - aliases: - - name required: true type: str is_global: @@ -317,11 +245,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Icinga object name for this hostgroup. - aliases: - - name required: true type: str display_name: @@ -350,7 +276,7 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Icinga object name for this host template. - >- @@ -362,8 +288,6 @@ argument_specs: - >- For example "generic-host" is ugly, "Standard Linux Server" is easier to understand. - aliases: - - name required: true type: str display_name: @@ -496,7 +420,7 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Icinga object name for this host. - >- @@ -508,8 +432,6 @@ argument_specs: - >- For example "generic-host" is ugly, "Standard Linux Server" is easier to understand. - aliases: - - name required: true type: str display_name: @@ -562,6 +484,7 @@ argument_specs: - Choose a Host Template. Required when state is C(present). type: list elements: str + required: true zone: description: - Set the zone. @@ -671,11 +594,9 @@ argument_specs: choices: - true - false - object_name: + name: description: - Name of the command template. - aliases: - - name required: true type: str imports: @@ -768,11 +689,9 @@ argument_specs: choices: - true - false - object_name: + name: description: - Name of the command. - aliases: - - name required: true type: str imports: @@ -821,11 +740,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Name of the service. - aliases: - - name required: true type: str check_command: @@ -957,11 +874,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Name of the service template. - aliases: - - name required: true type: str check_command: @@ -1097,11 +1012,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Name for the Icinga service apply rule. - aliases: - - name required: true type: str display_name: @@ -1239,11 +1152,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Name for the Icinga servicegroup. - aliases: - - name required: true type: str display_name: @@ -1272,11 +1183,9 @@ argument_specs: - absent default: present type: str - object_name: + name: description: - Name of the notification. - aliases: - - name required: true type: str notification_interval: @@ -1345,9 +1254,7 @@ argument_specs: - >- The name of a time period which determines when this notification should be triggered. - type: str - aliases: - - period + type: strod version_added: 1.15.0 times_begin: description: @@ -1367,3 +1274,72 @@ argument_specs: type: list elements: str version_added: 1.16.0 + icinga_service_apply: + short_description: Configure an Icinga instance with Icinga Director + description: + - >- + The main entry point includes all tasks for objects that can be created + with the role. + options: + icinga_url: + description: + - >- + HTTP, HTTPS, or FTP URL in the form + (http|https|ftp)://[user[:pass]]@host.domain[:port]/path + type: str + icinga_url_password: + description: + - >- + The password for use in HTTP basic authentication. If the + `url_username' parameter is not specified, the `url_password' + parameter will not be used. + type: str + icinga_url_username: + description: + - >- + The username for use in HTTP basic authentication. This parameter + can be used without `url_password' for sites that allow empty + passwords + type: str + icinga_use_gssapi: + description: + - >- + Use GSSAPI to perform the authentication, typically this is for + Kerberos or Kerberos through Negotiate authentication. Requires the + Python library gssapi to be installed. Credentials for GSSAPI can be specified + with `url_username'/`url_password' or with the GSSAPI env var + `KRB5CCNAME' that specified a custom Kerberos credential cache. NTLM + authentication is `not' supported even if the GSSAPI mech for NTLM + has been installed. + default: false + type: bool + icinga_use_proxy: + description: + - >- + If `no', it will not use a proxy, even if one is defined in an + environment variable on the target hosts. + default: true + type: bool + icinga_validate_certs: + description: + - >- + If `no', SSL certificates will not be validated. icinga_This should + only be used on personally controlled sites using selfigned + certificates. + default: true + type: bool + icinga_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, `client_key' is not required. + type: path + icinga_client_key: + description: + - >- + PEM formatted file that contains your private key to be used for SSL + client authentication. If `client_cert' contains both the + certificate and key, this option is not required. + type: path From 0f3df4ebc5fe77f4038712f1ec32706c8e115023 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Mon, 4 Dec 2023 15:52:25 +0100 Subject: [PATCH 6/9] add argument spec and updated readme --- .aar_doc.yml | 72 + roles/ansible_icinga/README.md | 2286 ++++++++++++++++-- roles/ansible_icinga/meta/argument_specs.yml | 14 +- roles/ansible_icinga/meta/main.yml | 5 +- 4 files changed, 2126 insertions(+), 251 deletions(-) create mode 100644 .aar_doc.yml diff --git a/.aar_doc.yml b/.aar_doc.yml new file mode 100644 index 00000000..9991be7f --- /dev/null +++ b/.aar_doc.yml @@ -0,0 +1,72 @@ +output_template: | + + # Ansible Role: {{ role }} + --- + {%- if "version" in galaxy_collection %} + Version: {{ galaxy_collection.version }} + {% endif %} + {{ metadata.galaxy_info.description }} + {% if ("galaxy_tags" in metadata.galaxy_info) and (metadata.galaxy_info.galaxy_tags | length > 0) %} + Tags: {{ metadata.galaxy_info.galaxy_tags | join(', ') }} + {%- endif %} + + ## Requirements + --- + | Platform | Versions | + | -------- | -------- | + {%- for platform in metadata.galaxy_info.platforms %} + | {{ platform.name }} | {{ platform.versions | default([]) | join(', ') }} | + {%- endfor %} + + ## Supported Operating Systems + + {%- for platform in metadata.galaxy_info.platforms %} + - {{ platform.name }} + {%- if "versions" in platform %} + - {{ platform.versions | default([]) | join(', ') }} + {%- endif %} + {%- endfor %} + + ## Role Variables + {% for entrypoint in argument_specs.keys() %} + {%- set path, options=entrypoint_options[entrypoint][0] -%} + {%- for name, details in options.items() |sort() %} + - `{{ name }}`: + - Default: `{{ details.display_default }}` + - Description: {{ details.display_description }} + - Type: {{ details.display_type }} + - Required: {{ details.display_required }} + {% if details.options -%} + - Options: + {% for key, value in details.options.items() %} + - `{{ key }}`: + - description: + {% for line in value.description %} + - "{{ line }}" + {% endfor %} + {%- if value.choices %} + - Choices: + {%- for choice in value.choices %} + - {{ choice }} + {%- endfor %} + {%- endif %} + - default: "{{ value.default }}" + - type: "{{ value.type }}" + - required: "{{ value.display_required }}" + {% endfor %} + {%- endif %} + {%- endfor %} + {%- endfor %} + + ## Dependencies + + {%- if ("dependencies" in metadata) and (metadata.dependencies | length > 0) %} + {%- for dependency in metadata.dependencies %} + - {{ dependency }} + {%- endfor %} + {%- else %} + + None. + {%- endif %} + + diff --git a/roles/ansible_icinga/README.md b/roles/ansible_icinga/README.md index 8fb3f58d..767e6962 100644 --- a/roles/ansible_icinga/README.md +++ b/roles/ansible_icinga/README.md @@ -1,257 +1,2064 @@ -# Ansible Icinga + +# Ansible Role: telekom_mms.icinga_director.ansible_icinga +--- +Version: 1.35.0 This role is used to configure an Icinga Instance over its Icinga Director. -## Installation - -* create a `requirements.yml`: +Tags: icinga -```bash +## Requirements --- -collections: - - name: telekom_mms.icinga_director - src: https://github.com/telekom_mms/ansible-collection-icinga-director - version: 1.2.2 -``` +| Platform | Versions | +| -------- | -------- | +| all | | -* install the collections: +## Supported Operating Systems +- all -```bash -ansible-galaxy collection install -r requirements.yml -p collections/ -``` +## Role Variables + +- `icinga_command_templates`: + - Default: `` + - Description: A list of Icinga command_templat to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `command`: + - description: + + - "The command Icinga should run." + + - "Absolute paths are accepted as provided, relative paths are prefixed with "PluginDir + ", similar Constant prefixes are allowed." + + - "Spaces will lead to separation of command path and standalone arguments." + + - "Please note that this means that we do not support spaces in plugin names and paths right now." + + - default: "" + - type: "str" + - required: "no" + + - `command_type`: + - description: + + - "Plugin Check commands are what you need when running checks against your infrastructure." + + - "Notification commands will be used when it comes to notify your users." + + - "Event commands allow you to trigger specific actions when problems occur." + + - "Some people use them for auto-healing mechanisms, like restarting services or rebooting systems at specific thresholds." + + - Choices: + - PluginCheck + - PluginNotification + - PluginEvent + - default: "PluginCheck" + - type: "str" + - required: "no" + + - `disabled`: + - description: + + - "Disabled objects will not be deployed." + + - Choices: + - True + - False + - default: "False" + - type: "bool" + - required: "no" + + - `name`: + - description: + + - "Name of the command template." + + - default: "" + - type: "str" + - required: "yes" + + - `imports`: + - description: + + - "Importable templates, add as many as you want. Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "" + - type: "list" + - required: "no" + + - `timeout`: + - description: + + - "Optional command timeout. Allowed values are seconds or durations postfixed with a specific unit (for example 1m or also 3m 30s)." + + - default: "" + - type: "str" + - required: "no" + + - `zone`: + - description: + + - "Icinga cluster zone. Allows to manually override Directors decisions of where to deploy your config to." + + - "You should consider not doing so unless you gained deep understanding of how an Icinga Cluster stack works." + + - default: "" + - type: "str" + - required: "no" + + - `vars`: + - description: + + - "Custom properties of the command template." + + - default: "" + - type: "dict" + - required: "no" + + - `arguments`: + - description: + + - "Arguments of the command template." + + - default: "" + - type: "dict" + - required: "no" + +- `icinga_commands`: + - Default: `` + - Description: A list of Icinga commands to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `command`: + - description: + + - "The command Icinga should run. Required when state is C(present)." + + - "Absolute paths are accepted as provided, relative paths are prefixed with "PluginDir + ", similar Constant prefixes are allowed." + + - "Spaces will lead to separation of command path and standalone arguments." + + - "Please note that this means that we do not support spaces in plugin names and paths right now." + + - default: "" + - type: "str" + - required: "no" + + - `command_type`: + - description: + + - "Plugin Check commands are what you need when running checks against your infrastructure." + + - "Notification commands will be used when it comes to notify your users." + + - "Event commands allow you to trigger specific actions when problems occur." + + - "Some people use them for auto-healing mechanisms, like restarting services or rebooting systems at specific thresholds." + + - Choices: + - PluginCheck + - PluginNotification + - PluginEvent + - default: "PluginCheck" + - type: "str" + - required: "no" + + - `disabled`: + - description: + + - "Disabled objects will not be deployed." + + - Choices: + - True + - False + - default: "False" + - type: "bool" + - required: "no" + + - `name`: + - description: + + - "Name of the command." + + - default: "" + - type: "str" + - required: "yes" + + - `imports`: + - description: + + - "Importable templates, add as many as you want. Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "" + - type: "list" + - required: "no" + + - `timeout`: + - description: + + - "Optional command timeout. Allowed values are seconds or durations postfixed with a specific unit (for example 1m or also 3m 30s)." + + - default: "" + - type: "str" + - required: "no" + + - `zone`: + - description: + + - "Icinga cluster zone. Allows to manually override Directors decisions of where to deploy your config to." + + - "You should consider not doing so unless you gained deep understanding of how an Icinga Cluster stack works." + + - default: "" + - type: "str" + - required: "no" + + - `vars`: + - description: + + - "Custom properties of the command." + + - default: "" + - type: "dict" + - required: "no" + + - `arguments`: + - description: + + - "Arguments of the command." + + - default: "" + - type: "dict" + - required: "no" + +- `icinga_endpoints`: + - Default: `` + - Description: A list of Icinga endpoints to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Icinga object name for this endpoint." + + - "This is usually a fully qualified host name but it could basically be any kind of string." + + - "To make things easier for your users we strongly suggest to use meaningful names for templates." + + - "For example "generic-endpoint" is ugly, "Standard Linux Server" is easier to understand." + + - default: "" + - type: "str" + - required: "yes" + + - `host`: + - description: + + - "The hostname/IP address of the remote Icinga 2 instance." + + - default: "" + - type: "str" + - required: "no" + + - `port`: + - description: + + - "The service name/port of the remote Icinga 2 instance. Defaults to 5665." + + - default: "" + - type: "int" + - required: "no" + + - `log_duration`: + - description: + + - "Duration for keeping replay logs on connection loss. Defaults to 1d (86400 seconds). Attribute is specified in seconds. If log_duration is set to 0, replaying logs is disabled. You could also specify the value in human readable format like 10m for 10 minutes or 1h for one hour." + + - default: "" + - type: "str" + - required: "no" + + - `zone`: + - description: + + - "The name of the zone this endpoint is part of." + + - default: "" + - type: "str" + - required: "no" + +- `icinga_host_templates`: + - Default: `` + - Description: A list of Icinga host_templates to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Icinga object name for this host template." + + - "This is usually a fully qualified host name but it could basically be any kind of string." + + - "To make things easier for your users we strongly suggest to use meaningful names for templates." + + - "For example "generic-host" is ugly, "Standard Linux Server" is easier to understand." + + - default: "" + - type: "str" + - required: "yes" + + - `display_name`: + - description: + + - "Alternative name for this host." + + - "Might be a host alias or and kind of string helping your users to identify this host." + + - default: "" + - type: "str" + - required: "no" + + - `address`: + - description: + + - "Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with." + + - default: "" + - type: "str" + - required: "no" + + - `address6`: + - description: + + - "Host IPv6 address. Usually an IPv64 address, but may be any kind of address your check plugin is able to deal with." + + - default: "" + - type: "str" + - required: "no" + + - `groups`: + - description: + + - "Hostgroups that should be directly assigned to this node. Hostgroups can be useful for various reasons." + + - "You might assign service checks based on assigned hostgroup. They are also often used as an instrument to enforce restricted views in Icinga Web 2." + + - "Hostgroups can be directly assigned to single hosts or to host templates." + + - "You might also want to consider assigning hostgroups using apply rules." + + - default: "[]" + - type: "list" + - required: "no" + + - `check_command`: + - description: + + - "The name of the check command." + + - "Though this is not required to be defined in the director, you still have to supply a check_command in a host or host-template." + + - default: "" + - type: "str" + - required: "no" + + - `event_command`: + - description: + + - "Event command for host which gets called on every check execution if one of these conditions matches" + + - "The host is in a soft state" + + - "The host state changes into a hard state" + + - "The host state recovers from a soft or hard state to OK/Up" + + - default: "" + - type: "str" + - required: "no" + + - `check_interval`: + - description: + + - "Your regular check interval." + + - default: "" + - type: "str" + - required: "no" + + - `disabled`: + - description: + + - "Disabled objects will not be deployed." + + - Choices: + - True + - False + - default: "False" + - type: "bool" + - required: "no" + + - `imports`: + - description: + + - "Choose a host-template." + + - default: "" + - type: "list" + - required: "no" + + - `zone`: + - description: + + - "Set the zone." + + - default: "" + - type: "str" + - required: "no" + + - `vars`: + - description: + + - "Custom properties of the host." + + - default: "" + - type: "dict" + - required: "no" + + - `notes`: + - description: + + - "Additional notes for this object." + + - default: "" + - type: "str" + - required: "no" + + - `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." + + - default: "" + - type: "str" + - required: "no" + + - `has_agent`: + - description: + + - "Whether this host has the Icinga 2 Agent installed." + + - Choices: + - True + - False + - default: "" + - type: "bool" + - required: "no" + + - `master_should_connect`: + - description: + + - "Whether the parent (master) node should actively try to connect to this agent." + + - Choices: + - True + - False + - default: "" + - type: "bool" + - required: "no" + + - `accept_config`: + - description: + + - "Whether the agent is configured to accept config." + + - Choices: + - True + - False + - default: "" + - type: "bool" + - required: "no" + +- `icinga_hostgroups`: + - Default: `` + - Description: A list of Icinga hostgroups to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Icinga object name for this hostgroup." + + - default: "" + - type: "str" + - required: "yes" + + - `display_name`: + - description: + + - "An alternative display name for this group." + + - "If you wonder how this could be helpful just leave it blank." + + - default: "" + - type: "str" + - required: "no" + + - `assign_filter`: + - description: + + - "This allows you to configure an assignment filter." + + - "Please feel free to combine as many nested operators as you want." + + - default: "" + - type: "str" + - required: "no" + +- `icinga_hosts`: + - Default: `` + - Description: A list of Icinga hosts to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Icinga object name for this host." + + - "This is usually a fully qualified host name but it could basically be any kind of string." + + - "To make things easier for your users we strongly suggest to use meaningful names for templates." + + - "For example "generic-host" is ugly, "Standard Linux Server" is easier to understand." + + - default: "" + - type: "str" + - required: "yes" + + - `display_name`: + - description: + + - "Alternative name for this host. Might be a host alias or and kind of string helping your users to identify this host." + + - default: "" + - type: "str" + - required: "no" + + - `address`: + - description: + + - "Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with." + + - default: "" + - type: "str" + - required: "no" + + - `address6`: + - description: + + - "Host IPv6 address. Usually an IPv6 address, but may be any kind of address your check plugin is able to deal with." + + - default: "" + - type: "str" + - required: "no" + + - `groups`: + - description: + + - "Hostgroups that should be directly assigned to this node. Hostgroups can be useful for various reasons." + + - "You might assign service checks based on assigned hostgroup. They are also often used as an instrument to enforce restricted views in Icinga Web 2." + + - "Hostgroups can be directly assigned to single hosts or to host templates." + + - "You might also want to consider assigning hostgroups using apply rules." + + - default: "[]" + - type: "list" + - required: "no" + + - `disabled`: + - description: + + - "Disabled objects will not be deployed." + + - Choices: + - True + - False + - default: "False" + - type: "bool" + - required: "no" + + - `imports`: + - description: + + - "Choose a Host Template. Required when state is C(present)." + + - default: "" + - type: "list" + - required: "no" + + - `zone`: + - description: + + - "Set the zone." + + - default: "" + - type: "str" + - required: "no" + + - `vars`: + - description: + + - "Custom properties of the host." + + - default: "" + - type: "dict" + - required: "no" + + - `check_command`: + - description: + + - "The name of the check command." + + - "Though this is not required to be defined in the director, you still have to supply a check_command in a host or host-template." + + - default: "" + - type: "str" + - required: "no" + + - `notes`: + - description: + + - "Additional notes for this object." + + - default: "" + - type: "str" + - required: "no" + + - `notes_url`: + - description: + + - "An URL pointing to additional notes for this object." + + - "Separate multiple urls like this "http://url1 http://url2"" + + - "The maximum length is 255 characters." + + - default: "" + - type: "str" + - required: "no" + + - `has_agent`: + - description: + + - "Whether this host has the Icinga 2 Agent installed." + + - Choices: + - True + - False + - default: "" + - type: "bool" + - required: "no" + + - `master_should_connect`: + - description: + + - "Whether the parent (master) node should actively try to connect to this agent." + + - Choices: + - True + - False + - default: "" + - type: "bool" + - required: "no" + + - `accept_config`: + - description: + + - "Whether the agent is configured to accept config." + + - Choices: + - True + - False + - default: "" + - type: "bool" + - required: "no" + +- `icinga_notifications`: + - Default: `` + - Description: A list of Icinga notifications to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Name of the notification." + + - default: "" + - type: "str" + - required: "yes" + + - `notification_interval`: + - description: + + - "The notification interval (in seconds). This interval is used for active notifications." + + - "Defaults to 30 minutes. If set to 0, re-notifications are disabled." + + - default: "" + - type: "str" + - required: "no" + + - `types`: + - description: + + - "The state transition types you want to get notifications for." + + - default: "" + - type: "list" + - required: "no" + + - `users`: + - description: + + - "Users that should be notified by this notification." + + - default: "" + - type: "list" + - required: "no" + + - `states`: + - description: + + - "The host or service states you want to get notifications for." + + - default: "" + - type: "list" + - required: "no" + + - `apply_to`: + - description: + + - "Whether this notification should affect hosts or services." + + - Choices: + - host + - service + - default: "" + - type: "str" + - required: "yes" + + - `assign_filter`: + - description: + + - "The filter where the notification will take effect." + + - default: "" + - type: "str" + - required: "no" + + - `imports`: + - description: + + - "Importable templates, add as many as you want. Required when state is C(present)." + + - "Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "" + - type: "list" + - required: "no" + + - `disabled`: + - description: + + - "Disabled objects will not be deployed." + + - Choices: + - True + - False + - default: "False" + - type: "bool" + - required: "no" + + - `vars`: + - description: + + - "Custom properties of the notification." + + - default: "" + - type: "dict" + - required: "no" + + - `time_period`: + - description: + + - "The name of a time period which determines when this notification should be triggered." + + - default: "" + - type: "strod" + - required: "no" + + - `times_begin`: + - description: + + - "First notification delay." + + - "Delay unless the first notification should be sent." + + - default: "" + - type: "int" + - required: "no" + + - `times_end`: + - description: + + - "Last notification." + + - "When the last notification should be sent." + + - default: "" + - type: "int" + - required: "no" + + - `user_groups`: + - description: + + - "User Groups that should be notified by this notification." + + - default: "" + - type: "list" + - required: "no" + +- `icinga_service_applies`: + - Default: `` + - Description: A list of Icinga service_applies to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Name for the Icinga service apply rule." + + - default: "" + - type: "str" + - required: "yes" + + - `display_name`: + - description: + + - "Alternative displayed name of the service apply rule." + + - default: "" + - type: "str" + - required: "no" + + - `check_command`: + - description: + + - "Check command definition." + + - default: "" + - type: "str" + - required: "no" + + - `check_interval`: + - description: + + - "Your regular check interval." + + - default: "" + - type: "str" + - required: "no" + + - `check_period`: + - description: + + - "The name of a time period which determines when this object should be monitored. Not limited by default." + + - default: "" + - type: "str" + - required: "no" + + - `check_timeout`: + - description: + + - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + + - default: "" + - type: "str" + - required: "no" + + - `enable_active_checks`: + - description: + + - "Whether to actively check this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_event_handler`: + - description: + + - "Whether to enable event handlers this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_notifications`: + - description: + + - "Whether to send notifications for this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_passive_checks`: + - description: + + - "Whether to accept passive check results for this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_perfdata`: + - description: + + - "Whether to process performance data provided by this object." + + - default: "" + - type: "bool" + - required: "no" + + - `max_check_attempts`: + - description: + + - "Defines after how many check attempts a new hard state is reached." + + - default: "" + - type: "str" + - required: "no" + + - `retry_interval`: + - description: + + - "Retry interval, will be applied after a state change unless the next hard state is reached." + + - default: "" + - type: "str" + - required: "no" + + - `groups`: + - 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." + + - default: "" + - type: "list" + - required: "no" + + - `apply_for`: + - description: + + - "Evaluates the apply for rule for all objects with the custom attribute specified." + + - "For example selecting "host.vars.custom_attr" will generate "for (config in host.vars.array_var)" where "config" will be accessible through "$config$"." + + - "Note - only custom variables of type "Array" are eligible." + + - default: "" + - type: "str" + - required: "no" + + - `assign_filter`: + - description: + + - "The filter where the service apply rule will take effect." + + - default: "" + - type: "str" + - required: "no" + + - `command_endpoint`: + - description: + + - "The host where the service should be executed on." + + - default: "" + - type: "str" + - required: "no" + + - `imports`: + - description: + + - "Importable templates, add as many as you want." + + - "Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "" + - type: "list" + - required: "no" + + - `vars`: + - description: + + - "Custom properties of the service apply rule." + + - default: "" + - type: "dict" + - required: "no" + + - `notes`: + - description: + + - "Additional notes for this object." + + - default: "" + - type: "str" + - required: "no" + + - `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." + + - default: "" + - type: "str" + - required: "no" + +- `icinga_service_templates`: + - Default: `` + - Description: A list of Icinga service_templat to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Name of the service template." + + - default: "" + - type: "str" + - required: "yes" + + - `check_command`: + - description: + + - "Check command definition." + + - default: "" + - type: "str" + - required: "no" + + - `check_interval`: + - description: + + - "Your regular check interval." + + - default: "" + - type: "str" + - required: "no" + + - `check_period`: + - description: + + - "The name of a time period which determines when this object should be monitored. Not limited by default." + + - default: "" + - type: "str" + - required: "no" + + - `check_timeout`: + - description: + + - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + + - default: "" + - type: "str" + - required: "no" + + - `enable_active_checks`: + - description: + + - "Whether to actively check this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_event_handler`: + - description: + + - "Whether to enable event handlers this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_notifications`: + - description: + + - "Whether to send notifications for this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_passive_checks`: + - description: + + - "Whether to accept passive check results for this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_perfdata`: + - description: + + - "Whether to process performance data provided by this object." + + - default: "" + - type: "bool" + - required: "no" + + - `event_command`: + - description: + + - "Event command for service which gets called on every check execution if one of these conditions matches" + + - "The service is in a soft state" + + - "The service state changes into a hard state" + + - "The service state recovers from a soft or hard state to OK/Up" + + - default: "" + - type: "str" + - required: "no" + + - `groups`: + - 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." + + - default: "[]" + - type: "list" + - required: "no" + + - `imports`: + - description: + + - "Importable templates, add as many as you want." + + - "Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "[]" + - type: "list" + - required: "no" + + - `max_check_attempts`: + - description: + + - "Defines after how many check attempts a new hard state is reached." + + - default: "" + - type: "str" + - required: "no" + + - `notes`: + - description: + + - "Additional notes for this object." + + - default: "" + - type: "str" + - required: "no" + + - `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." + + - default: "" + - type: "str" + - required: "no" + + - `retry_interval`: + - description: + + - "Retry interval, will be applied after a state change unless the next hard state is reached." + + - default: "" + - type: "str" + - required: "no" + + - `use_agent`: + - description: + + - "Whether the check command for this service should be executed on the Icinga agent." + + - default: "" + - type: "bool" + - required: "no" + + - `vars`: + - description: + + - "Custom properties of the service template." + + - default: "{}" + - type: "dict" + - required: "no" + + - `volatile`: + - description: + + - "Whether this check is volatile." + + - default: "" + - type: "bool" + - required: "no" + + - `disabled`: + - description: + + - "Disabled objects will not be deployed." + + - Choices: + - True + - False + - default: "False" + - type: "bool" + - required: "no" + +- `icinga_servicegroups`: + - Default: `` + - Description: A list of Icinga sservicegroups to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Name for the Icinga servicegroup." + + - default: "" + - type: "str" + - required: "yes" + + - `display_name`: + - description: + + - "An alternative display name for this group." + + - "If you wonder how this could be helpful just leave it blank." + + - default: "" + - type: "str" + - required: "no" + + - `assign_filter`: + - description: + + - "This allows you to configure an assignment filter." + + - "Please feel free to combine as many nested operators as you want." + + - default: "" + - type: "str" + - required: "no" + +- `icinga_services`: + - Default: `` + - Description: A list of Icinga services to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Name of the service." + + - default: "" + - type: "str" + - required: "yes" + + - `check_command`: + - description: + + - "Check command definition." + + - default: "" + - type: "str" + - required: "no" + + - `check_interval`: + - description: + + - "Your regular check interval." + + - default: "" + - type: "str" + - required: "no" + + - `check_period`: + - description: + + - "The name of a time period which determines when this object should be monitored. Not limited by default." + + - default: "" + - type: "str" + - required: "no" + + - `check_timeout`: + - description: + + - "Check command timeout in seconds. Overrides the CheckCommand's timeout attribute." + + - default: "" + - type: "str" + - required: "no" + + - `enable_active_checks`: + - description: + + - "Whether to actively check this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_event_handler`: + - description: + + - "Whether to enable event handlers this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_notifications`: + - description: + + - "Whether to send notifications for this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_passive_checks`: + - description: + + - "Whether to accept passive check results for this object." + + - default: "" + - type: "bool" + - required: "no" + + - `enable_perfdata`: + - description: + + - "Whether to process performance data provided by this object." + + - default: "" + - type: "bool" + - required: "no" + + - `groups`: + - 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." + + - default: "[]" + - type: "list" + - required: "no" + + - `host`: + - description: + + - "Choose the host this single service should be assigned to." + + - default: "" + - type: "str" + - required: "yes" + + - `imports`: + - description: + + - "Importable templates, add as many as you want." + + - "Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "[]" + - type: "list" + - required: "no" + + - `max_check_attempts`: + - description: + + - "Defines after how many check attempts a new hard state is reached." + + - default: "" + - type: "str" + - required: "no" + + - `notes`: + - description: + + - "Additional notes for this object." + + - default: "" + - type: "str" + - required: "no" + + - `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." + + - default: "" + - type: "str" + - required: "no" + + - `retry_interval`: + - description: + + - "Retry interval, will be applied after a state change unless the next hard state is reached." + + - default: "" + - type: "str" + - required: "no" + + - `use_agent`: + - description: + + - "Whether the check command for this service should be executed on the Icinga agent." + + - default: "" + - type: "bool" + - required: "no" + + - `vars`: + - description: + + - "Custom properties of the service." + + - default: "{}" + - type: "dict" + - required: "no" + + - `volatile`: + - description: + + - "Whether this check is volatile." + + - default: "" + - type: "bool" + - required: "no" + + - `disabled`: + - description: + + - "Disabled objects will not be deployed." + + - Choices: + - True + - False + - default: "False" + - type: "bool" + - required: "no" + +- `icinga_timeperiods`: + - Default: `` + - Description: A list of Icinga timeperiods to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Name of the time period." + + - default: "" + - type: "str" + - required: "no" + + - `display_name`: + - description: + + - "Alternative name for this timeperiod." + + - default: "" + - type: "str" + - required: "no" + + - `imports`: + - description: + + - "Importable templates, add as many as you want." + + - "Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "" + - type: "list" + - required: "no" + + - `ranges`: + - description: + + - "A" + + - " " + + - "d" + + - "i" + + - "c" + + - "t" + + - " " + + - "o" + + - "f" + + - " " + + - "d" + + - "a" + + - "y" + + - "s" + + - " " + + - "a" + + - "n" + + - "d" + + - " " + + - "t" + + - "i" + + - "m" + + - "e" + + - "p" + + - "e" + + - "r" + + - "i" + + - "o" + + - "d" + + - "s" + + - "." + + - default: "" + - type: "dict" + - required: "no" + +- `icinga_user_templates`: + - Default: `` + - Description: A list of Icinga user_templates to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Name of the user template." + + - default: "" + - type: "str" + - required: "yes" + + - `imports`: + - description: + + - "Importable templates, add as many as you want." + + - "Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "" + - type: "list" + - required: "no" + + - `period`: + - description: + + - "The name of a time period which determines when notifications to this User should be triggered. Not set by default." + + - default: "" + - type: "str" + - required: "no" + + - `enable_notifications`: + - description: + + - "Whether to send notifications for this user." + + - default: "" + - type: "bool" + - required: "no" + +- `icinga_users`: + - Default: `` + - Description: A list of Icinga users to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Name of the user." + + - default: "" + - type: "str" + - required: "yes" + + - `display_name`: + - description: + + - "Alternative name for this user." + + - "In case your object name is a username, this could be the full name of the corresponding person." + + - default: "" + - type: "str" + - required: "no" + + - `imports`: + - description: + + - "Importable templates, add as many as you want." + + - "Please note that order matters when importing properties from multiple templates - last one wins." + + - default: "" + - type: "list" + - required: "no" + + - `pager`: + - description: + + - "The pager address of the user." + + - default: "" + - type: "str" + - required: "no" + + - `period`: + - description: + + - "The name of a time period which determines when notifications to this User should be triggered. Not set by default." + + - default: "" + - type: "str" + - required: "no" + + - `disabled`: + - description: + + - "Disabled objects will not be deployed." + + - Choices: + - True + - False + - default: "False" + - type: "bool" + - required: "no" + + - `email`: + - description: + + - "The Email address of the user." + + - default: "" + - type: "str" + - required: "no" + + - `groups`: + - description: + + - "User groups that should be directly assigned to this user." + + - "Groups can be useful for various reasons. You might prefer to send notifications to groups instead of single users." + + - default: "" + - type: "list" + - required: "no" + +- `icinga_zones`: + - Default: `` + - Description: A list of Icinga zones to configure + - Type: list of 'str' + - Required: no + - Options: + + - `state`: + - description: + + - "Apply feature state." + + - Choices: + - present + - absent + - default: "present" + - type: "str" + - required: "no" + + - `name`: + - description: + + - "Icinga object name for this zone." + + - "This is usually a fully qualified host name but it could basically be any kind of string." + + - "To make things easier for your users we strongly suggest to use meaningful names for templates." + + - "For example "generic-zone" is ugly, "Standard Linux Server" is easier to understand." + + - default: "" + - type: "str" + - required: "yes" + + - `is_global`: + - description: + + - "Whether configuration files for this zone should be synced to all endpoints." + + - default: "False" + - type: "bool" + - required: "no" + + - `parent`: + - description: + + - "The name of the parent zone." + + - default: "" + - type: "str" + - required: "no" + +- `icinga_client_cert`: + - Default: `` + - 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, `client_key' is not required. + - Type: path + - Required: no + +- `icinga_client_key`: + - Default: `` + - Description: PEM formatted file that contains your private key to be used for SSL client authentication. If `client_cert' contains both the certificate and key, this option is not required. + - Type: path + - Required: no + +- `icinga_url`: + - Default: `` + - Description: HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path + - Type: str + - Required: no + +- `icinga_url_password`: + - Default: `` + - Description: The password for use in HTTP basic authentication. If the `url_username' parameter is not specified, the `url_password' parameter will not be used. + - Type: str + - Required: no + +- `icinga_url_username`: + - Default: `` + - Description: The username for use in HTTP basic authentication. This parameter can be used without `url_password' for sites that allow empty passwords + - Type: str + - Required: no + +- `icinga_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 gssapi to be installed. Credentials for GSSAPI can be specified with `url_username'/`url_password' or with the GSSAPI env var `KRB5CCNAME' that specified a custom Kerberos credential cache. NTLM authentication is `not' supported even if the GSSAPI mech for NTLM has been installed. + - Type: bool + - Required: no + +- `icinga_use_proxy`: + - Default: `true` + - Description: If `no', it will not use a proxy, even if one is defined in an environment variable on the target hosts. + - Type: bool + - Required: no + +- `icinga_validate_certs`: + - Default: `true` + - Description: If `no', SSL certificates will not be validated. icinga_This should only be used on personally controlled sites using selfigned certificates. + - Type: bool + - Required: no + ## Dependencies -collections: -telekom_mms.icinga_director >= 1.2.2 +None. -## Role Variables - -| Variable | Required | Default | -|-----------------------------------|----------|-----------------------------| -| **icinga** | -| url | yes | -| use_proxy | no | -| validate_certs | no | -| url_username | yes | -| url_password | yes | -| force_basic_auth | no | -| client_cert | no | -| client_key | no | -| **icinga_timeperiod** | -| icinga_timeperiods | no | [] | -| display_name | no | -| imports | no | -| ranges | no | -| **icinga_user_template** | -| icinga_user_templates | no | [] | -| imports | no | -| period | no | -| enable_notifications | no | -| **icinga_user** | -| icinga_users | no | [] | -| display_name | no | -| imports | yes | [] | -| pager | no | -| period | no | -| disabled | no | -| email | yes | null | -| **icinga_user_group** | -| icinga_user_groups | no | [] | -| state | no | present | -| object_name | yes | -| display_name | no | -| disabled | no | -| append | no | -| url | yes | -| force | no | False | -| http_agent | no | ansible-httpget | -| use_proxy | no | True | -| validate_certs | no | True | -| url_username | no | -| url_password | no | -| force_basic_auth | no | False | -| client_cert | no | -| client_key | no | -| use_gssapi | no | False | -| **icinga_zone** | -| icinga_zones | no | [] | -| is_global | no | -| parent | no | -| **icinga_endpoint** | -| icinga_endpoints | no | [] | -| host | no | -| port | no | -| log_duration | no | -| zone | no | -| **icinga_hostgroup** | -| icinga_hostgroups | no | [] | -| display_name | no | -| assign_filter | no | `host.name="hostgroup.1-*"` | -| **icinga_host_template** | -| icinga_host_templates | no | [] | -| display_name | no | -| address | no | -| address6 | no | -| groups | no | -| check_command | no | -| check_interval | no | -| disabled | no | -| imports | no | -| zone | no | -| vars | no | -| notes | no | -| notes_url | no | -| **icinga_host** | -| icinga_hosts | no | [] | -| display_name | no | -| address | no | -| address6 | no | -| groups | no | -| disabled | no | -| imports | yes | [] | -| zone | no | -| vars | no | -| notes | no | -| notes_url | no | -| **icinga_command_template** | -| icinga_command_templates | no | [] | -| display_name | no | -| command | no | -| methods_execute | yes | PluginCheck | -| timeout | no | -| imports | no | -| disabled | no | -| zone | no | -| vars | no | -| arguments | no | -| **icinga_command** | -| icinga_commands | no | [] | -| command_type | yes | PluginCheck | -| disabled | yes | false | -| imports | no | -| zone | no | -| vars | no | -| **icinga_service** | -| icinga_services | no | [] | -| display_name | no | -| disabled | no | -| check_command | no | -| check_interval | no | -| check_period | no | -| check_timeout | no | -| enable_active_checks | no | -| enable_event_handler | no | -| enable_notifications | no | -| enable_passive_checks | no | -| enable_perfdata | no | -| groups | no | -| host | yes | -| imports | no | -| max_check_attempts | no | -| notes | no | -| notes_url | no | -| retry_interval | no | -| use_agent | no | -| vars | no | -| volatile | no | -| **icinga_service_template** | -| icinga_service_templates | no | [] | -| display_name | no | -| disabled | no | -| check_command | no | -| check_interval | no | -| check_period | no | -| check_timeout | no | -| enable_active_checks | no | -| enable_event_handler | no | -| enable_notifications | no | -| enable_passive_checks | no | -| enable_perfdata | no | -| groups | no | -| imports | no | -| max_check_attempts | no | -| notes | no | -| notes_url | no | -| retry_interval | no | -| use_agent | no | -| vars | no | -| volatile | no | -| **icinga_service_apply** | -| icinga_service_applys | no | [] | -| display_name | no | -| groups | no | -| apply_for | no | -| assign_filter | no | -| imports | no | -| vars | no | -| notes | no | -| notes_url | no | -| **icinga_servicegroup** | -| icinga_servicegroups | no | [] | -| display_name | no | -| assign_filter | no | -| **icinga_notification_template** | -| icinga_notification_templates | no | [] | -| notification_template_object | no | -| state | no | -| notification_interval | no | -| states | no | -| types | no | -| times_begin | no | -| times_end | no | -| timeperiod | no | -| users | no | -| user_groups | no | -| notification_command | no | -| imports | no | -| **icinga_notification** | -| icinga_notifications | no | [] | -| notification_interval | no | -| types | no | -| users | no | -| apply_to | no | -| assign_filter | no | -| imports | no | -| period | no | -| **icinga_scheduled_downtime** | -| icinga_scheduled_downtimes | no | [] | -| state | yes | present | -| disabled | no | false | -| assign_filter | no | -| apply_to | yes | -| author | yes | -| comment | yes | -| duration | no | -| fixed | yes | -| ranges | no | -| with_services | no | true | + ## Example Playbook ```bash ---- -- hosts: localhost - gather_facts: false - collections: - - telekom_mms.icinga_director +- hosts: all roles: - - ansible_icinga + - telekom_mms.icinga_director.ansible_icinga vars: icinga_url: "https://example.com" icinga_user: "{{ icinga_user }}" icinga_pass: "{{ icinga_pass }}" icinga_timeperiods: - - timeperiod_object: - - "8x5" + - "8x5": ranges: monday: "09:00-17:00" tuesday: "09:00-17:00" wednesday: "09:00-17:00" thursday: "09:00-17:00" friday: "09:00-17:00" - - timeperiod_object: - - "24x7" + - "24x7" ranges: monday: "00:00-24:00" tuesday: "00:00-24:00" @@ -261,25 +2068,18 @@ telekom_mms.icinga_director >= 1.2.2 saturday: "00:00-24:00" sunday: "00:00-24:00" icinga_users: - - user_object: - - "service_abbreviation_email_24x7" + - "email_24x7" pager: "SIP/xxx" - email: "service_abbreviation@example.com" - - user_object: - - "service_abbreviation_8x5" - email: "service_abbreviation@example.com" + email: "foo@example.com" + - "service_abbreviation_8x5" + email: "foo@example.com" icinga_user_groups: - - user_group_object: - - "user-group-example" + - "user-group-example" display_name: "User Group Example" icinga_hostgroups: - - hostgroup_object: - - "service_abbreviation-environement" - - "service_abbreviation-environement-web" + - "foo hosts" icinga_hosts: - - host_object: - - "service_abbreviation-environement-web01" - icinga_scheduled_downtimes: - - scheduled_downtime_object: - - "service_abbreviation-environement-downtime01" + - "foo-bar-web01" + icinga_scheduled_downtimes: + - "downtime01" ``` diff --git a/roles/ansible_icinga/meta/argument_specs.yml b/roles/ansible_icinga/meta/argument_specs.yml index f0ae6208..78a88b65 100644 --- a/roles/ansible_icinga/meta/argument_specs.yml +++ b/roles/ansible_icinga/meta/argument_specs.yml @@ -31,7 +31,7 @@ argument_specs: type: str imports: description: - - 'Importable templates, add as many as you want.' + - Importable templates, add as many as you want. - >- Please note that order matters when importing properties from multiple templates - last one wins. @@ -61,7 +61,7 @@ argument_specs: type: str imports: description: - - 'Importable templates, add as many as you want.' + - Importable templates, add as many as you want. - >- Please note that order matters when importing properties from multiple templates - last one wins. @@ -105,7 +105,7 @@ argument_specs: type: str imports: description: - - 'Importable templates, add as many as you want.' + - Importable templates, add as many as you want. - >- Please note that order matters when importing properties from multiple templates - last one wins. @@ -806,7 +806,7 @@ argument_specs: type: str imports: description: - - 'Importable templates, add as many as you want.' + - Importable templates, add as many as you want. - >- Please note that order matters when importing properties from multiple templates - last one wins. @@ -944,7 +944,7 @@ argument_specs: default: [] imports: description: - - 'Importable templates, add as many as you want.' + - Importable templates, add as many as you want. - >- Please note that order matters when importing properties from multiple templates - last one wins. @@ -978,7 +978,7 @@ argument_specs: use_agent: description: - >- - Whether the check commmand for this service should be executed + Whether the check command for this service should be executed on the Icinga agent. type: bool vars: @@ -1118,7 +1118,7 @@ argument_specs: type: str imports: description: - - 'Importable templates, add as many as you want.' + - Importable templates, add as many as you want. - >- Please note that order matters when importing properties from multiple templates - last one wins. diff --git a/roles/ansible_icinga/meta/main.yml b/roles/ansible_icinga/meta/main.yml index a8a64532..de1ee749 100644 --- a/roles/ansible_icinga/meta/main.yml +++ b/roles/ansible_icinga/meta/main.yml @@ -2,9 +2,12 @@ collections: - telekom_mms.icinga_director galaxy_info: + role_name: ansible_icinga author: telekom_mms - description: icinga configuration + description: This role is used to configure an Icinga Instance over its Icinga Director. license: GPLv3 min_ansible_version: 2.9 galaxy_tags: - icinga + platforms: + - name: all From 5abd59ee3b67fce163b34374085ab6654662b1b7 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Wed, 6 Dec 2023 12:10:38 +0100 Subject: [PATCH 7/9] Revert "update due to new release" This reverts commit 64b65ad45f4a240ec7b604f949aa96a43d6008c8. --- changelogs/changelog.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 7b88cbdb..ac491287 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -285,6 +285,4 @@ releases: - Update test matrix (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/223) - exclude old python versions with ansible devel (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/225) - Update actions/checkout action to v4 (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/224) - - use telekom-mms renovate preset (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/229) - - Pin dependencies (https://github.com/telekom-mms/ansible-collection-icinga-director/pull/230) release_date: '2023-11-13' From f24c53956bb8385e10ce88e800f24c443f13b97b Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Wed, 6 Dec 2023 12:13:01 +0100 Subject: [PATCH 8/9] add workflow to update readme --- .github/workflows/roles-readme.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/roles-readme.yml diff --git a/.github/workflows/roles-readme.yml b/.github/workflows/roles-readme.yml new file mode 100644 index 00000000..60a6ea2c --- /dev/null +++ b/.github/workflows/roles-readme.yml @@ -0,0 +1,41 @@ +--- +name: create roles readme + +on: # yamllint disable-line rule:truthy + push: + branches: [main] + paths: + - 'roles/*/meta/argument_specs.yml' + - 'roles/*/meta/main.yml' + pull_request: + branches: [main] + paths: + - 'roles/*/meta/argument_specs.yml' + - 'roles/*/meta/main.yml' +jobs: + readme: + name: create roles readme + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install aar_doc + run: pip3 install aar_doc + + - name: Run aar_doc + run: aar_doc --config-file .aar_doc.yml roles/ansible_icinga/ markdown + + - name: Push README + if: github.event_name != 'pull_request' + uses: github-actions-x/commit@v2.9 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + commit-message: 'update readme' + files: README.md + rebase: true From ad7614dd63203a3b72307346395d866e891b01af Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Wed, 6 Dec 2023 16:53:43 +0100 Subject: [PATCH 9/9] Apply suggestions from code review Co-authored-by: schurzi --- roles/ansible_icinga/meta/argument_specs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ansible_icinga/meta/argument_specs.yml b/roles/ansible_icinga/meta/argument_specs.yml index 78a88b65..595ee392 100644 --- a/roles/ansible_icinga/meta/argument_specs.yml +++ b/roles/ansible_icinga/meta/argument_specs.yml @@ -540,7 +540,7 @@ argument_specs: version_added: 1.9.0 icinga_command_templates: description: - - A list of Icinga command_templat to configure + - A list of Icinga command_templates to configure type: list elements: str options: @@ -862,7 +862,7 @@ argument_specs: - false icinga_service_templates: description: - - A list of Icinga service_templat to configure + - A list of Icinga service_templates to configure type: list elements: str options: