Compare commits
1 Commits
3335b44713
...
dd82a787f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd82a787f7 |
@@ -120,7 +120,9 @@
|
|||||||
22
|
22
|
||||||
23
|
23
|
||||||
24
|
24
|
||||||
25</pre>
|
25
|
||||||
|
26
|
||||||
|
27</pre>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<pre class="code"><span class="info file"># File 'manifests/firewall/iptables.pp', line 6</span>
|
<pre class="code"><span class="info file"># File 'manifests/firewall/iptables.pp', line 6</span>
|
||||||
@@ -128,22 +130,24 @@
|
|||||||
class confdroid_ssh::firewall::iptables (
|
class confdroid_ssh::firewall::iptables (
|
||||||
|
|
||||||
) inherits confdroid_ssh::params {
|
) inherits confdroid_ssh::params {
|
||||||
case $ssh_use_firewall {
|
if $ssh_use_firewall == true {
|
||||||
true, 'true', 'yes', '1': {
|
|
||||||
$ssh_fw_ensure = 'present'
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
$ssh_fw_ensure = 'absent'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
firewall { "${ssh_fw_order}${ssh_fw_port} allow SSH on port ${ssh_fw_port}":
|
firewall { "${ssh_fw_order}${ssh_fw_port} allow SSH on port ${ssh_fw_port}":
|
||||||
ensure => $ssh_fw_ensure,
|
ensure => 'present',
|
||||||
proto => 'tcp',
|
proto => 'tcp',
|
||||||
source => $ssh_source_range,
|
source => $ssh_source_range,
|
||||||
dport => $ssh_fw_port,
|
dport => $ssh_fw_port,
|
||||||
jump => 'accept',
|
jump => 'accept',
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if $ssh_use_firewall == false {
|
||||||
|
firewall { "${ssh_fw_order}${ssh_fw_port} remove SSH on port ${ssh_fw_port}":
|
||||||
|
ensure => 'absent',
|
||||||
|
proto => 'tcp',
|
||||||
|
source => $ssh_source_range,
|
||||||
|
dport => $ssh_fw_port,
|
||||||
|
jump => 'accept',
|
||||||
|
}
|
||||||
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -6,20 +6,22 @@
|
|||||||
class confdroid_ssh::firewall::iptables (
|
class confdroid_ssh::firewall::iptables (
|
||||||
|
|
||||||
) inherits confdroid_ssh::params {
|
) inherits confdroid_ssh::params {
|
||||||
case $ssh_use_firewall {
|
if $ssh_use_firewall == true {
|
||||||
true, 'true', 'yes', '1': {
|
|
||||||
$ssh_fw_ensure = 'present'
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
$ssh_fw_ensure = 'absent'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
firewall { "${ssh_fw_order}${ssh_fw_port} allow SSH on port ${ssh_fw_port}":
|
firewall { "${ssh_fw_order}${ssh_fw_port} allow SSH on port ${ssh_fw_port}":
|
||||||
ensure => $ssh_fw_ensure,
|
ensure => 'present',
|
||||||
proto => 'tcp',
|
proto => 'tcp',
|
||||||
source => $ssh_source_range,
|
source => $ssh_source_range,
|
||||||
dport => $ssh_fw_port,
|
dport => $ssh_fw_port,
|
||||||
jump => 'accept',
|
jump => 'accept',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if $ssh_use_firewall == false {
|
||||||
|
firewall { "${ssh_fw_order}${ssh_fw_port} remove SSH on port ${ssh_fw_port}":
|
||||||
|
ensure => 'absent',
|
||||||
|
proto => 'tcp',
|
||||||
|
source => $ssh_source_range,
|
||||||
|
dport => $ssh_fw_port,
|
||||||
|
jump => 'accept',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user