podman: Add Type and PIDFile value to unit files

This changes the way we are running the podman containers via systemd.
They are now in dettached mode and Type/PIDFile set.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1834974

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
pull/5450/head
Dimitri Savineau 2020-06-22 12:58:56 -04:00 committed by Guillaume Abrioux
parent 3f47236470
commit d43769dc2a
14 changed files with 210 additions and 0 deletions

View File

@ -11,9 +11,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop grafana-server ExecStartPre=-/usr/bin/{{ container_binary }} stop grafana-server
ExecStartPre=-/usr/bin/{{ container_binary }} rm grafana-server ExecStartPre=-/usr/bin/{{ container_binary }} rm grafana-server
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm --name=grafana-server \ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=grafana-server \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
-v /etc/grafana:/etc/grafana:Z \ -v /etc/grafana:/etc/grafana:Z \
-v /var/lib/grafana:/var/lib/grafana:Z \ -v /var/lib/grafana:/var/lib/grafana:Z \
--net=host \ --net=host \
@ -23,12 +30,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=grafana-server \
--memory-swap={{ grafana_container_memory * 2 }}GB \ --memory-swap={{ grafana_container_memory * 2 }}GB \
-e GF_INSTALL_PLUGINS={{ grafana_plugins|join(',') }} \ -e GF_INSTALL_PLUGINS={{ grafana_plugins|join(',') }} \
{{ grafana_container_image }} {{ grafana_container_image }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStop=-/usr/bin/{{ container_binary }} stop grafana-server ExecStop=-/usr/bin/{{ container_binary }} stop grafana-server
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -9,9 +9,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop rbd-target-api ExecStartPre=-/usr/bin/{{ container_binary }} stop rbd-target-api
ExecStartPre=-/usr/bin/{{ container_binary }} rm rbd-target-api ExecStartPre=-/usr/bin/{{ container_binary }} rm rbd-target-api
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm \ ExecStart=/usr/bin/{{ container_binary }} run --rm \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--memory={{ ceph_rbd_target_api_docker_memory_limit }} \ --memory={{ ceph_rbd_target_api_docker_memory_limit }} \
--cpus={{ ceph_rbd_target_api_docker_cpu_limit }} \ --cpus={{ ceph_rbd_target_api_docker_cpu_limit }} \
-v /etc/localtime:/etc/localtime:ro \ -v /etc/localtime:/etc/localtime:ro \
@ -28,12 +35,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm \
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \ -e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
--name=rbd-target-api \ --name=rbd-target-api \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStopPost=-/usr/bin/{{ container_binary }} stop rbd-target-api ExecStopPost=-/usr/bin/{{ container_binary }} stop rbd-target-api
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -9,9 +9,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop rbd-target-gw ExecStartPre=-/usr/bin/{{ container_binary }} stop rbd-target-gw
ExecStartPre=-/usr/bin/{{ container_binary }} rm rbd-target-gw ExecStartPre=-/usr/bin/{{ container_binary }} rm rbd-target-gw
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm \ ExecStart=/usr/bin/{{ container_binary }} run --rm \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--memory={{ ceph_rbd_target_gw_docker_memory_limit }} \ --memory={{ ceph_rbd_target_gw_docker_memory_limit }} \
--cpus={{ ceph_rbd_target_gw_docker_cpu_limit }} \ --cpus={{ ceph_rbd_target_gw_docker_cpu_limit }} \
-v /etc/localtime:/etc/localtime:ro \ -v /etc/localtime:/etc/localtime:ro \
@ -28,12 +35,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm \
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \ -e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
--name=rbd-target-gw \ --name=rbd-target-gw \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStopPost=-/usr/bin/{{ container_binary }} stop rbd-target-gw ExecStopPost=-/usr/bin/{{ container_binary }} stop rbd-target-gw
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -9,9 +9,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop tcmu-runner ExecStartPre=-/usr/bin/{{ container_binary }} stop tcmu-runner
ExecStartPre=-/usr/bin/{{ container_binary }} rm tcmu-runner ExecStartPre=-/usr/bin/{{ container_binary }} rm tcmu-runner
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm \ ExecStart=/usr/bin/{{ container_binary }} run --rm \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--memory={{ ceph_tcmu_runner_docker_memory_limit }} \ --memory={{ ceph_tcmu_runner_docker_memory_limit }} \
--cpus={{ ceph_tcmu_runner_docker_cpu_limit }} \ --cpus={{ ceph_tcmu_runner_docker_cpu_limit }} \
-v /etc/localtime:/etc/localtime:ro \ -v /etc/localtime:/etc/localtime:ro \
@ -27,12 +34,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm \
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \ -e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
--name=tcmu-runner \ --name=tcmu-runner \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStopPost=-/usr/bin/{{ container_binary }} stop tcmu-runner ExecStopPost=-/usr/bin/{{ container_binary }} stop tcmu-runner
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -10,9 +10,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_hostname }}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mds-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mds-{{ ansible_hostname }}
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--memory={{ ceph_mds_docker_memory_limit }} \ --memory={{ ceph_mds_docker_memory_limit }} \
--cpus={{ cpu_limit }} \ --cpus={{ cpu_limit }} \
-v /var/lib/ceph:/var/lib/ceph:z \ -v /var/lib/ceph:/var/lib/ceph:z \
@ -26,12 +33,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
{{ ceph_mds_docker_extra_env }} \ {{ ceph_mds_docker_extra_env }} \
--name=ceph-mds-{{ ansible_hostname }} \ --name=ceph-mds-{{ ansible_hostname }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_hostname }} ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_hostname }}
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -9,9 +9,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mgr-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mgr-{{ ansible_hostname }}
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--memory={{ ceph_mgr_docker_memory_limit }} \ --memory={{ ceph_mgr_docker_memory_limit }} \
--cpus={{ ceph_mgr_docker_cpu_limit }} \ --cpus={{ ceph_mgr_docker_cpu_limit }} \
-v /var/lib/ceph:/var/lib/ceph:z \ -v /var/lib/ceph:/var/lib/ceph:z \
@ -25,12 +32,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
{{ ceph_mgr_docker_extra_env }} \ {{ ceph_mgr_docker_extra_env }} \
--name=ceph-mgr-{{ ansible_hostname }} \ --name=ceph-mgr-{{ ansible_hostname }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }} ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }}
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -9,9 +9,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mon-%i ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mon-%i
{% endif %}
ExecStartPre=/bin/sh -c '"$(command -v mkdir)" -p /etc/ceph /var/lib/ceph/mon' ExecStartPre=/bin/sh -c '"$(command -v mkdir)" -p /etc/ceph /var/lib/ceph/mon'
ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \ ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--memory={{ ceph_mon_docker_memory_limit }} \ --memory={{ ceph_mon_docker_memory_limit }} \
--cpus={{ ceph_mon_docker_cpu_limit }} \ --cpus={{ ceph_mon_docker_cpu_limit }} \
-v /var/lib/ceph:/var/lib/ceph:z \ -v /var/lib/ceph:/var/lib/ceph:z \
@ -38,13 +45,21 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \ -e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
{{ ceph_mon_docker_extra_env }} \ {{ ceph_mon_docker_extra_env }} \
{{ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStop=-/usr/bin/{{ container_binary }} stop ceph-mon-%i ExecStop=-/usr/bin/{{ container_binary }} stop ceph-mon-%i
{% endif %}
ExecStopPost=-/bin/rm -f /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok ExecStopPost=-/bin/rm -f /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -10,9 +10,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-nfs-%i ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-nfs-%i
{% endif %}
ExecStartPre={{ '/bin/mkdir' if ansible_os_family == 'Debian' else '/usr/bin/mkdir' }} -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha /var/log/ganesha ExecStartPre={{ '/bin/mkdir' if ansible_os_family == 'Debian' else '/usr/bin/mkdir' }} -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha /var/log/ganesha
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
-v /var/lib/ceph:/var/lib/ceph:z \ -v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \ -v /etc/ceph:/etc/ceph:z \
-v /var/lib/nfs/ganesha:/var/lib/nfs/ganesha:z \ -v /var/lib/nfs/ganesha:/var/lib/nfs/ganesha:z \
@ -31,12 +38,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
{{ ceph_nfs_docker_extra_env }} \ {{ ceph_nfs_docker_extra_env }} \
--name=ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }} \ --name=ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-nfs-%i ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-nfs-%i
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -11,8 +11,15 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f node-exporter ExecStartPre=-/usr/bin/{{ container_binary }} rm -f node-exporter
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm --name=node-exporter \ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=node-exporter \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--privileged \ --privileged \
-v /proc:/host/proc:ro -v /sys:/host/sys:ro \ -v /proc:/host/proc:ro -v /sys:/host/sys:ro \
--net=host \ --net=host \
@ -21,12 +28,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=node-exporter \
--path.sysfs=/host/sys \ --path.sysfs=/host/sys \
--no-collector.timex \ --no-collector.timex \
--web.listen-address=:{{ node_exporter_port }} --web.listen-address=:{{ node_exporter_port }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStop=-/usr/bin/{{ container_binary }} stop node-exporter ExecStop=-/usr/bin/{{ container_binary }} stop node-exporter
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -11,13 +11,20 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-osd-%i ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-osd-%i
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-osd-%i ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-osd-%i
{% endif %}
ExecStart={% if ceph_osd_numactl_opts != "" %} ExecStart={% if ceph_osd_numactl_opts != "" %}
numactl \ numactl \
{{ ceph_osd_numactl_opts }} \ {{ ceph_osd_numactl_opts }} \
{% endif %} {% endif %}
/usr/bin/{{ container_binary }} run \ /usr/bin/{{ container_binary }} run \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--rm \ --rm \
--net=host \ --net=host \
--privileged=true \ --privileged=true \
@ -55,12 +62,20 @@ numactl \
--name=ceph-osd-%i \ --name=ceph-osd-%i \
{{ ceph_osd_docker_extra_env }} \ {{ ceph_osd_docker_extra_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStop=-/usr/bin/{{ container_binary }} stop ceph-osd-%i ExecStop=-/usr/bin/{{ container_binary }} stop ceph-osd-%i
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -12,8 +12,15 @@ After=network.target
[Service] [Service]
WorkingDirectory={{ alertmanager_data_dir }} WorkingDirectory={{ alertmanager_data_dir }}
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f alertmanager ExecStartPre=-/usr/bin/{{ container_binary }} rm -f alertmanager
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm --name=alertmanager \ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=alertmanager \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
-v "{{ alertmanager_conf_dir }}:/etc/alertmanager:Z" \ -v "{{ alertmanager_conf_dir }}:/etc/alertmanager:Z" \
-v "{{ alertmanager_data_dir }}:/alertmanager:Z" \ -v "{{ alertmanager_data_dir }}:/alertmanager:Z" \
--net=host \ --net=host \
@ -30,12 +37,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=alertmanager \
--storage.path=/alertmanager \ --storage.path=/alertmanager \
--web.external-url=http://{{ ansible_fqdn }}:{{ alertmanager_port }}/ \ --web.external-url=http://{{ ansible_fqdn }}:{{ alertmanager_port }}/ \
--web.listen-address={{ grafana_server_addr }}:{{ alertmanager_port }} --web.listen-address={{ grafana_server_addr }}:{{ alertmanager_port }}
{% if container_binary == 'podman' %}
ExecStop=/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStop=/usr/bin/{{ container_binary }} stop alertmanager ExecStop=/usr/bin/{{ container_binary }} stop alertmanager
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -11,8 +11,15 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f prometheus ExecStartPre=-/usr/bin/{{ container_binary }} rm -f prometheus
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm --name=prometheus \ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=prometheus \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
-v "{{ prometheus_conf_dir }}:/etc/prometheus:Z" \ -v "{{ prometheus_conf_dir }}:/etc/prometheus:Z" \
-v "{{ prometheus_data_dir }}:/prometheus:Z" \ -v "{{ prometheus_data_dir }}:/prometheus:Z" \
--net=host \ --net=host \
@ -26,12 +33,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=prometheus \
--storage.tsdb.path=/prometheus \ --storage.tsdb.path=/prometheus \
--web.external-url=http://{{ ansible_fqdn }}:{{ prometheus_port }}/ \ --web.external-url=http://{{ ansible_fqdn }}:{{ prometheus_port }}/ \
--web.listen-address={{ grafana_server_addr }}:{{ prometheus_port }} --web.listen-address={{ grafana_server_addr }}:{{ prometheus_port }}
{% if container_binary == 'podman' %}
ExecStop=/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStop=/usr/bin/{{ container_binary }} stop prometheus ExecStop=/usr/bin/{{ container_binary }} stop prometheus
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -9,9 +9,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=-/etc/environment EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rbd-mirror-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rbd-mirror-{{ ansible_hostname }}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rbd-mirror-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rbd-mirror-{{ ansible_hostname }}
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--memory={{ ceph_rbd_mirror_docker_memory_limit }} \ --memory={{ ceph_rbd_mirror_docker_memory_limit }} \
--cpus={{ ceph_rbd_mirror_docker_cpu_limit }} \ --cpus={{ ceph_rbd_mirror_docker_cpu_limit }} \
-v /var/lib/ceph:/var/lib/ceph:z \ -v /var/lib/ceph:/var/lib/ceph:z \
@ -25,12 +32,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--name=ceph-rbd-mirror-{{ ansible_hostname }} \ --name=ceph-rbd-mirror-{{ ansible_hostname }} \
{{ ceph_rbd_mirror_docker_extra_env }} \ {{ ceph_rbd_mirror_docker_extra_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-rbd-mirror-{{ ansible_hostname }} ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-rbd-mirror-{{ ansible_hostname }}
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -10,9 +10,16 @@ After=network.target
[Service] [Service]
EnvironmentFile=/var/lib/ceph/radosgw/{{ cluster }}-%i/EnvironmentFile EnvironmentFile=/var/lib/ceph/radosgw/{{ cluster }}-%i/EnvironmentFile
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_hostname }}-${INST_NAME} ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_hostname }}-${INST_NAME}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rgw-{{ ansible_hostname }}-${INST_NAME} ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rgw-{{ ansible_hostname }}-${INST_NAME}
{% endif %}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
{% if container_binary == 'podman' %}
-d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
{% endif %}
--memory={{ ceph_rgw_docker_memory_limit }} \ --memory={{ ceph_rgw_docker_memory_limit }} \
--cpus={{ cpu_limit }} \ --cpus={{ cpu_limit }} \
{% if ceph_rgw_docker_cpuset_cpus is defined -%} {% if ceph_rgw_docker_cpuset_cpus is defined -%}
@ -40,12 +47,20 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--name=ceph-rgw-{{ ansible_hostname }}-${INST_NAME} \ --name=ceph-rgw-{{ ansible_hostname }}-${INST_NAME} \
{{ ceph_rgw_docker_extra_env }} \ {{ ceph_rgw_docker_extra_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
{% if container_binary == 'podman' %}
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
{% else %}
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_hostname }}-${INST_NAME} ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_hostname }}-${INST_NAME}
{% endif %}
KillMode=none KillMode=none
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStartSec=120 TimeoutStartSec=120
TimeoutStopSec=15 TimeoutStopSec=15
{% if container_binary == 'podman' %}
Type=forking
PIDFile=/%t/%n-pid
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target