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/firewalld.sls
2022-11-02 11:18:20 +01:00

21 lines
512 B
Plaintext

{% set zone = salt['pillar.get']('containers:zone', 'public') %}
{% for name, args in salt['pillar.get']('containers', {} ).items() %}
{% if args['ports'] is defined %}
Defining firewalld service for {{ name }}:
firewalld.service:
- name: {{ name }}
- ports:
{%- for port in args['ports'] %}
- {{ port['host'] }}/tcp
{%- endfor %}
adding service {{ name }} to {{ zone }} zone:
firewalld.present:
- name: {{ zone }}
- services:
- {{ name }}
{% endif %}
{% endfor %}