Skip to content

Commit

Permalink
set default port for firewall
Browse files Browse the repository at this point in the history
Since port parameter seems to be missing from init.pp, use the same logic to determin it as in cli_helper.pp

add possibility to disable/uninstall plugins

- add possibility to disable/uninstall plugins.
- move $plugins_host outside of if block, as it looks identical for both cases.
- rename all occurrences of ${name}.hpi with ${plugin}

For uninstall/disable, there are 2 ifs added, each with 2 execs (one for jpi an one for hpi)

  if ($version == 'absent' or $version == 'uninstall') {
   test -f ${plugin_dir}/${plugin}  && rm -rf ${name} ${plugin} ${name}.jpi ${name}.jpi.pinned && touch ${name}.jpi.disabled
   test -f ${plugin_dir}/${name}.jpi -a ! -f ${plugin_dir}/${name}.jpi.disabled && touch ${plugin_dir}/${name}.jpi.disabled
} elsif ($version == 'disable' or $version == 'disabled') {
   test -f ${plugin_dir}/${name}.jpi -a ! -f ${plugin_dir}/${name}.jpi.disabled  && touch ${plugin_dir}/${name}.jpi.disabled
   test -f ${plugin_dir}/${plugin} -a ! -f ${plugin_dir}/${plugin}.disabled         && touch ${plugin_dir}/${plugin}.disabled
} else {
}

update firewall
  • Loading branch information
cristifalcas committed Oct 6, 2014
1 parent 0223de6 commit bd2fc6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion manifests/firewall.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
fail("Use of private class ${name} by ${caller_module_name}")
}

if $::jenkins::config_hash and has_key($::jenkins::config_hash, 'HTTP_PORT') {
$http_port = $::jenkins::config_hash['HTTP_PORT']
} else {
$http_port = '8080'
}

firewall { '500 allow Jenkins inbound traffic':
action => 'accept',
state => 'NEW',
dport => [$::jenkins::port],
dport => [$http_port],
proto => 'tcp',
}
}
Expand Down
1 change: 1 addition & 0 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,4 @@
}
}
}

0 comments on commit bd2fc6d

Please sign in to comment.