Skip to content

Commit

Permalink
(role/tang) add basic filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Nov 11, 2023
1 parent f531071 commit 8fa6350
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hieradata/role/tang.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
classes:
- "profile::core::common"
- "profile::core::firewall"
- "tang"
packages:
- "jose"

firewall::ensure: "running"
9 changes: 9 additions & 0 deletions hieradata/site/dev/role/tang.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
profile::core::firewall::firewall:
"200 accept tang":
proto: "tcp"
state: "NEW"
ipset: "dev src"
dport: "7500"
action: "accept"
require: "Ipset::Set[dev]"
17 changes: 17 additions & 0 deletions spec/hosts/roles/tang_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,26 @@
it { is_expected.to compile.with_all_deps }

include_examples 'common', facts: facts
include_examples 'ipset'
include_examples 'firewall default', facts: facts
include_examples 'firewall node_exporter scraping', site: site

it { is_expected.to contain_class('tang') }
it { is_expected.to contain_package('jose') }

case site
when 'dev'
it do
is_expected.to contain_firewall('200 accept tang').with(
proto: 'tcp',
state: 'NEW',
ipset: 'dev src',
dport: '7500',
action: 'accept',
require: 'Ipset::Set[dev]',
)
end
end
end # host
end # lsst_sites
end # on os
Expand Down

0 comments on commit 8fa6350

Please sign in to comment.