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

21 lines
512 B
Plaintext
Raw Normal View History

2022-11-02 10:18:20 +00:00
{% 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 %}