This repository has been archived on 2023-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
salt-states_old/podman/init.sls

60 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-11-02 10:18:20 +00:00
{% set user = salt['pillar.get']('podman:user', 'root') %}
2022-11-22 13:50:41 +00:00
{% set home = salt['user.info'](user).home %}
2022-11-02 10:18:20 +00:00
Install packages needed for podman:
pkg.installed:
- pkgs:
- podman
Set linger for user {{ user }}:
cmd.run:
- name: loginctl enable-linger {{ user }}
- unless: test -e /var/lib/systemd/linger/{{ user }}
2022-11-22 13:50:41 +00:00
Copy check image update script:
file.managed:
- name: {{ home }}/bin/check_image_updates.sh
- source: salt://podman/files/check_image_updates.sh.jinja
- template: jinja
- user: {{ user }}
- group: {{ user }}
- mode: 0700
Create check image update service:
file.managed:
- name: /etc/systemd/system/check_image_updates.service
- source: salt://podman/files/check_image_updates.service.jinja
- template: jinja
- user: root
- group: root
- mode: "0644"
Create check image update timer:
file.managed:
- name: /etc/systemd/system/check_image_updates.timer
- source: salt://podman/files/check_image_updates.timer.jinja
- template: jinja
- user: root
- group: root
- mode: "0644"
Systemd daemon reload for image update:
cmd.run:
- name: systemctl daemon-reload
- onchanges:
- file: Create check image update service
- file: Create check image update timer
Start check image update timer:
service.running:
- name: check_image_updates.timer
- enable: True
{% if pillar.containers is defined %}
include:
{%- for container, args in pillar.containers.items() %}
- podman.{{ container }}
{%- endfor %}
{%- endif %}