From 07bea617cf4a5cdff7c363754bf16f031bdb3587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 22 Nov 2023 16:35:15 -1000 Subject: [PATCH] Remove legacy top-scope syntax --- CHANGELOG.md | 14 +++++++------- HISTORY.md | 2 +- NATIVE_TYPES_AND_PROVIDERS.md | 4 ++-- README.md | 6 +++--- lib/puppet/parser/functions/jenkins_port.rb | 2 +- lib/puppet/parser/functions/jenkins_prefix.rb | 2 +- manifests/cli.pp | 4 ++-- manifests/init.pp | 2 +- manifests/job/present.pp | 2 +- spec/functions/jenkins_prefix_spec.rb | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed0a4b8c..c40a053cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -224,7 +224,7 @@ These should not affect the functionality of the module. - systemd jenkins master support on RedHat [\#694](https://github.com/voxpupuli/puppet-jenkins/pull/694) ([jhoblitt](https://github.com/jhoblitt)) - fix slave systemd support [\#692](https://github.com/voxpupuli/puppet-jenkins/pull/692) ([jhoblitt](https://github.com/jhoblitt)) - add swarm client systemd support [\#691](https://github.com/voxpupuli/puppet-jenkins/pull/691) ([jhoblitt](https://github.com/jhoblitt)) -- add ::jenkins::sysconfdir parameter [\#689](https://github.com/voxpupuli/puppet-jenkins/pull/689) ([jhoblitt](https://github.com/jhoblitt)) +- add jenkins::sysconfdir parameter [\#689](https://github.com/voxpupuli/puppet-jenkins/pull/689) ([jhoblitt](https://github.com/jhoblitt)) - disable plugin pinning by default [\#688](https://github.com/voxpupuli/puppet-jenkins/pull/688) ([jhoblitt](https://github.com/jhoblitt)) - add firewall module dependency info [\#676](https://github.com/voxpupuli/puppet-jenkins/pull/676) ([vinhut](https://github.com/vinhut)) - Add support for gitlab api token credential - \#664 [\#667](https://github.com/voxpupuli/puppet-jenkins/pull/667) ([ripclawffb](https://github.com/ripclawffb)) @@ -245,7 +245,7 @@ These should not affect the functionality of the module. - Won't install alongside puppetlabs-mysql [\#623](https://github.com/voxpupuli/puppet-jenkins/issues/623) - uninitialized constant json when using Jenkins\_credentials provider [\#617](https://github.com/voxpupuli/puppet-jenkins/issues/617) - `jenkins_user` experimental password setting is broken [\#499](https://github.com/voxpupuli/puppet-jenkins/issues/499) -- Ensure $::jenkins::localstatedir to Directory Breaks Filesystem's With Symlinked Mounts [\#403](https://github.com/voxpupuli/puppet-jenkins/issues/403) +- Ensure $jenkins::localstatedir to Directory Breaks Filesystem's With Symlinked Mounts [\#403](https://github.com/voxpupuli/puppet-jenkins/issues/403) - repo::debian.pp does not work with apt module \>= 2.0.0 [\#402](https://github.com/voxpupuli/puppet-jenkins/issues/402) - Jenkins Plugin manifest are now readable since it has got some invalid byte sequence in US-ASCII [\#265](https://github.com/voxpupuli/puppet-jenkins/issues/265) - Default INFO logging makes jenkins cli output messages that are then … [\#907](https://github.com/voxpupuli/puppet-jenkins/pull/907) ([jhooyberghs](https://github.com/jhooyberghs)) @@ -302,7 +302,7 @@ These should not affect the functionality of the module. - setting security is not idempotent [\#673](https://github.com/voxpupuli/puppet-jenkins/issues/673) - 'digest\_type' default of 'sha1' is causing all plugins to install repeatedly [\#668](https://github.com/voxpupuli/puppet-jenkins/issues/668) - puppet\_helper.groovy throws an error with unsupported credentials [\#664](https://github.com/voxpupuli/puppet-jenkins/issues/664) -- $::jenkins::libdir is undef in jenkins::cli class [\#654](https://github.com/voxpupuli/puppet-jenkins/issues/654) +- $jenkins::libdir is undef in jenkins::cli class [\#654](https://github.com/voxpupuli/puppet-jenkins/issues/654) - Unsuccessful Installation [\#647](https://github.com/voxpupuli/puppet-jenkins/issues/647) - jenkins::plugins doesn't work properly with puppet 4.6.2 [\#637](https://github.com/voxpupuli/puppet-jenkins/issues/637) - Allow virtual jenkins host [\#630](https://github.com/voxpupuli/puppet-jenkins/issues/630) @@ -440,7 +440,7 @@ These should not affect the functionality of the module. - jenkins-slave don't stop correctly [\#557](https://github.com/voxpupuli/puppet-jenkins/issues/557) - jenkins\_job broken by org.jenkinsci.plugins.workflow.job.WorkflowJob jobs [\#551](https://github.com/voxpupuli/puppet-jenkins/issues/551) - Parameter jenkins::slave::ui\_pass not enclosed in quotes. [\#542](https://github.com/voxpupuli/puppet-jenkins/issues/542) -- ::jenkins::slave should not depend on ::jenkins [\#533](https://github.com/voxpupuli/puppet-jenkins/issues/533) +- jenkins::slave should not depend on jenkins [\#533](https://github.com/voxpupuli/puppet-jenkins/issues/533) - slow unit test causing travis failures [\#517](https://github.com/voxpupuli/puppet-jenkins/issues/517) - jenkins:plugin can incorrectly believe a plugin is installed \(when it isn't\) [\#513](https://github.com/voxpupuli/puppet-jenkins/issues/513) - jenkins::plugin ignores version changes [\#512](https://github.com/voxpupuli/puppet-jenkins/issues/512) @@ -497,7 +497,7 @@ These should not affect the functionality of the module. - Plugins specified by version number are not updated [\#445](https://github.com/voxpupuli/puppet-jenkins/issues/445) - Passing an array to jenkins::plugin [\#429](https://github.com/voxpupuli/puppet-jenkins/issues/429) - Unable to persist firewall rules: Execution of '/usr/libexec/iptables/iptables.init save' returned 1: [\#424](https://github.com/voxpupuli/puppet-jenkins/issues/424) -- $::jenkins::port does not properly manage listening port [\#416](https://github.com/voxpupuli/puppet-jenkins/issues/416) +- $jenkins::port does not properly manage listening port [\#416](https://github.com/voxpupuli/puppet-jenkins/issues/416) - Using Plugin Hash Exec Test for plugin Fails [\#410](https://github.com/voxpupuli/puppet-jenkins/issues/410) - jenkins::job::present issue [\#409](https://github.com/voxpupuli/puppet-jenkins/issues/409) - Using Direct URL for plug-ins restarts jenkins with every puppet run [\#408](https://github.com/voxpupuli/puppet-jenkins/issues/408) @@ -518,7 +518,7 @@ These should not affect the functionality of the module. - replace centos-7-docker fakesystemd with classic flavor [\#550](https://github.com/voxpupuli/puppet-jenkins/pull/550) ([jhoblitt](https://github.com/jhoblitt)) - travis puppet versions [\#549](https://github.com/voxpupuli/puppet-jenkins/pull/549) ([jhoblitt](https://github.com/jhoblitt)) - fix beaker acceptance tests on Ubuntu [\#548](https://github.com/voxpupuli/puppet-jenkins/pull/548) ([jhoblitt](https://github.com/jhoblitt)) -- simplify ::jenkins::slave ordering logic [\#547](https://github.com/voxpupuli/puppet-jenkins/pull/547) ([jhoblitt](https://github.com/jhoblitt)) +- simplify jenkins::slave ordering logic [\#547](https://github.com/voxpupuli/puppet-jenkins/pull/547) ([jhoblitt](https://github.com/jhoblitt)) - skip pending beaker tests [\#546](https://github.com/voxpupuli/puppet-jenkins/pull/546) ([jhoblitt](https://github.com/jhoblitt)) - minor puppet\_helper.groovy cleanup [\#543](https://github.com/voxpupuli/puppet-jenkins/pull/543) ([jhoblitt](https://github.com/jhoblitt)) - Improve spec speed [\#537](https://github.com/voxpupuli/puppet-jenkins/pull/537) ([petems](https://github.com/petems)) @@ -638,7 +638,7 @@ These should not affect the functionality of the module. * [#275](https://github.com/jenkinsci/puppet-jenkins/pull/275) - add .bundle to .gitignore * [#276](https://github.com/jenkinsci/puppet-jenkins/pull/276) - add log/ to .gitignore * [#277](https://github.com/jenkinsci/puppet-jenkins/pull/277) - add puppet 3.7.0 to travis matrix -* [#278](https://github.com/jenkinsci/puppet-jenkins/pull/278) - remove unnecessary whitespace from $::jenkins::cli_helper::helper_cmd +* [#278](https://github.com/jenkinsci/puppet-jenkins/pull/278) - remove unnecessary whitespace from $jenkins::cli_helper::helper_cmd * [#279](https://github.com/jenkinsci/puppet-jenkins/pull/279) - add metadata-json-lint to Gemfile & enable rake validate target * [#280](https://github.com/jenkinsci/puppet-jenkins/pull/280) - change puppetlabs/stdlib version dep to >= 4.6.0 * [#282](https://github.com/jenkinsci/puppet-jenkins/pull/282) - Feature/puppet 4 diff --git a/HISTORY.md b/HISTORY.md index b58e28133..4c2d21a49 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -89,7 +89,7 @@ * [#275](https://github.com/jenkinsci/puppet-jenkins/pull/275) - add .bundle to .gitignore * [#276](https://github.com/jenkinsci/puppet-jenkins/pull/276) - add log/ to .gitignore * [#277](https://github.com/jenkinsci/puppet-jenkins/pull/277) - add puppet 3.7.0 to travis matrix -* [#278](https://github.com/jenkinsci/puppet-jenkins/pull/278) - remove unnecessary whitespace from $::jenkins::cli_helper::helper_cmd +* [#278](https://github.com/jenkinsci/puppet-jenkins/pull/278) - remove unnecessary whitespace from $jenkins::cli_helper::helper_cmd * [#279](https://github.com/jenkinsci/puppet-jenkins/pull/279) - add metadata-json-lint to Gemfile & enable rake validate target * [#280](https://github.com/jenkinsci/puppet-jenkins/pull/280) - change puppetlabs/stdlib version dep to >= 4.6.0 * [#282](https://github.com/jenkinsci/puppet-jenkins/pull/282) - Feature/puppet 4 diff --git a/NATIVE_TYPES_AND_PROVIDERS.md b/NATIVE_TYPES_AND_PROVIDERS.md index d9dd05deb..a49e974f2 100644 --- a/NATIVE_TYPES_AND_PROVIDERS.md +++ b/NATIVE_TYPES_AND_PROVIDERS.md @@ -114,11 +114,11 @@ master service to be running. Most require the presence of sufficiently for all providers to function. ``` -class { '::jenkins': +class { 'jenkins': install_java => true, cli => true, } -include ::jenkins::cli_helper +include jenkins::cli_helper ``` The ruby gem `retries` is presently required by all providers. diff --git a/README.md b/README.md index a3e98cb80..47f3801a7 100644 --- a/README.md +++ b/README.md @@ -35,12 +35,12 @@ This module has been adjusted to support the new CLI. The CLI supports proper authentication with username and password. It's a requirement for supporting AD and OpenID authentications (there is no ssh key -there). You can supply ```$::jenkins::cli_username``` and -```$::jenkins::cli_password``` to use username / password based authentication. +there). You can supply ```$jenkins::cli_username``` and +```$jenkins::cli_password``` to use username / password based authentication. Then the puppet automation user can also reside in A.D Note: Jenkins requires a ssh username, so you must also provide -```$::jenkins::cli_username``` for ssh. If you specify both username/password +```$jenkins::cli_username``` for ssh. If you specify both username/password and ssh key file, SSH authentication is preferred. # Using puppet-jenkins diff --git a/lib/puppet/parser/functions/jenkins_port.rb b/lib/puppet/parser/functions/jenkins_port.rb index 3461b050b..023eb8e0b 100644 --- a/lib/puppet/parser/functions/jenkins_port.rb +++ b/lib/puppet/parser/functions/jenkins_port.rb @@ -10,7 +10,7 @@ module Puppet::Parser::Functions $port = jenkins_port() ENDHEREDOC - config_hash = lookupvar('::jenkins::config_hash') + config_hash = lookupvar('jenkins::config_hash') config_hash&.dig('JENKINS_PORT', 'value') || 8080 end end diff --git a/lib/puppet/parser/functions/jenkins_prefix.rb b/lib/puppet/parser/functions/jenkins_prefix.rb index 80a6a55bd..444c5bcbf 100644 --- a/lib/puppet/parser/functions/jenkins_prefix.rb +++ b/lib/puppet/parser/functions/jenkins_prefix.rb @@ -10,7 +10,7 @@ module Puppet::Parser::Functions $prefix = jenkins_prefix() ENDHEREDOC - config_hash = lookupvar('::jenkins::config_hash') + config_hash = lookupvar('jenkins::config_hash') config_hash&.dig('PREFIX', 'value') || '' end end diff --git a/manifests/cli.pp b/manifests/cli.pp index abad8ebe6..29336b6ea 100644 --- a/manifests/cli.pp +++ b/manifests/cli.pp @@ -6,7 +6,7 @@ include jenkins # XXX Classes/defines which include the jenkins::cli class assume that they - # can use the cli even if $::jenkins::cli == false. This breaks the top + # can use the cli even if $jenkins::cli == false. This breaks the top # level anchor pattern. The cli param should either be deprecated and # essentially hardwired to true or attempting to use cli functionality # without this param set should fail; either option is a backwards @@ -72,7 +72,7 @@ require => File[$jar], } - # jenkins::cli::reload should be included only after $::jenkins::cli::cmd is + # jenkins::cli::reload should be included only after $jenkins::cli::cmd is # defined include jenkins::cli::reload } diff --git a/manifests/init.pp b/manifests/init.pp index 424b665ab..0f5e89761 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -325,7 +325,7 @@ if $cli_ssh_keyfile { # SSH key auth if empty($cli_username) { - fail('ERROR: Latest remoting free CLI (see https://issues.jenkins-ci.org/browse/JENKINS-41745) needs username for SSH Access (\$::jenkins::cli_username)') + fail('ERROR: Latest remoting free CLI (see https://issues.jenkins-ci.org/browse/JENKINS-41745) needs username for SSH Access (\$jenkins::cli_username)') } $_cli_auth_arg = "-i '${cli_ssh_keyfile}' -ssh -user '${cli_username}'" } elsif !empty($cli_username) { diff --git a/manifests/job/present.pp b/manifests/job/present.pp index d2d7194fa..dcfb891ee 100644 --- a/manifests/job/present.pp +++ b/manifests/job/present.pp @@ -62,7 +62,7 @@ $job_dir = "${jenkins::job_dir}/${jobname}" $config_path = "${job_dir}/config.xml" - # Bring variables from Class['::jenkins'] into local scope. + # Bring variables from Class['jenkins'] into local scope. $cli_tries = $jenkins::cli_tries $cli_try_sleep = $jenkins::cli_try_sleep diff --git a/spec/functions/jenkins_prefix_spec.rb b/spec/functions/jenkins_prefix_spec.rb index 7669011c2..4cd829c0d 100644 --- a/spec/functions/jenkins_prefix_spec.rb +++ b/spec/functions/jenkins_prefix_spec.rb @@ -9,7 +9,7 @@ context 'with default parameters' do let(:pre_condition) do - 'include ::jenkins' + 'include jenkins' end it { is_expected.to run.with_params.and_return('') }