{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/416","labels_url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/416/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/416/comments","events_url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/416/events","html_url":"https://github.com/jenkinsci/puppet-jenkins/issues/416","id":113544205,"number":416,"title":"$::jenkins::port does not properly manage listening port","user":{"login":"arioch","id":289522,"avatar_url":"https://avatars.githubusercontent.com/u/289522?v=3","gravatar_id":"","url":"https://api.github.com/users/arioch","html_url":"https://github.com/arioch","followers_url":"https://api.github.com/users/arioch/followers","following_url":"https://api.github.com/users/arioch/following{/other_user}","gists_url":"https://api.github.com/users/arioch/gists{/gist_id}","starred_url":"https://api.github.com/users/arioch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arioch/subscriptions","organizations_url":"https://api.github.com/users/arioch/orgs","repos_url":"https://api.github.com/users/arioch/repos","events_url":"https://api.github.com/users/arioch/events{/privacy}","received_events_url":"https://api.github.com/users/arioch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-27T09:44:58Z","updated_at":"2015-10-27T15:58:34Z","closed_at":null,"body":"Unless I'm mistaken $::jenkins::port does not properly manage the listening port on EL 7:\r\n\r\nConsider the following snippet:\r\n\r\n```\r\nclass { '::jenkins':\r\n  port => '80',\r\n}\r\n```\r\n\r\nWhen applying this adjustment the config file remains unchanged.\r\n\r\n```\r\n# grep -ri jenkins_port /etc/sysconfig/jenkins\r\nJENKINS_PORT=\"8080\"\r\n```\r\n\r\nWhich obviously results in the module not being able to manage a number of settings:\r\n\r\n```\r\nNotice: /Stage[main]/Jenkins::Service/Service[jenkins]/enable: enable changed 'false' to 'true'\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: java.io.IOException: There's no Jenkins running at http://127.0.0.1:8080/\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \tat hudson.cli.CLI.getCliTcpPort(CLI.java:288)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \tat hudson.cli.CLI.<init>(CLI.java:128)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \tat hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \tat hudson.cli.CLI._main(CLI.java:479)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \tat hudson.cli.CLI.main(CLI.java:390)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \tSuppressed: java.io.FileNotFoundException: http://127.0.0.1:8080/cli\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \t\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \t\tat hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \t\tat hudson.cli.CLI.connectViaHttp(CLI.java:158)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \t\tat hudson.cli.CLI.<init>(CLI.java:132)\r\nNotice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: \t\t... 3 more\r\nError: /usr/bin/java -jar /usr/lib/jenkins/jenkins-cli.jar -s http://127.0.0.1:8080 groovy /usr/lib/jenkins/puppet_helper.groovy set_num_executors 3 returned 255 instead of one of [0]\r\nError: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: change from notrun to 0 failed: /usr/bin/java -jar /usr/lib/jenkins/jenkins-cli.jar -s http://127.0.0.1:8080 groovy /usr/lib/jenkins/puppet_helper.groovy set_num_executors 3 returned 255 instead of one of [0]\r\nNotice: /Stage[main]/Jenkins/Anchor[jenkins::end]: Dependency Exec[set_num_executors] has failures: true\r\nWarning: /Stage[main]/Jenkins/Anchor[jenkins::end]: Skipping because of failed dependencies\r\nNotice: /Stage[main]/Jenkins::Cli::Reload/Exec[reload-jenkins]: Dependency Exec[set_num_executors] has failures: true\r\nWarning: /Stage[main]/Jenkins::Cli::Reload/Exec[reload-jenkins]: Skipping because of failed dependencies\r\nNotice: Applied catalog in 103.02 seconds\r\n```"},"comment":{"url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/comments/151550092","html_url":"https://github.com/jenkinsci/puppet-jenkins/issues/416#issuecomment-151550092","issue_url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/416","id":151550092,"user":{"login":"jhoblitt","id":948901,"avatar_url":"https://avatars.githubusercontent.com/u/948901?v=3","gravatar_id":"","url":"https://api.github.com/users/jhoblitt","html_url":"https://github.com/jhoblitt","followers_url":"https://api.github.com/users/jhoblitt/followers","following_url":"https://api.github.com/users/jhoblitt/following{/other_user}","gists_url":"https://api.github.com/users/jhoblitt/gists{/gist_id}","starred_url":"https://api.github.com/users/jhoblitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhoblitt/subscriptions","organizations_url":"https://api.github.com/users/jhoblitt/orgs","repos_url":"https://api.github.com/users/jhoblitt/repos","events_url":"https://api.github.com/users/jhoblitt/events{/privacy}","received_events_url":"https://api.github.com/users/jhoblitt/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T15:58:34Z","updated_at":"2015-10-27T15:58:34Z","body":"@arioch The `port` parameter appears to not presently do anything.  A refactor of both the port handling and the docs is needed but the former is tricky to do without breaking backwards compatibility.\r\n\r\nTL;DR -- try this instead:\r\n```\r\nclass{ 'jenkins':\r\n  config_hash => { 'HTTP_PORT' => { 'value' => '9090' }},\r\n}\r\n```\r\nPs. - I doubt you'll be able to bind jenkins directly to a privileged port with the current init script.  I suggest using iptables or a proxy server -- I use nginx in front jenkins."}}