From 4c96b1d42e908036acc25bb2900703c0f365bd7b Mon Sep 17 00:00:00 2001 From: ayushbhatt29 Date: Wed, 9 Jun 2021 13:39:39 +0530 Subject: [PATCH 1/6] Update for installatin failure in Solaris Signed-off-by: ayushbhatt29 --- providers/default.rb | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/providers/default.rb b/providers/default.rb index 0146c89..f07c8d1 100644 --- a/providers/default.rb +++ b/providers/default.rb @@ -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 shell_out("(python -mplatform || cat /etc/release || cat /etc/os-release)| grep Solaris> /dev/null") + move_opt_chef(etc_chef_upgrade,etc_chef) + end # make sure the passed action will actually work eval_post_install_action @@ -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) @@ -645,7 +657,16 @@ 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 + else + if shell_out("(python -mplatform || cat /etc/release || cat /etc/os-release)| grep Solaris> /dev/null") + 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 + end execute_install_script(install_script) end @@ -683,6 +704,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 shell_out("(python -mplatform || cat /etc/release || cat /etc/os-release)| grep Solaris> /dev/null") + move_opt_chef(etc_chef_upgrade, etc_chef) + end else Chef::Log.warn "NO #{chef_backup_dir} DIR TO ROLL BACK TO!" end From d8d4699d20f811b970c1919a12c65aba1e6b9d31 Mon Sep 17 00:00:00 2001 From: ayushbhatt29 Date: Thu, 10 Jun 2021 16:23:09 +0530 Subject: [PATCH 2/6] Update in providers Signed-off-by: ayushbhatt29 --- providers/default.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/providers/default.rb b/providers/default.rb index f07c8d1..14ced07 100644 --- a/providers/default.rb +++ b/providers/default.rb @@ -184,7 +184,7 @@ def eval_post_install_action def run_post_install_action # In solaris moving /etc/chef.upgrade to /etc/chef - if shell_out("(python -mplatform || cat /etc/release || cat /etc/os-release)| grep Solaris> /dev/null") + if platform_family?('solaris2') move_opt_chef(etc_chef_upgrade,etc_chef) end # make sure the passed action will actually work @@ -659,14 +659,12 @@ def license_acceptance! # ...before we blow mixlib-install away if platform_family?('windows') prepare_windows - else - if shell_out("(python -mplatform || cat /etc/release || cat /etc/os-release)| grep Solaris> /dev/null") + elsif platform_family?('solaris2') copy_opt_chef(chef_install_dir, chef_backup_dir) move_opt_chef(etc_chef, etc_chef_upgrade) - else + else move_opt_chef(chef_install_dir, chef_backup_dir) - end - end + end execute_install_script(install_script) end @@ -705,7 +703,7 @@ def license_acceptance! 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 shell_out("(python -mplatform || cat /etc/release || cat /etc/os-release)| grep Solaris> /dev/null") + if platform_family?('solaris2') move_opt_chef(etc_chef_upgrade, etc_chef) end else From 302337728903c2fbccc99de1496f86dc9d02f780 Mon Sep 17 00:00:00 2001 From: ayushbhatt29 Date: Thu, 16 Sep 2021 15:18:28 +0530 Subject: [PATCH 3/6] removing delivery.yml Signed-off-by: ayushbhatt29 --- .github/workflows/delivery.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflows/delivery.yml diff --git a/.github/workflows/delivery.yml b/.github/workflows/delivery.yml deleted file mode 100644 index 4b5c467..0000000 --- a/.github/workflows/delivery.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: delivery - -on: [push, pull_request] - -jobs: - delivery: - - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@master - - name: Run Chef Delivery - uses: actionshub/chef-delivery@master - env: - CHEF_LICENSE: accept-no-persist \ No newline at end of file From fa0e62982987ed70a5e45c7eb63f057365bfe589 Mon Sep 17 00:00:00 2001 From: ayushbhatt29 Date: Fri, 17 Sep 2021 11:12:09 +0530 Subject: [PATCH 4/6] changes in delivery Signed-off-by: ayushbhatt29 --- .github/workflows/delivery.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/delivery.yml diff --git a/.github/workflows/delivery.yml b/.github/workflows/delivery.yml new file mode 100644 index 0000000..d03b70f --- /dev/null +++ b/.github/workflows/delivery.yml @@ -0,0 +1,16 @@ +name: delivery + +on: [push, pull_request] + +jobs: + delivery: + + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@main + - name: Run Chef Delivery + uses: actionshub/chef-delivery@main + env: + CHEF_LICENSE: accept-no-persist \ No newline at end of file From 7662a3f9caac41b0612fa367768ddb10237760d9 Mon Sep 17 00:00:00 2001 From: ayushbhatt29 Date: Tue, 21 Sep 2021 11:01:17 +0530 Subject: [PATCH 5/6] changes in project.toml Signed-off-by: ayushbhatt29 --- .delivery/project.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.delivery/project.toml b/.delivery/project.toml index 6d5e361..e703549 100644 --- a/.delivery/project.toml +++ b/.delivery/project.toml @@ -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" \ No newline at end of file From 7ca050e1f639fc08d6cf57e5d120fd5f3244a259 Mon Sep 17 00:00:00 2001 From: ayushbhatt29 Date: Tue, 21 Sep 2021 11:30:45 +0530 Subject: [PATCH 6/6] changes in providers Signed-off-by: ayushbhatt29 --- providers/default.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/providers/default.rb b/providers/default.rb index 14ced07..9ced1bf 100644 --- a/providers/default.rb +++ b/providers/default.rb @@ -185,7 +185,7 @@ def eval_post_install_action 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) + move_opt_chef(etc_chef_upgrade, etc_chef) end # make sure the passed action will actually work eval_post_install_action @@ -236,7 +236,7 @@ def chef_upgrade_log def etc_chef '/etc/chef' -end +end def etc_chef_upgrade "#{etc_chef}.upgrade" @@ -658,13 +658,13 @@ def license_acceptance! install_script = mixlib_install.install_command # ...before we blow mixlib-install away 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) + 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 + move_opt_chef(chef_install_dir, chef_backup_dir) + end execute_install_script(install_script) end @@ -702,9 +702,9 @@ 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 + # rolling back etc\chef in solaris if platform_family?('solaris2') - move_opt_chef(etc_chef_upgrade, etc_chef) + move_opt_chef(etc_chef_upgrade, etc_chef) end else Chef::Log.warn "NO #{chef_backup_dir} DIR TO ROLL BACK TO!"