Ansible Script 추가

This commit is contained in:
ByeonJungHun
2023-12-19 13:36:16 +09:00
parent 0273450ff6
commit 05cb8d9269
2610 changed files with 281893 additions and 0 deletions

View File

@@ -0,0 +1 @@
{{ datadog_checks[item] | to_nice_yaml(indent=2) }}

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>com.datadoghq.agent</string>
<key>EnvironmentVariables</key>
<dict>
<key>DD_LOG_TO_CONSOLE</key>
<string>false</string>
</dict>
<key>ProgramArguments</key>
<array>
<string>/opt/datadog-agent/bin/agent/agent</string>
<string>run</string>
</array>
<key>StandardOutPath</key>
<string>/opt/datadog-agent/logs/launchd.log</string>
<key>StandardErrorPath</key>
<string>/opt/datadog-agent/logs/launchd.log</string>
<key>ExitTimeOut</key>
<integer>10</integer>
<key>UserName</key>
<string>{{ username }}</string>
<key>GroupName</key>
<string>{{ groupname }}</string>
</dict>
</plist>

View File

@@ -0,0 +1,31 @@
# {{ ansible_managed }}
[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 %}

View File

@@ -0,0 +1,19 @@
# {{ ansible_managed }}
{% 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 %}

View File

@@ -0,0 +1,5 @@
---
install_method:
tool: ansible
tool_version: ansible-{{ ansible_version.full }}
installer_version: datadog_role-{{ role_version }}

View File

@@ -0,0 +1,12 @@
# {{ ansible_managed }}
{% 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 %}

View File

@@ -0,0 +1,45 @@
# {{ ansible_managed }}
{% 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 service_monitoring_config is defined and service_monitoring_config | default({}, true) | length > 0 -%}
service_monitoring_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) %}
{{ service_monitoring_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 %}

View 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 %}