Skip to content

Commit 8b9cb4d

Browse files
committed
Hotfix exec of wazuh-template.json
Fix case where file does not exist so rm will not be called Fix sh incompatible process substitution <(...) can be used with bash but not with sh that exec uses.
1 parent a230149 commit 8b9cb4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

manifests/filebeat_oss.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
# TODO: Include file into the wazuh/wazuh-puppet project or use file { checksum => '..' } for this instead of the exec construct.
4848
exec { 'cleanup /etc/filebeat/wazuh-template.json':
4949
command => '/bin/rm /etc/filebeat/wazuh-template.json',
50-
unless => "/bin/cmp -s '/etc/filebeat/wazuh-template.json' <(curl -s https://raw.githubusercontent.com/wazuh/wazuh/${wazuh_extensions_version}/extensions/elasticsearch/7.x/wazuh-template.json)",
50+
onlyif => '/bin/test -f /etc/filebeat/wazuh-template.json',
51+
unless => "/bin/curl -s 'https://raw.githubusercontent.com/wazuh/wazuh/${wazuh_extensions_version}/extensions/elasticsearch/7.x/wazuh-template.json' | /bin/cmp -s '/etc/filebeat/wazuh-template.json'",
5152
}
5253
-> file { '/etc/filebeat/wazuh-template.json':
5354
owner => 'root',

0 commit comments

Comments
 (0)