Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Firewall state custom host group assignments for single portgroup entry #10917

Closed
m0duspwnens opened this issue Aug 2, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@m0duspwnens
Copy link
Contributor

If a single portgroup is added to a custom hostgroup assignment for a role, it is treated as a string and not a list of string. We need to force the type to be a list of strings.

          ID: iptables_config
    Function: file.managed
        Name: /etc/sysconfig/iptables
      Result: False
     Comment: Unable to manage file: Jinja variable 'dict object' has no attribute 'c'; line 79

              ---
              [...]

              {%- for chn, hostgroups in FIREWALL_MERGED.role[role].chain.items() %}
              {%-   for hostgroup, portgroups in hostgroups['hostgroups'].items() %}
              {%-     for ip in FIREWALL_MERGED.hostgroups[hostgroup] %}
              {%-       for groupname in portgroups['portgroups'] %}
              {%-         for proto, ports in FIREWALL_MERGED['portgroups'][groupname].items() %}    <======================
              {%-           for port in ports %}
              -A {{chn}} -s {{ip}} -p {{proto}} -m {{proto}} --dport {{port}} -j ACCEPT
              {%-           endfor %}
              {%-         endfor %}
              {%-       endfor %}
              [...]
              ---
     Started: 14:51:29.452646
    Duration: 320.204 ms
     Changes:
@m0duspwnens m0duspwnens added the bug Something isn't working label Aug 2, 2023
@m0duspwnens m0duspwnens self-assigned this Aug 2, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant