-
Notifications
You must be signed in to change notification settings - Fork 24
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 #39 from nuriel77/add/prom-iri-restart
Add/prom iri restart
- Loading branch information
Showing
10 changed files
with
200 additions
and
2 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
Binary file not shown.
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,3 @@ | ||
#!/bin/bash | ||
|
||
/bin/systemctl restart iri |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Executor credits go to https://github.com/imgix/prometheus-am-executor | ||
- name: copy prometheus alertmanager executor binary | ||
copy: | ||
src: files/prom-am-executor | ||
dest: "{{ prom_basedir }}/prom-am-executor" | ||
mode: 0700 | ||
|
||
- name: copy iri restart script | ||
copy: | ||
src: files/restart_iri.sh | ||
dest: "{{ prom_basedir }}/restart_iri.sh" | ||
mode: 0700 | ||
|
||
- name: copy prometheus alertmanager executor service file | ||
template: | ||
src: templates/prom-am-executor.service.j2 | ||
dest: /etc/systemd/system/prom-am-executor.service | ||
notify: | ||
- reload systemd | ||
|
||
- name: ensure prom-am-executor enabled and started | ||
systemd: | ||
name: prom-am-executor.service | ||
state: started | ||
enabled: yes |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[Unit] | ||
Description=Restart IRI Executor For Prometheus | ||
Wants=network-online.target | ||
After=network.target | ||
|
||
[Service] | ||
WorkingDirectory={{ prom_basedir }} | ||
Restart=on-failure | ||
ExecStart={{ prom_basedir }}/prom-am-executor -v -l 127.0.0.1:{{ prom_am_executor_port }} {{ prom_basedir }}/restart_iri.sh | ||
Type=simple | ||
|
||
# No need that exporter messes with /dev | ||
PrivateDevices=yes | ||
|
||
# Dedicated /tmp | ||
PrivateTmp=yes | ||
|
||
# Make /usr, /boot, /etc read only | ||
ProtectSystem=full | ||
|
||
# /home is not accessible at all | ||
ProtectHome=yes | ||
|
||
# This service has to be able to issue a systemctl restart. | ||
# Attempting to use sudoers special rule didn't work out | ||
# to let an unprivileged user to run a sudo command. | ||
# That's why the use of user root here. | ||
User=root | ||
Group=root | ||
|
||
[Install] | ||
WantedBy=multi-user.target |