Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #165 #174

Merged
merged 2 commits into from
May 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion manifests/mcollective.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,23 @@
$app_path = $r10k::params::mc_application_path,
$mc_service = $r10k::params::mc_service_name,
$http_proxy = $r10k::params::mc_http_proxy,
$git_ssl_verify = $r10k::params::mc_git_ssl_verify,
$git_ssl_verify = $r10k::params::mc_git_ssl_verify, # Deprecated
$git_ssl_no_verify = $r10k::params::mc_git_ssl_no_verify,
) inherits r10k::params {
File {
ensure => present,
owner => 'root',
group => '0',
mode => '0644',
}

if $git_ssl_verify {
warning('$git_ssl_verify parameter is deprecated, please use $git_ssl_no_verify instead')
$agent_no_verify = $git_ssl_verify
} else {
$agent_no_verify = $git_ssl_no_verify
}

# Install the agent and its ddl file
file { "${app_path}/${app_name}":
source => "puppet:///modules/${module_name}/application/${agent_name}",
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
$mc_agent_path = "${plugins_dir}/agent"
$mc_application_path = "${plugins_dir}/application"
$mc_http_proxy = undef
$mc_git_ssl_verify = 0
$mc_git_ssl_verify = undef # Deprecated parameter - Renamed to $mc_git_ssl_no_verify for clarity
$mc_git_ssl_no_verify = 0

# Service Settings for SystemD in EL7
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '7' {
Expand Down
52 changes: 52 additions & 0 deletions spec/classes/mcollective_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,59 @@
)
}

it {
should contain_file("/opt/puppet/libexec/mcollective/mcollective/agent/r10k.rb").
with_content(/\"GIT_SSL_NO_VERIFY\" => \"0\"/)
}

end

context "Allows you to set git_ssl_no_verify for r10k file" do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '5',
:operatingsystem => 'Centos',
:is_pe => 'true'
}
end

let :params do
{
:git_ssl_no_verify => 1,
}
end

it {
should contain_file("/opt/puppet/libexec/mcollective/mcollective/agent/r10k.rb").
with_content(/\"GIT_SSL_NO_VERIFY\" => \"1\"/)
}

end

context "Allows you to set git_ssl_verify for r10k file (deprecated - to be removed in major bump)" do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '5',
:operatingsystem => 'Centos',
:is_pe => 'true'
}
end

let :params do
{
:git_ssl_verify => 1,
}
end

it {
should contain_file("/opt/puppet/libexec/mcollective/mcollective/agent/r10k.rb").
with_content(/\"GIT_SSL_NO_VERIFY\" => \"1\"/)
}

end

context "Puppet FOSS on a RedHat 5 OS installing mcollective agent & application" do
let :facts do
{
Expand Down
2 changes: 1 addition & 1 deletion templates/agent/r10k.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module MCollective
git = ['/usr/bin/env', 'git']
r10k = ['/usr/bin/env', 'r10k']
# Given most people using this are using Puppet Enterprise, add the PE Path
environment = {"LC_ALL" => "C","PATH" => "#{ENV['PATH']}:<%= if @is_pe == true or @is_pe == 'true' then '/opt/puppet/bin' else '/usr/local/bin' end %>", "http_proxy" => "<%= @http_proxy %>", "https_proxy" => "<%= @http_proxy %>", "GIT_SSL_NO_VERIFY" => "<%= @git_ssl_verify %>" }
environment = {"LC_ALL" => "C","PATH" => "#{ENV['PATH']}:<%= if @is_pe == true or @is_pe == 'true' then '/opt/puppet/bin' else '/usr/local/bin' end %>", "http_proxy" => "<%= @http_proxy %>", "https_proxy" => "<%= @http_proxy %>", "GIT_SSL_NO_VERIFY" => "<%= @agent_no_verify %>" }
case action
when 'push','pull','status'
cmd = git
Expand Down