mirror of
https://github.com/krislamo/vagrant-jenkins
synced 2024-12-16 05:10:36 +00:00
dynamically manage firewall ports from hiera values
This commit is contained in:
parent
630f8b3336
commit
4e51275d6b
@ -11,35 +11,18 @@ class profiles::ebrc_jenkins {
|
|||||||
Class['::profiles::local_home'] ->
|
Class['::profiles::local_home'] ->
|
||||||
Class['::ebrc_jenkins']
|
Class['::ebrc_jenkins']
|
||||||
|
|
||||||
firewalld::custom_service{ 'Allow jenkins in public zone':
|
$jenkins_instances = hiera('ebrc_jenkins::instances')
|
||||||
short => 'jenkins',
|
$jenkins_instances.each |$instance, $conf| {
|
||||||
port => [
|
$port = $conf['http_port']
|
||||||
{
|
firewalld_rich_rule { "Jenkins instance ${instance}":
|
||||||
'port' => 9191,
|
ensure => present,
|
||||||
'protocol' => 'tcp'
|
zone => 'public',
|
||||||
|
port => {
|
||||||
|
'port' => $port,
|
||||||
|
'protocol' => 'tcp',
|
||||||
},
|
},
|
||||||
{
|
action => 'accept',
|
||||||
'port' => 9181,
|
|
||||||
'protocol' => 'tcp'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'port' => 9130,
|
|
||||||
'protocol' => 'tcp'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'port' => 9120,
|
|
||||||
'protocol' => 'tcp'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
before => Firewalld_service['Allow jenkins in public zone'],
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
firewalld_service {'Allow jenkins in public zone':
|
|
||||||
ensure => 'present',
|
|
||||||
zone => 'public',
|
|
||||||
service => 'jenkins',
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user