You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to use the jenkins_script resource with the groovy_path attribute set, as opposed to the command attribute set to a block of inline Groovy code, jenkins-cli returns the following error:
ERROR: This command is requesting the -remoting mode which is no longer supported. See https://www.jenkins.io/redirect/cli-command-requires-channel
I have a workaround that allows me to use a groovy file written by a template resource, which looks like this:
template ::File.join(Chef::Config[:file_cache_path], 'add_authentication.groovy') do
source 'add_authentication.groovy.erb'
mode '0644'
owner 'jenkins'
group 'jenkins'
variables(
password: 'somepassword'
)
notifies :execute, 'jenkins_script[add_authentication]', :immediately
sensitive true
end
jenkins_script 'add_authentication' do
command(lazy { ::File.open(::File.join(Chef::Config[:file_cache_path], 'add_authentication.groovy')).read })
not_if 'grep ldapserver /var/lib/jenkins/config.xml'
end
🥞 Cookbook version
9.5.0
👩🍳 Chef-Infra Version
17.8.25
🎩 Platform details
Ubuntu 20.04 LTS
Steps To Reproduce
Within some recipe, use include the following:
template ::File.join(Chef::Config[:file_cache_path], 'add_authentication.groovy') do
source 'add_authentication.groovy.erb'
mode '0644'
owner 'jenkins'
group 'jenkins'
variables(
password: 'somepassword'
)
notifies :execute, 'jenkins_script[add_authentication]', :immediately
sensitive true
end
jenkins_script 'add_authentication' do
groovy_path ::File.join(Chef::Config[:file_cache_path], 'add_authentication.groovy')
not_if 'grep ldapserver /var/lib/jenkins/config.xml'
end
You should get the error mentioned above during convergence.
🚓 Expected behavior
The executed jenkins-cli command should look something like this:
The additional = sign in the first example above is what seems to allow it to behave the way it should, without throwing the error about the -remoting option no longer being supported.
The text was updated successfully, but these errors were encountered:
👻 Brief Description
When attempting to use the
jenkins_script
resource with thegroovy_path
attribute set, as opposed to the command attribute set to a block of inline Groovy code, jenkins-cli returns the following error:I have a workaround that allows me to use a groovy file written by a template resource, which looks like this:
🥞 Cookbook version
9.5.0
👩🍳 Chef-Infra Version
17.8.25
🎩 Platform details
Ubuntu 20.04 LTS
Steps To Reproduce
Within some recipe, use include the following:
You should get the error mentioned above during convergence.
🚓 Expected behavior
The executed jenkins-cli command should look something like this:
It currently looks something like this:
The additional
=
sign in the first example above is what seems to allow it to behave the way it should, without throwing the error about the-remoting
option no longer being supported.The text was updated successfully, but these errors were encountered: