salt-states/containers/init.sls

47 lines
1.2 KiB
Plaintext
Raw 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://containers/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://containers/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://containers/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.containers is defined %}
include:
{%- for container, args in pillar.containers.items() %}
- containers.{{ container }}
{%- endfor %}
{%- endif %}