setup datadog agent on each host.
- set agent version to 7
This commit is contained in:
1
ansible-5/roles/datadog.datadog/templates/checks.yaml.j2
Normal file
1
ansible-5/roles/datadog.datadog/templates/checks.yaml.j2
Normal file
@@ -0,0 +1 @@
|
||||
{{ datadog_checks[item] | to_nice_yaml }}
|
||||
31
ansible-5/roles/datadog.datadog/templates/datadog.conf.j2
Normal file
31
ansible-5/roles/datadog.datadog/templates/datadog.conf.j2
Normal file
@@ -0,0 +1,31 @@
|
||||
# Managed by Ansible
|
||||
|
||||
[Main]
|
||||
|
||||
{% if datadog_config["dd_url"] is not defined -%}
|
||||
dd_url: {{ datadog_url | default('https://app.datadoghq.com') }}
|
||||
{% endif %}
|
||||
|
||||
{% if datadog_config["api_key"] is not defined -%}
|
||||
api_key: {{ datadog_api_key | default('youshouldsetthis') }}
|
||||
{% endif %}
|
||||
|
||||
{% if datadog_config["use_mount"] is not defined -%}
|
||||
use_mount: {{ datadog_use_mount | default('no') }}
|
||||
{% endif %}
|
||||
|
||||
{# These variables are free-style, passed through a hash -#}
|
||||
{% if datadog_config -%}
|
||||
{% for key, value in datadog_config | dictsort -%}
|
||||
{{ key }}: {{ value }}
|
||||
{% endfor -%}
|
||||
{% endif %}
|
||||
|
||||
{% if datadog_config_ex is defined -%}
|
||||
{% for section, keyvals in datadog_config_ex | dictsort %}
|
||||
[{{ section }}]
|
||||
{% for key, value in keyvals | dictsort -%}
|
||||
{{ key }}: {{ value }}
|
||||
{% endfor -%}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
19
ansible-5/roles/datadog.datadog/templates/datadog.yaml.j2
Normal file
19
ansible-5/roles/datadog.datadog/templates/datadog.yaml.j2
Normal file
@@ -0,0 +1,19 @@
|
||||
# Managed by Ansible
|
||||
|
||||
{% if datadog_site is defined
|
||||
and datadog_config["site"] is not defined -%}
|
||||
site: {{ datadog_site }}
|
||||
{% endif %}
|
||||
|
||||
{% if datadog_config["dd_url"] is not defined
|
||||
and datadog_url is defined -%}
|
||||
dd_url: {{ datadog_url }}
|
||||
{% endif %}
|
||||
|
||||
{% if datadog_config["api_key"] is not defined -%}
|
||||
api_key: {{ datadog_api_key | default('youshouldsetthis') }}
|
||||
{% endif %}
|
||||
|
||||
{% if datadog_config | default({}, true) | length > 0 -%}
|
||||
{{ datadog_config | to_nice_yaml }}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
install_method:
|
||||
tool: ansible
|
||||
tool_version: ansible-{{ ansible_version.full }}
|
||||
installer_version: datadog_role-{{ role_version }}
|
||||
@@ -0,0 +1,12 @@
|
||||
# Managed by Ansible
|
||||
|
||||
{% if runtime_security_config is defined and runtime_security_config | default({}, true) | length > 0 -%}
|
||||
runtime_security_config:
|
||||
{# The "first" option in indent() is only supported by jinja 2.10+
|
||||
while the old equivalent option "indentfirst" is removed in jinja 3.
|
||||
Using non-keyword argument in indent() to be backward compatible.
|
||||
#}
|
||||
{% filter indent(2, True) %}
|
||||
{{ runtime_security_config | to_nice_yaml }}
|
||||
{% endfilter %}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,34 @@
|
||||
# Managed by Ansible
|
||||
|
||||
{% if system_probe_config is defined and system_probe_config | default({}, true) | length > 0 -%}
|
||||
system_probe_config:
|
||||
{# The "first" option in indent() is only supported by jinja 2.10+
|
||||
while the old equivalent option "indentfirst" is removed in jinja 3.
|
||||
Using non-keyword argument in indent() to be backward compatible.
|
||||
#}
|
||||
{% filter indent(2, True) %}
|
||||
{{ system_probe_config | to_nice_yaml }}
|
||||
{% endfilter %}
|
||||
{% endif %}
|
||||
|
||||
{% if network_config is defined and network_config | default({}, true) | length > 0 -%}
|
||||
network_config:
|
||||
{# The "first" option in indent() is only supported by jinja 2.10+
|
||||
while the old equivalent option "indentfirst" is removed in jinja 3.
|
||||
Using non-keyword argument in indent() to be backward compatible.
|
||||
#}
|
||||
{% filter indent(2, True) %}
|
||||
{{ network_config | to_nice_yaml }}
|
||||
{% endfilter %}
|
||||
{% endif %}
|
||||
|
||||
{% if runtime_security_config is defined and runtime_security_config | default({}, true) | length > 0 -%}
|
||||
runtime_security_config:
|
||||
{# The "first" option in indent() is only supported by jinja 2.10+
|
||||
while the old equivalent option "indentfirst" is removed in jinja 3.
|
||||
Using non-keyword argument in indent() to be backward compatible.
|
||||
#}
|
||||
{% filter indent(2, True) %}
|
||||
{{ runtime_security_config | to_nice_yaml }}
|
||||
{% endfilter %}
|
||||
{% endif %}
|
||||
27
ansible-5/roles/datadog.datadog/templates/zypper.repo.j2
Normal file
27
ansible-5/roles/datadog.datadog/templates/zypper.repo.j2
Normal file
@@ -0,0 +1,27 @@
|
||||
{% if datadog_zypper_repo | length > 0 %}
|
||||
{% set baseurl = datadog_zypper_repo %}
|
||||
{% elif datadog_agent_major_version|int == 5 %}
|
||||
{% set baseurl = datadog_agent5_zypper_repo %}
|
||||
{% elif datadog_agent_major_version|int == 6 %}
|
||||
{% set baseurl = datadog_agent6_zypper_repo %}
|
||||
{% elif datadog_agent_major_version|int == 7 %}
|
||||
{% set baseurl = datadog_agent7_zypper_repo %}
|
||||
{% endif %}
|
||||
|
||||
[datadog]
|
||||
name=Datadog, Inc.
|
||||
enabled=1
|
||||
autorefresh=1
|
||||
baseurl={{ baseurl }}
|
||||
|
||||
type=rpm-md
|
||||
gpgcheck={{ datadog_zypper_gpgcheck|int }}
|
||||
repo_gpgcheck={{ do_zypper_repo_gpgcheck|int }}
|
||||
{# zypper in SUSE < 15 will not parse (SUSE 11) or respect (SUSE 12 - 14) mutliple entries in gpgkey #}
|
||||
{% if ansible_distribution_version|int < 15 %}
|
||||
gpgkey={{ datadog_zypper_gpgkey_current }}
|
||||
{% else %}
|
||||
gpgkey={{ datadog_zypper_gpgkey_current }}
|
||||
{{ datadog_zypper_gpgkey_20200908 }}
|
||||
{{ datadog_zypper_gpgkey_e09422b3 }}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user