-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from DataDog/3.x
3.0 release
- Loading branch information
Showing
14 changed files
with
258 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,64 @@ | ||
{% from "datadog/map.jinja" import datadog_settings with context %} | ||
{% set config_file_path = '%s/%s'|format(datadog_settings.config_folder, datadog_settings.config_file) -%} | ||
{% set example_file_path = '%s.example'|format(config_file_path) -%} | ||
{% from "datadog/map.jinja" import datadog_config, datadog_install_settings, datadog_checks, latest_agent_version, parsed_version with context %} | ||
{% set config_file_path = '%s/%s'|format(datadog_install_settings.config_folder, datadog_install_settings.config_file) -%} | ||
datadog-example: | ||
file.copy: | ||
{%- if not latest_agent_version and parsed_version[1] == '5' %} | ||
datadog_conf_installed: | ||
file.managed: | ||
- name: {{ config_file_path }} | ||
- source: {{ example_file_path }} | ||
# file.copy will not overwrite a named file, so we only need to check if the example config file exists | ||
- onlyif: test -f {{ example_file_path }} | ||
- source: salt://datadog/files/datadog.conf.jinja | ||
- user: dd-agent | ||
- group: dd-agent | ||
- mode: 600 | ||
- template: jinja | ||
- require: | ||
- pkg: datadog-pkg | ||
{% if datadog_settings.api_key is defined %} | ||
datadog-conf-api-key: | ||
file.replace: | ||
{%- else %} | ||
datadog_yaml_installed: | ||
file.managed: | ||
- name: {{ config_file_path }} | ||
- pattern: "api_key:(.*)" | ||
- repl: "api_key: {{ datadog_settings.api_key }}" | ||
- count: 1 | ||
- onlyif: test -f {{ config_file_path }} | ||
- watch: | ||
- source: salt://datadog/files/datadog.yaml.jinja | ||
- user: dd-agent | ||
- group: dd-agent | ||
- mode: 600 | ||
- template: jinja | ||
- require: | ||
- pkg: datadog-pkg | ||
{% endif %} | ||
{%- endif %} | ||
datadog-conf-site: | ||
file.replace: | ||
- name: {{ config_file_path }} | ||
- pattern: "(.*)site:(.*)" | ||
{% if datadog_settings.site is defined %} | ||
- repl: "site: {{ datadog_settings.site }}" | ||
{% else %} | ||
- repl: "# site: datadoghq.com" | ||
{% endif %} | ||
- count: 1 | ||
- onlyif: test -f {{ config_file_path }} | ||
- watch: | ||
- pkg: datadog-pkg | ||
{% if datadog_checks is defined %} | ||
{% for check_name in datadog_checks %} | ||
datadog-conf-python-version: | ||
file.replace: | ||
- name: {{ config_file_path }} | ||
- pattern: "(.*)python_version:(.*)" | ||
{% if datadog_settings.python_version is defined %} | ||
- repl: "python_version: {{ datadog_settings.python_version }}" | ||
{% else %} | ||
- repl: "# python_version: 2" | ||
{% endif %} | ||
- count: 1 | ||
- onlyif: test -f {{ config_file_path }} | ||
- watch: | ||
- pkg: datadog-pkg | ||
{%- if latest_agent_version or parsed_version[1] != '5' %} | ||
datadog_{{ check_name }}_folder_installed: | ||
file.directory: | ||
- name: {{ datadog_install_settings.confd_path }}/{{ check_name }}.d | ||
- user: dd-agent | ||
- group: root | ||
- mode: 700 | ||
{%- endif %} | ||
{% if datadog_settings.checks is defined %} | ||
{% for check_name in datadog_settings.checks %} | ||
datadog_{{ check_name }}_yaml_installed: | ||
file.managed: | ||
- name: {{ datadog_settings.checks_confd }}/{{ check_name }}.yaml | ||
{%- if latest_agent_version or parsed_version[1] != '5' %} | ||
- name: {{ datadog_install_settings.confd_path }}/{{ check_name }}.d/conf.yaml | ||
{%- else %} | ||
- name: {{ datadog_install_settings.confd_path }}/{{ check_name }}.yaml | ||
{%- endif %} | ||
- source: salt://datadog/files/conf.yaml.jinja | ||
- user: dd-agent | ||
- group: root | ||
- mode: 600 | ||
- template: jinja | ||
- context: | ||
check_name: {{ check_name }} | ||
{%- if latest_agent_version or parsed_version[1] != '5' %} | ||
{%- if datadog_checks[check_name].version is defined %} | ||
datadog_{{ check_name }}_version_{{ datadog_checks[check_name].version }}_installed: | ||
cmd.run: | ||
- name: sudo -u dd-agent datadog-agent integration install datadog-{{ check_name }}=={{ datadog_checks[check_name].version }} | ||
{%- endif %} | ||
{%- endif %} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
{% if pillar.datadog.checks[check_name].init_config is not defined -%} | ||
{% from "datadog/map.jinja" import datadog_checks with context -%} | ||
|
||
{% if datadog_checks[check_name].config is defined -%} | ||
|
||
{% if datadog_checks[check_name].config.init_config is not defined -%} | ||
init_config: | ||
{% endif -%} | ||
|
||
{{ pillar.datadog.checks[check_name] | yaml(False) }} | ||
{{ datadog_checks[check_name].config | yaml(False) }} | ||
|
||
{% endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% from "datadog/map.jinja" import datadog_config with context -%} | ||
|
||
[Main] | ||
dd_url: https://app.datadoghq.com | ||
|
||
{% if datadog_config.api_key is not defined -%} | ||
api_key: | ||
{% else -%} | ||
api_key: {{ datadog_config.api_key }} | ||
{% endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% from "datadog/map.jinja" import datadog_config with context -%} | ||
|
||
{% if datadog_config.api_key is not defined -%} | ||
api_key: | ||
{% endif -%} | ||
|
||
{% if datadog_config | length -%} | ||
{{ datadog_config | yaml(False) }} | ||
{% endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include: | ||
- datadog.config | ||
- datadog.install | ||
- datadog.config | ||
- datadog.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.