chef-cookbooks / runit

Development repository for the Chef Runit Cookbook
https://supermarket.chef.io/cookbooks/runit
Apache License 2.0
107 stars 197 forks source link

Enable runit installation in OEL systems #164

Closed afiune closed 8 years ago

afiune commented 8 years ago

The imeyer/runit packagecloud repo does not have the ability to resolve packages for OEL systems.

This commit enables runit cookbook to be able to install in OEL systems by forcing the os platform to be rhel since that is the base and packages should work the same way.

Pointing to packagecloud repo (master) in github since there is where the new code for forcing exist. (Need to release it to Supermarket)

afiune commented 8 years ago

What are you thoughts on this? :smile: cc/ @cwjohnston @chrisroberts

cwjohnston commented 8 years ago

Hi @afiune, thanks for the PR.

Looks like this needs rebase at the moment. After checking it out locally, kitchen-vagrant is not able to automatically pull in a base box for oel-67. Is there additional configuration you can add for the base box image?

afiune commented 8 years ago

@cwjohnston rebasing.. I honestly built the box manually through https://github.com/rafacas/vagrant-boxes ... I wonder if I can upload it somewhere public...

afiune commented 8 years ago

@cwjohnston what about now? :smile:

afiune commented 8 years ago

This is the whole output of the kitchen converge:

➜  runit git:(afiune/make-it-work-in-oel) kitchen converge default-oel-66
-----> Starting Kitchen (v1.4.2)
-----> Converging <default-oel-66>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Librarian-Chef 0.0.4...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
-----> Installing Chef Omnibus (install only if missing)
       Downloading https://www.chef.io/chef/install.sh to file /tmp/install.sh
       Trying wget...
       Download complete.
       Downloading Chef  for el...
       downloading https://www.chef.io/chef/metadata?v=&prerelease=false&nightlies=false&p=el&pv=6&m=x86_64
         to file /tmp/install.sh.2356/metadata.txt
       trying wget...
       url  https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chef-12.5.1-1.el6.x86_64.rpm
       md5  ef7dab3bc7a3b9aca6899de6892497d3
       sha256   76dda2a604738ba8f7790261180d75fc1949a441a4bd791cb9a0857b6e11c72d
       downloaded metadata file looks valid...
       downloading https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chef-12.5.1-1.el6.x86_64.rpm
         to file /tmp/install.sh.2356/chef-12.5.1-1.el6.x86_64.rpm
       trying wget...
       trying curl...
       Comparing checksum with sha256sum...

       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

       You are installing an omnibus package without a version pin.  If you are installing
       on production servers via an automated process this is DANGEROUS and you will
       be upgraded without warning on new releases, even to new major releases.
       Letting the version float is only appropriate in desktop, test, development or
       CI/CD environments.

       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

       Installing Chef
       installing with rpm...
       warning: /tmp/install.sh.2356/chef-12.5.1-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
       Preparing...                ########################################### [100%]
          1:chef                   ########################################### [100%]
       Thank you for installing Chef!
       Transferring files to <default-oel-66>
       Starting Chef Client, version 12.5.1
       Creating a new client identity for default-oel-66 using the validator key.
       resolving cookbooks for run list: ["runit_test"]
       Synchronizing Cookbooks:
         - runit_test (1.0.1)
         - runit (1.7.5)
         - runit_other_test (1.0.0)
         - packagecloud (0.1.1)
       Compiling Cookbooks...
       Converging 5 resources
       Recipe: runit::default
         * service[runit] action nothing (skipped due to action :nothing)
         * execute[start-runsvdir] action nothing (skipped due to action :nothing)
         * execute[runit-hup-init] action nothing (skipped due to action :nothing)

        (up to date)
           * log[pygpgme_warning] action write (skipped due to not_if)
        (skipped due to not_if)

             - update content in file /etc/pki/rpm-gpg/RPM-GPG-KEY-packagecloud_io from none to e42d7e
             --- /etc/pki/rpm-gpg/RPM-GPG-KEY-packagecloud_io   2015-11-30 23:16:35.867654776 +0100
             +++ /tmp/chef-rest20151130-2464-1kic9qp    2015-11-30 23:16:35.863652698 +0100
             @@ -1 +1,65 @@
             +-----BEGIN PGP PUBLIC KEY BLOCK-----
             +Version: GnuPG v1.4.11 (GNU/Linux)
             +
             +mQINBFLUbogBEADceEoxBDoE6QM5xV/13qiELbFIkQgy/eEi3UesXmJblFdU7wcD
             +LOW3NuOIx/dgbZljeMEerj6N1cR7r7X5sVoFVEZiK4RLkC3Cpdns0d90ud2f3VyK
             +K7PXRBstdLm3JlW9OWZoe4VSADSMGWm1mIhT601qLKKAuWJoBIhnKY/RhA/RBXt7
             +z22g4ta9bT67PlliTo1a8y6DhUA7gd+5TsVHaxDRrzc3mKObdyS5LOT/gf8Ti2tY
             +BY5MBbQ8NUGExls4dXKlieePhKutFbde7sq3n5sdp1Ndoran1u0LsWnaSDx11R3x
             +iYfXJ6xGukAc6pYlUD1yYjU4oRGhD2fPyuewqhHNUVwqupTBQtEGULrtdwK04kgI
             +H93ssGRsLqUKe88uZeeBczVuupv8ZLd1YcQ29AfJHe6nsevsgjF+eajYlzsvC8BN
             +q3nOvvedcuI6BW4WWFjraH06GNTyMAZi0HibTg65guZXpLcpPW9hTzXMoUrZz8Mv
             +J9yUBcFPKuFOLDpRP6uaIbxJsYqiituoltl0vgS/vJcpIVVRwSaqPHa6S63dmKm2
             +6gq18v4l05mVcInPn+ciHtcSlZgQkCsRTSvfUrK+7nzyWtNQMGKstAZ7AHCoA8Pb
             +c3i7wyOtnTgfPFHVpHg3JHsPXKk9/71YogtoNFoETMFeKL1K+O+GMQddYQARAQAB
             +tDdwYWNrYWdlY2xvdWQgb3BzIChwcm9kdWN0aW9uIGtleSkgPG9wc0BwYWNrYWdl
             +Y2xvdWQuaW8+iQI+BBMBAgAoBQJS1G6IAhsvBQkJZgGABgsJCAcDAgYVCAIJCgsE
             +FgIDAQIeAQIXgAAKCRDC5zQk1ZCXq13KD/wNzAi6rEzRyx6NH61Hc19s2QAgcU1p
             +1mX1Tw0fU7CThx1nr8JrG63465c9dzUpVzNTYvMsUSBJwbb1phahCMNGbJpZRQ5b
             +vW/i3azmk/EHKL7wgMV8wu1atu6crrxGoDEfWUa4aIwbxZGkoxDZKZeKaLxz2ZCh
             +uKzjvkGUk4PUoOxxPn9XeFmJQ68ys4Z0CgIGfx2i64apqfsjVEdWEEBLoxHFIPy7
             +FgFafRL0bgsquwPkb5q/dihIzJEZ2EMOGwXuUaKI/UAhgRIUGizuW7ECEjX4FG92
             +8RsizHBjYL5Gl7DMt1KcPFe/YU/AdWEirs9pLQUr9eyGZN7HYJ03Aiy8R5aMBoeY
             +sfxjifkbWCpbN+SEATaB8YY6Zy2LK/5TiUYNUYb/VHP//ZEv0+uPgkoro6gWVkvG
             +DdXqH2d9svwfrQKfGSEQYXlLytZKvQSDLAqclSANs/y5HDjUxgtWKdsL3xNPCmff
             +jpyiqS4pvoTiUwS4FwBsIR2sBDToIEHDvTNk1imeSmxCUgDxFzWkmB70FBmwz7zs
             +9FzuoegrAxXonVit0+f3CxquN7tS0mHaWrZfhHxEIt65edkIz1wETOch3LIg6RaF
             +wsXgrZCNTB/zjKGAFEzxOSBkjhyJCY2g74QNObKgTSeGNFqG0ZBHe2/JQ33UxrDt
             +peKvCYTbjuWlyrkCDQRS1G6IARAArtNBXq+CNU9DR2YCi759fLR9F62Ec/QLWY3c
             +/D26OqjTgjxAzGKbu1aLzphP8tq1GDCbWQ2BMMZI+L0Ed502u6kC0fzvbppRRXrV
             +axBrwxY9XhnzvkXXzwNwnBalkrJ5Yk0lN8ocwCuUJohms7V14nEDyHgAB8yqCEWz
             +Qm/SIZw35N/insTXshcdiUGeyufo85SFhCUqZ1x1TkSC/FyDG+BCwArfj8Qwdab3
             +UlUEkF6czTjwWIO+5vYuR8bsCGYKCSrGRh5nxw0tuGXWXWFlBMSZP6mFcCDRQDGc
             +KOuGTjiWzLJcgsEcBoIX4WpHJYgl6ovex7HkfQsWPYL5V1FIHMlw34ALx4aQDH0d
             +PJpC+FxynrfTfsIzPnmm2huXPGGYul/TmOp00CsJEcKOjqcrYOgraYkCGVXbd4ri
             +6Pf7wJNiJ8V1iKTzQIrNpqGDk306Fww1VsYBLOnrSxNPYOOu1s8c8c9N5qbEbOCt
             +QdFf5pfuqsr5nJ0G4mhjQ/eLtDA4E7GPrdtUoceOkYKcQFt/yqnL1Sj9Ojeht3EN
             +PyVSgE8NiWxNIEM0YxPyJEPQawejT66JUnTjzLfGaDUxHfseRcyMMTbTrZ0fLJSR
             +aIH1AubPxhiYy+IcWOVMyLiUwjBBpKMStej2XILEpIJXP6Pn96KjMcB1grd0J2vM
             +w2Kg3E8AEQEAAYkERAQYAQIADwUCUtRuiAIbLgUJCWYBgAIpCRDC5zQk1ZCXq8Fd
             +IAQZAQIABgUCUtRuiAAKCRA3u+4/etlbPwI5D/4idr7VHQpou6c/YLnK1lmz3hEi
             +kdxUxjC4ymOyeODsGRlaxXfjvjOCdocMzuCY3C+ZfNFKOTtVY4fV5Pd82MuY1H8l
             +nuzqLxT6UwpIwo+yEv6xSK0mqm2FhT0JSQ7E7MnoHqsU0aikHegyEucGIFzew6BJ
             +UD2xBu/qmVP/YEPUzhW4g8uD+oRMxdAHXqvtThvFySY/rakLQRMRVwYdTFHrvu3z
             +HP+6hpZt25llJb3DiO+dTsv+ptLmlUr5JXLSSw2DfLxQa0kD5PGWpFPVJcxraS2p
             +NDK9KTi2nr1ZqDxeKjDBT6zZOs9+4JQ9fepn1S26AmHWHhyzvpjKxVm4sOilKysi
             +84CYluNrlEnidNf9wQa3NlLmtvxXQfm1py5tlwL5rE+ek1fwleaKXRcNNmm+T+vD
             +dIw+JcHy8a53nK1JEfBqEuY6IqEPKDke0wDIsDLSwI1OgtQoe7Cm1PBujfJu4rYQ
             +E+wwgWILTAgIy8WZXAloTcwVMtgfSsgHia++LqKfLDZ3JuwpaUAHAtguPy0QddvF
             +I4R7eFDVwHT0sS3AsG0HAOCY/1FRe8cAw/+9Vp0oDtOvBWAXycnCbdQeHvwh2+Uj
             +2u2f7K3CDMoevcBl4L5fkFkYTkmixCDy5nst1VM5nINueUIkUAJJbOGpd6yFdif7
             +mQR0JWcPLudb+fwusJ4UEACYWhPa8Gxa7eYopRsydlcdEzwpmo6E+V8GIdLFRFFp
             +KHQEzbSW5coxzU6oOiPbTurCZorIMHTA9cpAZoMUGKaSt19UKIMvSqtcDayhgf4c
             +Z2ay1z0fdJ2PuLeNnWeiGyfq78q6wqSaJq/h6JdAiwXplFd3gqJZTrFZz7A6Q6Pd
       wHUv7Fg357kRSdzKv9D
             +bgmhqRHlgVeKn9pwN4cpVBN+idzwPefQksSKH4lBDvVr/9j+V9mmrOx7QmQ5LCc/
             +1on+L0dqo6suoajADhKy+lDQbzs2mVb4CLpPKncDup/9iJbjiR17DDFMwgyCoy5O
             +HJICQ5lckNNgkHTS6Xiogkt28YfK4P3S0GaZgIrhKQ7AmO3O+hB12Zr+olpeyhGB
             +OpBD80URntdEcenvfnXBY/BsuAVbTGXiBzrlBEyQxg656jUeqAdXg+nzCvP0yJlB
             +UOjEcwyhK/U2nw9nGyaR3u0a9r24LgijGpdGabIeJm6O9vuuqFHHGI72pWUEs355
             +lt8q1pAoJUv8NehQmlaR0h5wcwhEtwM6fiSIUTnuJnyHT053GjsUD7ef5fY1KEFm
             +aZeW04kRtFDOPinz0faE8hvsxzsVgkKye1c2vkXKdOXvA3x+pZzlTHtcgMOhjKQA
             +sA==
             +=H60S
             +-----END PGP PUBLIC KEY BLOCK-----

           * template[/etc/yum.repos.d/imeyer_runit.repo] action create

             - update content in file /etc/yum.repos.d/imeyer_runit.repo from none to 437004
             --- /etc/yum.repos.d/imeyer_runit.repo 2015-11-30 23:16:36.055749040 +0100
             +++ /etc/yum.repos.d/.imeyer_runit.repo20151130-2464-e9nh3m    2015-11-30 23:16:36.055749040 +0100
             @@ -1 +1,10 @@
             +[imeyer_runit]
             +name=imeyer_runit
             +baseurl=https://packagecloud.io/imeyer/runit/el/6/$basearch
             +repo_gpgcheck=1
             +gpgcheck=0
             +enabled=1
             +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-packagecloud_io
             +sslverify=1

             - execute the ruby block yum-cache-reload-imeyer_runit
           * execute[yum-makecache-imeyer_runit] action nothing (skipped due to action :nothing)
           * ruby_block[yum-cache-reload-imeyer_runit] action nothing (skipped due to action :nothing)

           - install version 2.1.2-1.el6 of package runit

       Running handlers:
       Running handlers complete
       Chef Client finished, 6/14 resources updated in 02 minutes 43 seconds
       Finished converging <default-oel-66> (6m5.95s).
-----> Kitchen is finished. (6m8.37s)
zlib(finalizer): the stream was freed prematurely.
➜  runit git:(afiune/make-it-work-in-oel)
afiune commented 8 years ago

And finally here the output of the kitchen verify:

➜  runit git:(afiune/make-it-work-in-oel) kitchen verify default-oel-66
-----> Starting Kitchen (v1.4.2)
-----> Setting up <default-oel-66>...
       Finished setting up <default-oel-66> (0m0.00s).
-----> Verifying <default-oel-66>...
       Preparing files for transfer
-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
       Successfully installed thor-0.19.0
Fetching: busser-0.7.1.gem (100%)
       Successfully installed busser-0.7.1
       2 gems installed
-----> Setting up Busser
       Creating BUSSER_ROOT in /tmp/verifier
       Creating busser binstub
       Installing Busser plugins: busser-serverspec
       Plugin serverspec installed (version 0.5.7)
-----> Running postinstall for serverspec plugin
       Suite path directory /tmp/verifier/suites does not exist, skipping.
       Transferring files to <default-oel-66>
-----> Running serverspec test suite
-----> Installing Serverspec..
Fetching: sfl-2.2.gem (100%)
Fetching: net-telnet-0.1.1.gem (100%)
Fetching: net-ssh-2.9.2.gem (100%)
Fetching: net-scp-1.2.1.gem (100%)
Fetching: specinfra-2.44.3.gem (100%)
Fetching: multi_json-1.11.2.gem (100%)
Fetching: diff-lcs-1.2.5.gem (100%)
Fetching: rspec-support-3.4.1.gem (100%)
Fetching: rspec-expectations-3.4.0.gem (100%)
Fetching: rspec-core-3.4.1.gem (100%)
Fetching: rspec-its-1.2.0.gem (100%)
Fetching: rspec-mocks-3.4.0.gem (100%)
Fetching: rspec-3.4.0.gem (100%)
Fetching: serverspec-2.24.3.gem (100%)
-----> serverspec installed (version 2.24.3)
       /opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec -I/tmp/verifier/gems/gems/rspec-support-3.4.1/lib:/tmp/verifier/gems/gems/rspec-core-3.4.1/lib /opt/chef/embedded/bin/rspec --pattern /tmp/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/verifier/suites/serverspec
       os: {:family=>"redhat", :release=>"6.6", :arch=>"x86_64"}
       os: {:family=>"redhat", :release=>"6.6", :arch=>"x86_64"}

       Package "runit"
         should be installed

       Command "ps -ef | grep -v grep | grep "runsvdir""
         exit_status
           should eq 0
         stdout
           should match /runsvdir/

       File "/etc/service"
         should be directory
         should be mode 755
         should be owned by "root"
         should be grouped into "root"

       Finished in 0.22637 seconds (files took 0.37914 seconds to load)
       7 examples, 0 failures

       Finished verifying <default-oel-66> (0m28.95s).
-----> Kitchen is finished. (0m31.23s)
zlib(finalizer): the stream was freed prematurely.
➜  runit git:(afiune/make-it-work-in-oel)
afiune commented 8 years ago

@cwjohnston ping :smile:

afiune commented 8 years ago
while true do
  system 'ping  @cwjohnston @chrisroberts'
  sleep 86400
end

cc/ @cwjohnston @chrisroberts :smiling_imp:

luckymike commented 8 years ago

@afiune Thanks for the updates. I'm running all the rhel tests now to confirm there's no regression. If all looks good, this should be green lit for the next release.

luckymike commented 8 years ago

@afiune I ran the default suite successfully, but encountered a pretty solid failure with the service suite. Can you confirm that you are able to run that test?

Here's the output (sparing you a few thousand lines of kernel info that it spat out):

       STDERR: 
       ---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/provider/package/yum-dump.py --options --all-provides --yum-lock-timeout 30 ----
       Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/provider/package/yum-dump.py --options --all-provides --yum-lock-timeout 30 returned 
       [2015-12-02T18:21:03+01:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <service-oel-66>.
>>>>>> Please see .kitchen/logs/service-oel-66.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sh -c '

sudo -E /opt/chef/bin/chef-client --local-mode --config /tmp/kitchen/client.rb --log_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json --chef-zero-port 8889
']
>>>>>> ----------------------
afiune commented 8 years ago

@luckymike interesting. Let me look at that one.. :smile:

tas50 commented 8 years ago

@afiune If you can rebase this I'll get it merged in and released

afiune commented 8 years ago

@tas50

Done

tas50 commented 8 years ago

thanks and I enjoyed the gif