tlu/salt/states/tlu-harvester/images.sls
2021-10-21 09:23:23 +02:00

20 lines
537 B
Plaintext

{% for dist, items in pillar['tlu-harvester']['images'].items() %}
{% for item in items %}
{% set filename = item['url'].split('/')[-1] %}
Downloading image {{ filename }}:
file.managed:
- name: /srv/www/htdocs/images/{{ dist }}/{{ filename }}
- source: {{ item['url'] }}
{% if 'checksum' in item -%}
- source_hash: {{ item['checksum'] }}
{% else %}
- skip_verify: True
{% endif %}
- user: root
- group: root
- mode: "0644"
- makedirs: True
- dir_mode: "0755"
{% endfor %}
{% endfor %}