-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
runPlaybook.sh | ||
runPlaybook.sh | ||
secrets.yml |
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
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
...e/ansible/roles/job-runner/tasks/main.yml → ...le/roles/fim-queueing-sync/tasks/main.yml
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
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
infrastructure/ansible/roles/fimadminapi-sync/defaults/main.yml
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,5 @@ | ||
healthCheckEnabled: false | ||
healthCheckUrl: "" | ||
intervalSec: 10 | ||
syncUrl: "" | ||
syncToken: "" |
23 changes: 23 additions & 0 deletions
23
infrastructure/ansible/roles/fimadminapi-sync/tasks/main.yml
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,23 @@ | ||
# Set up a fim-job-runner machine | ||
|
||
- name: Copy .service file to instance | ||
register: service_file | ||
template: | ||
src: fim-adminapisync.service.j2 | ||
dest: /etc/systemd/system/fim-adminapisync.service | ||
|
||
- name: Copy .timer file to instance | ||
register: timer_file | ||
template: | ||
src: fim-adminapisync.timer.j2 | ||
dest: /etc/systemd/system/fim-adminapisync.timer | ||
|
||
- name: daemon-reload | ||
systemd_service: | ||
daemon_reload: yes | ||
when: service_file.changed or timer_file.changed | ||
|
||
- name: Ensure timer is started | ||
service: | ||
name: fim-adminapisync.timer | ||
active: true |
12 changes: 12 additions & 0 deletions
12
infrastructure/ansible/roles/fimadminapi-sync/templates/fim-adminapisync.service.j2
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,12 @@ | ||
[Unit] | ||
Description=Run sync current events process in FiMAdminApi | ||
After=network.target | ||
StartLimitIntervalSec=5 | ||
StartLimitBurst=2 | ||
|
||
[Service] | ||
Type=simple | ||
User=root | ||
ExecStart=/usr/bin/env curl -H 'X-fim-sync-secret: {{ syncToken }}' --request PUT {{ syncUrl }} | ||
# Optionally, send a ping to a health check for alerting if the service stops running | ||
{% if not healthCheckEnabled or healthCheckUrl == "" %}# {% endif %}ExecStartPost=/usr/bin/env curl -fsS -m 10 --retry 5 -o /dev/null {{ healthCheckUrl or "<<Health Check URL>>" }} |
7 changes: 7 additions & 0 deletions
7
infrastructure/ansible/roles/fimadminapi-sync/templates/fim-adminapisync.timer.j2
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,7 @@ | ||
[Timer] | ||
OnUnitInactiveSec={{ intervalSec }}s | ||
OnBootSec={{ intervalSec }}s | ||
Unit=fim-adminapisync.service | ||
|
||
[Install] | ||
WantedBy=multi-user.target |