salt-states/pod/init.sls

47 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2023-06-27 07:16:37 +00:00
Copy check image update script:
file.managed:
- name: /root/bin/check_image_updates.sh
- source: salt://pod/files/check_image_updates.sh.jinja
- template: jinja
- user: root
- group: root
- mode: 0700
Create check image update service:
file.managed:
- name: /etc/systemd/system/check_image_updates.service
- source: salt://pod/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://pod/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
- watch:
- 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.pods is defined %}
include:
{%- for pod, args in pillar.pods.items() %}
- containers.{{ pod }}
{%- endfor %}
{%- endif %}