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

Update for installation failure in Solaris #233

Closed
wants to merge 6 commits into from
Closed
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
10 changes: 9 additions & 1 deletion .delivery/project.toml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
[local_phases]
unit = "rspec spec/"
lint = 'cookstyle --display-cop-names --extra-details'
syntax = "echo syntax checking with foodcritic has been replaced with cookstyle. skipping"
provision = "echo skipping"
deploy = "echo skipping"
smoke = "echo skipping"
functional = "echo skipping"
cleanup = "echo skipping"
4 changes: 2 additions & 2 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@main
- name: Run Chef Delivery
uses: actionshub/chef-delivery@master
uses: actionshub/chef-delivery@main
env:
CHEF_LICENSE: accept-no-persist
25 changes: 24 additions & 1 deletion providers/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def eval_post_install_action
end

def run_post_install_action
# In solaris moving /etc/chef.upgrade to /etc/chef
if platform_family?('solaris2')
move_opt_chef(etc_chef_upgrade, etc_chef)
end
# make sure the passed action will actually work
eval_post_install_action

Expand Down Expand Up @@ -230,6 +234,14 @@ def chef_upgrade_log
"#{chef_install_dir}_upgrade.log"
end

def etc_chef
'/etc/chef'
end

def etc_chef_upgrade
"#{etc_chef}.upgrade"
end

# cleanup cruft from *prior* runs
def cleanup
if ::File.exist?(chef_backup_dir)
Expand Down Expand Up @@ -645,7 +657,14 @@ def license_acceptance!
# we have to get the script from mixlib-install..
install_script = mixlib_install.install_command
# ...before we blow mixlib-install away
platform_family?('windows') ? prepare_windows : move_opt_chef(chef_install_dir, chef_backup_dir)
if platform_family?('windows')
prepare_windows
elsif platform_family?('solaris2')
copy_opt_chef(chef_install_dir, chef_backup_dir)
move_opt_chef(etc_chef, etc_chef_upgrade)
else
move_opt_chef(chef_install_dir, chef_backup_dir)
end

execute_install_script(install_script)
end
Expand Down Expand Up @@ -683,6 +702,10 @@ def license_acceptance!
if ::File.exist?(chef_backup_dir)
Chef::Log.warn "CHEF INFRA CLIENT UPGRADE ABORTED due to #{e}: rolling back to #{chef_backup_dir} copy"
move_opt_chef(chef_backup_dir, chef_install_dir) unless platform_family?('windows')
# rolling back etc\chef in solaris
if platform_family?('solaris2')
move_opt_chef(etc_chef_upgrade, etc_chef)
end
else
Chef::Log.warn "NO #{chef_backup_dir} DIR TO ROLL BACK TO!"
end
Expand Down