chef-boneyard / locale

Chef cookbook to configure the system locale on Linux systems
https://supermarket.chef.io/cookbooks/locale
Apache License 2.0
27 stars 54 forks source link

Added support for Fedora #7

Closed crawley closed 10 years ago

crawley commented 10 years ago

This pull request adds support for Fedora and for some other RHEL-based platforms. I've also updated the documentation.

Note that Fedora does not allow LC_ALL to be set in the system default locale settings. It is a documented restriction.

luckymike commented 10 years ago

Hi @crawley,

Would it be possible to include test coverage in this PR?

Thanks!

crawley commented 10 years ago

Good point. I'll get onto it.

crawley commented 10 years ago

The existing test suite has been extended to cover Fedora

luckymike commented 10 years ago

@crawley, I ran the tests, and unfortunately the fedora converge failed: https://gist.github.com/luckymike/1e61c29738dd4dccd5e8

crawley commented 10 years ago

That's interesting. When I run the test on my home machine, it works:

[steve@newbox locale]$ kitchen test default-fedora-20
-----> Starting Kitchen (v1.2.1)
-----> Cleaning up any prior instances of <default-fedora-20>
-----> Destroying <default-fedora-20>...
       Finished destroying <default-fedora-20> (0m0.00s).
-----> Testing <default-fedora-20>
-----> Creating <default-fedora-20>...
       Bringing machine 'default' up with 'virtualbox' provider...
       [default] VirtualBox VM is already running.
       Vagrant instance <default-fedora-20> created.
       Finished creating <default-fedora-20> (0m1.26s).
-----> Converging <default-fedora-20>...
       Preparing files for transfer
       Resolving cookbook dependencies with Librarian-Chef 0.0.4...
       Removing non-cookbook files before transfer
-----> Installing Chef Omnibus (true)       
downloading https://www.getchef.com/chef/install.sh       
  to file /tmp/install.sh       
trying wget...       
Downloading Chef  for el...       
downloading https://www.getchef.com/chef/metadata?v=&prerelease=false&nightlies=false&p=el&pv=6&m=x86_64       
  to file /tmp/install.sh.12216/metadata.txt       
trying wget...       
url https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chef-11.12.8-2.el6.x86_64.rpm       
md5 3dfacef6e6640adefc12bf6956a3a4e2       
sha256  ee45e0f226ffd503a949c1b10944064a4655d0255e03a16b073bed85eac83e95       
downloaded metadata file looks valid...       
downloading https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chef-11.12.8-2.el6.x86_64.rpm       
  to file /tmp/install.sh.12216/chef-11.12.8-2.el6.x86_64.rpm       
trying wget...       
Comparing checksum with sha256sum...       
Installing Chef        
installing with rpm...       
warning: /tmp/install.sh.12216/chef-11.12.8-2.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY       
Preparing...                          ################################# [100%]       
Updating / installing...       
   1:chef-11.12.8-2.el6               ################################# [100%]       
Thank you for installing Chef!       
       Transfering files to <default-fedora-20>
[2014-07-27T11:39:56+00:00] INFO: Forking chef instance to converge...       
[2014-07-27T11:39:56+00:00] WARN: 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *        
SSL validation of HTTPS requests is disabled. HTTPS connections are still       
encrypted, but chef is not able to detect forged replies or man in the middle       
attacks.       

To fix this issue add an entry like this to your configuration file:       

  # Verify all HTTPS connections (recommended)       
  ssl_verify_mode :verify_peer       

  # OR, Verify only connections to chef-server       
  verify_api_cert true     

To check your SSL configuration, or troubleshoot errors, you can use the       
`knife ssl check` command like so:       
  knife ssl check -c /tmp/kitchen/solo.rb       

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *        

Starting Chef Client, version 11.12.8       
[2014-07-27T11:39:56+00:00] INFO: *** Chef 11.12.8 ***       
[2014-07-27T11:39:56+00:00] INFO: Chef-client pid: 12310       
       [2014-07-27T11:40:23+00:00] INFO: Setting the run_list to ["recipe[locale]"] from CLI options
[2014-07-27T11:40:23+00:00] INFO: Run List is [recipe[locale]]       
[2014-07-27T11:40:23+00:00] INFO: Run List expands to [locale]       
[2014-07-27T11:40:23+00:00] INFO: Starting Chef Run for default-fedora-20       
[2014-07-27T11:40:23+00:00] INFO: Running start handlers       
[2014-07-27T11:40:23+00:00] INFO: Start handlers complete.       
Compiling Cookbooks...       
Converging 2 resources       
Recipe: locale::default       
  * package[systemd] action install[2014-07-27T11:40:23+00:00] INFO: Processing package[systemd] action install (locale::default line 50)       
 (up to date)       
  * bash[Update locale] action run[2014-07-27T11:41:37+00:00] INFO: Processing bash[Update locale] action run (locale::default line 55)       
       [2014-07-27T11:41:37+00:00] INFO: bash[Update locale] ran successfully

           - execute "bash"  "/tmp/chef-script20140727-12310-6q3jk3"

       [2014-07-27T11:41:37+00:00] INFO: Chef Run complete in 74.186128899 seconds

       Running handlers:
       [2014-07-27T11:41:37+00:00] INFO: Running report handlers
       Running handlers complete

       [2014-07-27T11:41:37+00:00] INFO: Report handlers complete
       Chef Client finished, 1/2 resources updated in 101.027174099 seconds
       Finished converging <default-fedora-20> (2m36.34s).
-----> Setting up <default-fedora-20>...
Fetching: thor-0.19.0.gem (100%)       
Fetching: busser-0.6.2.gem (100%)       
Successfully installed thor-0.19.0       
Successfully installed busser-0.6.2       
2 gems installed       
-----> Setting up Busser       
       Creating BUSSER_ROOT in /tmp/busser       
       Creating busser binstub       
       Plugin bats installed (version 0.2.0)       
-----> Running postinstall for bats plugin       
Installed Bats to /tmp/busser/vendor/bats/bin/bats       
       Finished setting up <default-fedora-20> (1m4.19s).
-----> Verifying <default-fedora-20>...
       Suite path directory /tmp/busser/suites does not exist, skipping.       
Uploading /tmp/busser/suites/bats/default.bats (mode=0664)       
-----> Running bats test suite       
 ✓ LANG should be en_US.utf8       
 - LC_ALL should be C (skipped: LC_ALL cannot be set globally on Fedora)       

2 tests, 0 failures       
       Finished verifying <default-fedora-20> (0m0.91s).
-----> Destroying <default-fedora-20>...
       [default] Forcing shutdown of VM...
       [default] Destroying VM and associated drives...
       Vagrant instance <default-fedora-20> destroyed.
       Finished destroying <default-fedora-20> (0m2.77s).
       Finished testing <default-fedora-20> (3m45.48s).
-----> Kitchen is finished. (3m45.72s)
luckymike commented 10 years ago

Well, I tried again today and it worked. Merging. Thanks!