Alan Orth
ab27caf877
Use dynamic includes instead of static imports when you are running tasks conditionally or using variable interpolation. The down side is that you need to then tag the parent task as well as all child tasks, as tags only apply to children of statically imported tasks.
25 lines
698 B
YAML
25 lines
698 B
YAML
---
|
|
- name: Install firewalld and deps
|
|
when: ansible_distribution_major_version is version_compare('8', '>=')
|
|
apt: pkg={{ item }} state=present
|
|
loop:
|
|
- firewalld
|
|
- tidy
|
|
tags:
|
|
- packages
|
|
- firewall
|
|
|
|
- name: Copy firewalld public zone file
|
|
when: ansible_distribution_major_version is version_compare('8', '>=')
|
|
template: src=public.xml.j2 dest=/etc/firewalld/zones/public.xml owner=root mode=0600
|
|
tags: firewall
|
|
|
|
- name: Format public.xml firewalld zone file
|
|
when: ansible_distribution_major_version is version_compare('8', '>=')
|
|
command: tidy -xml -iq -m -w 0 /etc/firewalld/zones/public.xml
|
|
notify:
|
|
- reload firewalld
|
|
tags: firewall
|
|
|
|
# vim: set sw=2 ts=2:
|