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

Execute custom_install_command as very first #127

Closed
wants to merge 1 commit into from
Closed
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
15 changes: 6 additions & 9 deletions lib/kitchen/provisioner/puppet_apply.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def install_command
info("Installing puppet on #{config[:platform]}")
# need to add a CR to avoid trouble with proxy settings concatenation
<<-INSTALL

#{custom_install_command}
if [ ! $(which puppet) ]; then
#{sudo('apt-get')} -y install wget
#{sudo('wget')} #{wget_proxy_parm} #{puppet_apt_repo}
Expand All @@ -198,26 +198,24 @@ def install_command
#{install_eyaml}
#{install_deep_merge}
#{install_busser}
#{custom_install_command}
INSTALL
when 'redhat', 'centos', 'fedora', 'oracle', 'amazon'
info("Installing puppet from yum on #{puppet_platform}")
# need to add a CR to avoid trouble with proxy settings concatenation
<<-INSTALL

#{custom_install_command}
if [ ! $(which puppet) ]; then
#{install_puppet_yum_repo}
fi
#{install_eyaml}
#{install_deep_merge}
#{install_busser}
#{custom_install_command}
INSTALL
else
info('Installing puppet, will try to determine platform os')
# need to add a CR to avoid trouble with proxy settings concatenation
<<-INSTALL

#{custom_install_command}
if [ ! $(which puppet) ]; then
if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ] || [ -f /etc/oracle-release ]; then
#{install_puppet_yum_repo}
Expand All @@ -239,7 +237,6 @@ def install_command
#{install_eyaml}
#{install_deep_merge}
#{install_busser}
#{custom_install_command}
INSTALL
end
end
Expand All @@ -252,6 +249,7 @@ def install_command_collections
info("Installing Puppet Collections on #{puppet_platform}")
<<-INSTALL
#{Util.shell_helpers}
#{custom_install_command}
if [ ! -d "#{config[:puppet_coll_remote_path]}" ]; then
if [ ! -f "#{config[:puppet_apt_collections_repo]}" ]; then
#{sudo('apt-get')} -y install wget
Expand All @@ -264,12 +262,12 @@ def install_command_collections
#{install_eyaml("#{config[:puppet_coll_remote_path]}/puppet/bin/gem")}
#{install_deep_merge}
#{install_busser}
#{custom_install_command}
INSTALL
when 'redhat', 'centos', 'fedora', 'oracle', 'amazon'
info("Installing Puppet Collections on #{puppet_platform}")
<<-INSTALL
#{Util.shell_helpers}
#{custom_install_command}
if [ ! -d "#{config[:puppet_coll_remote_path]}" ]; then
echo "-----> #{sudo_env('yum')} -y localinstall #{config[:puppet_yum_collections_repo]}"
#{sudo_env('yum')} -y localinstall #{config[:puppet_yum_collections_repo]}
Expand All @@ -278,12 +276,12 @@ def install_command_collections
#{install_eyaml("#{config[:puppet_coll_remote_path]}/puppet/bin/gem")}
#{install_deep_merge}
#{install_busser}
#{custom_install_command}
INSTALL
else
info('Installing Puppet Collections, will try to determine platform os')
<<-INSTALL
#{Util.shell_helpers}
#{custom_install_command}
if [ ! -d "#{config[:puppet_coll_remote_path]}" ]; then
if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ] || [ -f /etc/oracle-release ] || \
[ -f /etc/system-release ] || [ grep -q 'Amazon Linux' /etc/system-release ]; then
Expand All @@ -301,7 +299,6 @@ def install_command_collections
#{install_eyaml("#{config[:puppet_coll_remote_path]}/puppet/bin/gem")}
#{install_deep_merge}
#{install_busser}
#{custom_install_command}
INSTALL
end
end
Expand Down