-
Notifications
You must be signed in to change notification settings - Fork 260
Accept instances hashes on apache and http_check integrations #691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
asenci
wants to merge
15
commits into
DataDog:main
Choose a base branch
from
asenci:asenci/instances-hash
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a041f67
Allow passing instances as hash to http_check
asenci f94376d
Add test case
asenci 1f24152
Remove unnecessary checks
asenci e69e610
Cleanup template
asenci c87d13c
Allow passing instances as hash to apache
asenci 76a7c3f
Merge branch 'main' into asenci/instances-hash
asenci 0e1ec57
Merge branch 'main' into asenci/instances-hash
asenci a108e55
Remove Puppet 4.6 support
asenci d62d6a7
Update clean_empty.pp
asenci 2fff883
Cleanup http_check.pp
asenci e839962
Update http_check.pp
asenci edb6f8a
Merge branch 'main' into asenci/instances-hash
asenci 9039b1b
Merge branch 'main' into asenci/instances-hash
asenci 76e968a
Fix datadog_agent::clean_empty function
asenci dee980f
Allow passing instances as hash to mysql
asenci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,18 @@ | ||
| # For cleaning up empty elements on hashes and arrays | ||
| function datadog_agent::clean_empty ( | ||
| Any $var | ||
| ) { | ||
| if $var.is_a(Array) { | ||
| $_var = $var.map |$item| { datadog_agent::clean_empty($item) } | ||
| $result = $_var.filter |$item| { !$item.empty } | ||
|
|
||
| } elsif $var.is_a(Hash) { | ||
| $_var = Hash($var.map |$key, $value| { Tuple([$key, datadog_agent::clean_empty($value)]) }) | ||
| $result = $_var.filter |$key, $value| { !$value.empty } | ||
|
|
||
| } else { | ||
| $result = $var | ||
| } | ||
|
|
||
| $result | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,24 +1,3 @@ | ||
| ### MANAGED BY PUPPET | ||
|
|
||
| init_config: | ||
|
|
||
| instances: | ||
| - apache_status_url: <%= @url %> | ||
| <% if @disable_ssl_validation -%> | ||
| disable_ssl_validation: <%= @disable_ssl_validation %> | ||
| <% end -%> | ||
| <% if @username -%> | ||
| apache_user: <%= @username %> | ||
| <% end -%> | ||
| <% if @password -%> | ||
| apache_password: <%= @password %> | ||
| <% end -%> | ||
| <% if @tags and ! @tags.empty? -%> | ||
| tags: | ||
| <%- Array(@tags).each do |tag| -%> | ||
| <%- if tag != '' -%> | ||
| - <%= tag %> | ||
| <%- end -%> | ||
| <%- end -%> | ||
| <% end -%> | ||
|
|
||
| <% require 'yaml' -%> | ||
| <%= {'init_config'=>@init_config, 'instances'=>@_instances, 'logs'=>@logs}.to_yaml %> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.