I'm seeing errors on initial deploy because the module creates alertmanager.yml, and attempts to validate it with amtool before the alertmanager tarball has been unpacked, which leads to the following error:
Notice: /Stage[main]/Prometheus::Alertmanager/File[/etc/alertmanager]/ensure: created
Notice: /Stage[main]/Prometheus::Alertmanager/File[/usr/local/bin/amtool]/ensure: created
Error: Execution of '/usr/local/bin/amtool check-config --alertmanager.url='' /etc/alertmanager/alertmanager.yaml20260624-10023-117tvfr' returned 127: sh: 1: /usr/local/bin/amtool: not found
Error: /Stage[main]/Prometheus::Alertmanager/File[/etc/alertmanager/alertmanager.yaml]/ensure: change from 'absent' to 'file' failed: Execution of '/usr/local/bin/amtool check-config --alertmanager.url='' /etc/alertmanager/alertmanager.yaml20260624-10023-117tvfr' returned 127: sh: 1: /usr/local/bin/amtool: not found
Later in the same run, the alertmanager tarball is fetched and extracted. Re-running puppet then successfully applies.
I can work around the issue by adding the following to my manifests:
File['/usr/local/bin/alertmanager'] -> File['/usr/local/bin/amtool']
This works because the alertmanager symlink does depend on the extracted binary.
I'm seeing errors on initial deploy because the module creates
alertmanager.yml, and attempts to validate it withamtoolbefore the alertmanager tarball has been unpacked, which leads to the following error:Later in the same run, the alertmanager tarball is fetched and extracted. Re-running puppet then successfully applies.
I can work around the issue by adding the following to my manifests:
This works because the alertmanager symlink does depend on the extracted binary.