-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOD: manage the quay-pod via systemd (#50)
- Loading branch information
Showing
10 changed files
with
69 additions
and
14 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
6 changes: 0 additions & 6 deletions
6
ansible-runner/context/app/project/roles/mirror_appliance/tasks/create-podman-pod.yaml
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
ansible-runner/context/app/project/roles/mirror_appliance/tasks/install-pod-service.yaml
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 @@ | ||
- name: Copy Quay Pod systemd service file | ||
template: | ||
src: ../templates/pod.service.j2 | ||
dest: /etc/systemd/system/quay-pod.service | ||
|
||
- name: Check if pod pause image is loaded | ||
command: podman inspect --type=image {{ pause_image }} | ||
register: r | ||
ignore_errors: yes | ||
|
||
- name: Pull Infra image | ||
containers.podman.podman_image: | ||
name: "{{ pause_image }}" | ||
when: r.rc != 0 | ||
retries: 5 | ||
delay: 5 | ||
|
||
- name: Start Quay Pod service | ||
systemd: | ||
name: quay-pod.service | ||
enabled: yes | ||
daemon_reload: yes | ||
state: started |
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
27 changes: 27 additions & 0 deletions
27
ansible-runner/context/app/project/roles/mirror_appliance/templates/pod.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,27 @@ | ||
[Unit] | ||
Description=Infra Container for Quay | ||
Wants=network.target | ||
After=network-online.target | ||
Before=quay-postgres.service quay-redis.service | ||
|
||
[Service] | ||
Type=simple | ||
RemainAfterExit=yes | ||
TimeoutStartSec=5m | ||
ExecStartPre=-/bin/rm -f %t/%n-pid %t/%n-pod-id | ||
ExecStart=/usr/bin/podman pod create \ | ||
--name quay-pod \ | ||
--infra-image {{ pause_image }} \ | ||
--publish {{ quay_hostname.split(":")[1] if (":" in quay_hostname) else "8443" }}:8443 \ | ||
--pod-id-file %t/%n-pod-id \ | ||
--replace | ||
ExecStop=-/usr/bin/podman pod stop --ignore --pod-id-file %t/%n-pod-id -t 10 | ||
ExecStopPost=-/usr/bin/podman pod rm --ignore -f --pod-id-file %t/%n-pod-id | ||
PIDFile=%t/%n-pid | ||
KillMode=none | ||
Restart=always | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target default.target | ||
|
3 changes: 2 additions & 1 deletion
3
ansible-runner/context/app/project/roles/mirror_appliance/templates/postgres.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
4 changes: 2 additions & 2 deletions
4
ansible-runner/context/app/project/roles/mirror_appliance/templates/quay.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
3 changes: 2 additions & 1 deletion
3
ansible-runner/context/app/project/roles/mirror_appliance/templates/redis.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
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