Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sébastien Luttringer
infrastructure
Commits
4c649da3
Verified
Commit
4c649da3
authored
Mar 12, 2018
by
Florian Pritz
Browse files
zabbix-agent: Use sudo to get borg output
Signed-off-by:
Florian Pritz
<
bluewind@xinu.at
>
parent
83dfa015
Changes
3
Hide whitespace changes
Inline
Side-by-side
roles/zabbix-agent/files/zabbix-borg-timestamps.pl
View file @
4c649da3
...
...
@@ -6,7 +6,7 @@ use autodie;
use
JSON::
XS
;
use
POSIX
;
my
$json
=
decode_json
(`
/usr/local/bin/borg list --json --format '{start}{end}' --sort-by timestamp --last 1
`);
my
$json
=
decode_json
(`
sudo
/usr/local/bin/borg list --json --format '{start}{end}' --sort-by timestamp --last 1
`);
print
encode_json
({
last_archive
=>
{
is_checkpoint
=>
$json
->
{
archives
}[
0
]
->
{
archive
}
=~
m/.checkpoint$/
?
1
:
0
,
...
...
roles/zabbix-agent/tasks/main.yml
View file @
4c649da3
...
...
@@ -46,6 +46,9 @@
-
restart nginx-zabbix.service
when
:
"
'nginx'
in
group_names"
-
name
:
install sudo config
template
:
src=zabbix-agent-sudoers.conf.j2 dest=/etc/sudoers.d/zabbix-agent-sudoers
-
name
:
copy nginx-zabbix.service
copy
:
src=nginx-zabbix.service dest=/etc/systemd/system/nginx-zabbix.service owner=root group=root mode=0644
notify
:
...
...
roles/zabbix-agent/templates/zabbix-agent-sudoers.conf.j2
0 → 100644
View file @
4c649da3
zabbix-agent ALL=(root) NOPASSWD: /usr/local/bin/borg list --json --format {start}{end} --sort-by timestamp --last 1
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment