diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-02-10 11:58:14 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-02-10 12:16:32 -0700 |
commit | 3a037315b8cb60d8c6da94ba6db7123292592fa1 (patch) | |
tree | 6c89a1e2f64b98180c3ef2c67276d208f8ca42aa /src | |
parent | 8be015008b3e876be37e64179be2ff0a7198c5f9 (diff) | |
download | consfigurator-3a037315b8cb60d8c6da94ba6db7123292592fa1.tar.gz |
add FIREWALLD:ZONE-HAS-SOURCE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src')
-rw-r--r-- | src/package.lisp | 1 | ||||
-rw-r--r-- | src/property/firewalld.lisp | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/package.lisp b/src/package.lisp index 08bde22..202477f 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -900,6 +900,7 @@ #:zone-target #:default-route-zoned-once #:zone-has-interface + #:zone-has-source #:zone-has-service #:zone-masquerade #:zone-rich-rule diff --git a/src/property/firewalld.lisp b/src/property/firewalld.lisp index ee69cb5..6c6f337 100644 --- a/src/property/firewalld.lisp +++ b/src/property/firewalld.lisp @@ -228,6 +228,22 @@ only FIREWALLD:DEFAULT-ZONE." :check `(,#?"--zone=${zone}" ,#?"--query-interface=${interface}") :apply `(,#?"--zone=${zone}" ,#?"--remove-interface=${interface}")))) +(defproplist zone-has-source :posix (zone source) + (:desc #?"firewalld zone ${zone} has source ${source}") + (with-unapply + (installed) + (has-zone zone) + (%firewall-cmd + t :file #?"zones/${zone}.xml" :warning "ZONE_ALREADY_SET" + :check `(,#?"--zone=${zone}" ,#?"--query-source=${source}") + :apply `(,#?"--zone=${zone}" ,#?"--add-source=${source}")) + :unapply + (%firewall-cmd + t :file #?"zones/${zone}.xml" :warning "UNKNOWN_SOURCE" + :complement-check t + :check `(,#?"--zone=${zone}" ,#?"--query-source=${source}") + :apply `(,#?"--zone=${zone}" ,#?"--remove-source=${source}")))) + (defproplist zone-has-service :posix (zone service) (:desc #?"firewalld zone ${zone} has service ${service}") (with-unapply |