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

Workaround to using latest version of chef on ubuntu ppc64le #839

Open
svghadi opened this issue Mar 17, 2022 · 0 comments
Open

Workaround to using latest version of chef on ubuntu ppc64le #839

svghadi opened this issue Mar 17, 2022 · 0 comments

Comments

@svghadi
Copy link
Contributor

svghadi commented Mar 17, 2022

Problem

Chef versions greater than v15.1.36 do not support ubuntu ppc64le. The packer build throws following error

2022/03/10 07:27:37 [INFO] (telemetry) Starting provisioner chef-solo
==> openstack: Provisioning with chef-solo
    openstack: Installing Chef...
2022/03/10 07:27:37 packer-builder-openstack plugin: [DEBUG] Opening new ssh session
2022/03/10 07:27:37 packer-builder-openstack plugin: [DEBUG] starting remote command: curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -v 17.6.18
==> openstack:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
==> openstack:                                  Dload  Upload   Total   Spent    Left  Speed
==> openstack: 100 23409  100 23409    0     0   100k      0 --:--:-- --:--:-- --:--:--  101k
    openstack: ubuntu 16.04 ppc64le
    openstack: Getting information for chef stable 17.6.18 for ubuntu...
    openstack: downloading https://omnitruck.chef.io/stable/chef/metadata?v=17.6.18&p=ubuntu&pv=16.04&m=ppc64le
    openstack:   to file /tmp/install.sh.19355/metadata.txt
    openstack: trying wget...
    openstack: ERROR 404
    openstack: Omnitruck artifact does not exist for version 17.6.18 on platform ubuntu
    openstack:
    openstack: Either this means:
    openstack:    - We do not support ubuntu
    openstack:
    openstack: This is often the latter case due to running a prerelease or RC version of Chef
    openstack: or a gem version which was only pushed to rubygems and not omnitruck.
    openstack:
    openstack: You may be able to set your knife[:bootstrap_version] to the most recent stable
    openstack: release of Chef to fix this problem (or the most recent stable major version number).
    openstack:
    openstack: In order to test the version parameter, adventurous users may take the Metadata URL
    openstack: below and modify the '&v=<number>' parameter until you successfully get a URL that
    openstack: does not 404 (e.g. via curl or wget).  You should be able to use '&v=11' or '&v=12'
    openstack: successfully.
    openstack:
    openstack: If you cannot fix this problem by setting the bootstrap_version, it probably means
    openstack: that ubuntu is not supported.
    openstack:
    openstack: Metadata URL: https://omnitruck.chef.io/stable/chef/metadata?v=17.6.18&p=ubuntu&pv=16.04&m=ppc64le
2022/03/10 07:27:38 [INFO] (telemetry) ending chef-solo

Workaround

  • Build chef.deb file of required version on ppc64le using chef_ubuntu_20.04.sh script.
  • Copy the chef.deb file to /tmp/ directory of machine from where packer build will be triggered.
  • Add below modification so that locally built chef.deb file is used during build.
diff --git a/ci-sardonyx.yml b/ci-sardonyx.yml
index 9b17e150..dc08689d 100644
--- a/ci-sardonyx.yml
+++ b/ci-sardonyx.yml
@@ -159,8 +159,15 @@ provisioners:
   destination: /var/tmp/sardonyx-system-info-commands.yml
 - type: shell
   inline: chmod 0644 /var/tmp/sardonyx-system-info-commands.yml
+- type: file
+  source: /tmp/chef.deb
+  destination: /tmp/chef.deb
+- type: shell
+  inline: sudo dpkg -i /tmp/chef.deb && sudo rm -f /tmp/chef.deb
 - type: chef-solo
   version: 17.6.18
+  chef_license: "accept-silent"
+  skip_install: true
   config_template: chef-solo.rb.tmpl
   <% if ENV['CHEF_PROFILING'] %>
   execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo --chef-license accept-silent -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant