Coder Social home page Coder Social logo

chef-utils's Introduction

Facebook Chef Utilities

Continuous Integration

Description

This is repository holds various Chef utilities and documents written and maintained by Facebook.

License

These files are available under the Apache license unless otherwise specified.

chef-utils's People

Contributors

andy-dufour avatar babar avatar bwann avatar cburroughs avatar chantra avatar dafyddcrosby avatar davide125 avatar epilatow avatar erlogan avatar facebook-github-bot avatar fejese avatar gcweir avatar gogsbread avatar heyitsgilbert avatar ifel avatar jaymzh avatar kcbraunschweig avatar logikal avatar naomireeves avatar odcinek avatar oko avatar patcox avatar pmenglund avatar yottatsa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef-utils's Issues

postgres "chef" user does not exist in defualt open source chef

With open source chef 11.4.0 there is no "chef" user. Using opscode_chef_ro appears to work. I'm not sure if this is a private vs open source difference, or just something that changed along the way

$  sudo su opscode-pgsql -c "cd; /opt/chef-server/embedded/bin/psql -d opscode_chef"psql (9.2.4)
Type "help" for help.

opscode_chef=# SELECT * FROM "pg_user";
     usename     | usesysid | usecreatedb | usesuper | usecatupd | userepl |  passwd  | valuntil | useconfig 
-----------------+----------+-------------+----------+-----------+---------+----------+----------+-----------
 opscode-pgsql   |       10 | t           | t        | t         | t       | ******** |          | 
 opscode_chef    |    16549 | f           | t        | t         | f       | ******** |          | 
 opscode_chef_ro |    16550 | f           | t        | t         | f       | ******** |          | 
(3 rows)

Grocery-delivery - Missing methods?

I am not a ruby dev by any means.

Working on setting up grocery-delivery via ruby version to work with our git repo, it seems to be missing a few methods.

$ ./grocery-delivery.rb 
Attempting to acquire lock
Lock acquired
Updating repo
./grocery-delivery.rb:199:in `<main>': undefined method `update' for #<BetweenMeals::Repo::Git:0x000000014794a0> (NoMethodError)

So I went in an added an update method

index 9ccf4d8..76d586a 100755
--- a/between-meals/repo/git.rb
+++ b/between-meals/repo/git.rb
@@ -46,6 +46,11 @@ module BetweenMeals
         s = Mixlib::ShellOut.new("#{@bin} clone #{url} #{@repo}").run_command
         s.error!
       end
+ 
+      def update
+        s = Mixlib::ShellOut.new("#{@bin} pull").run_command
+        s.error!
+      end

       # libgit turns out to be *very* slow at this. Using /usr/bin/git
       # for now, we'll circle back to this.

And then ran into this error.

$ ./grocery-delivery.rb 
Attempting to acquire lock
Lock acquired
Updating repo
DEBUG: Reading 
/grocery-delivery/gd_revision
./grocery-delivery.rb:223:in `<main>': undefined method `head' for #<BetweenMeals::Repo::Git:0x0000000219a440> (NoMethodError)

Are these methods really missing? Or am I just missing something obvious?

Doesn't seem to detect changes/additions to cookbooks via git.

I have got it all installed and have now gotten to the point where I believe I found a big. Again, as posted in my first bug, I am not a ruby guy...

I can upload new roles, delete roles, and even delete cookbooks. But for some reason when I either update or add a new cookbook, the Grocery-Delivery doesn't seem to see it and does not upload anything.

./grocery-delivery.rb 
WARN: Attempting to acquire lock
WARN: Lock acquired
WARN: Updating repo
WARN: Determing changes... from  to 7ecf0f85a9afe23e40c8d97213d554ec824dd876
WARN: Added cookbooks: []
WARN: Deleted cookbooks: []
WARN: Added roles: []
WARN: Deleted roles: []
WARN: Added databags: []
WARN: Deleted databags: []
WARN: Success at 7ecf0f85a9afe23e40c8d97213d554ec824dd876

Thoughts? Ideas? Since I can delete a cookbook, I feel my config should be correct.

chefctl on windows: retry lock on permission denied

On windows, via remote ssh, the workflow is a bit different.

If a timer is running chef, it's likely as SYSTEM. If you login as admin1 and run chefctl, it crashes with:

C:/chef/bin/chefctl.rb:787:in `read': Permission denied @ io_fread - C:\\Windows\\Temp\\chefctl.lock (Errno::EACCES)

instead of realizing a run is in progress and doing it's usual wait routine. But it should catch this and do it's usual wait routine.

chefctl-config.rb or chefctl_config.rb?

I'm confused, the chefctl code says
"DEFAULT_CONFIG = '/etc/chefctl-config.rb'.freeze" but the README and sample config have "chefctl_config.rb". This looks like a bug, should be an underscore in chefctl?

chefctl on Chef 16 on macos does not result in colored output

I'm at a loss on this one, but I've noticed that chefctl does not result in colored output when using Chef 16 (Chef Infra Client: 16.1.16)

After attaching some debugging I've confirmed that sudo chefctl -icH is equivalent to sudo /opt/chef/bin/chef-client -l fatal -F doc --no-fork.

The only thing I can come up with is the ruby /opt/chef/embedded/bin/ruby has updated some gems that are prohibiting this behavior or have simply changed.

chefctl on windows doesn't produce logs in /var/chef/outputs

When using chefctl on windows, I cannot get it to write out the log to C:\chef\outputs like it does on Linux/macOS.

This occurs on chef-client 14.10.9.
Here is the config:

lock_file 'C:/chef/chefctl.lock'
plugin_path 'C:/chef/chefctl_hooks.rb'
log_dir 'C:/chef/outputs'
default_chef_options ["--fatal-windows-admin-check"]
chef_options ["-c C:/chef/solo/solo.rb"]
chef_client 'C:/opscode/chef/bin/chef-client.bat'
lock_time 1800
max_retries 1
windows_subshell true

Here is the command:

C:\opscode\chef\embedded\bin\ruby.exe c:\chef\chefctl.rb -C C:\chef\chefctl-config.rb

And here is what ends up in C:\chef\outputs:

PS C:\chef\outputs> Get-Content chef.20190207.1115.1549556120.out
[2019-02-07 11:15:21 -0500] WARN chefctl: Deprecated: windows_subshell shouldn't be used

I get stdout when running this and can see the changes, but it doesn't land in the outputs for some reason.

folsom-stats doesn't work with Chef Server Core 12

@oferrigni - you have any input on this?

We get this error with the latest CS12

escript: exception error: {function_clause,
                     [{local,fetch_metric,
                          [{<<"pooler.oc_chef_authz_http.free_count">>,
                            [{type,histogram},
                             {tags,
                                 {set,0,16,16,8,80,48,
                                     {[],[],[],[],[],[],[],[],[],[],[],[],[],
                                      [],[],[]},
                                     {{[],[],[],[],[],[],[],[],[],[],[],[],[],
                                       [],[],[]}}}}]}]}]}

We disable v6 SLAAC in fb_sysctl

note to self: we set 'net.ipv6.conf.eth0.autoconf' => 0, in fb_sysctl. While I agree internet servers should have static addresses, this is a change to a default that may be surprising to people who blindly trust our cookbooks (it got me and took quite a while to figure out what happened) and there's nothing calling it out.

Swap-out "blacklist" verbiage in `chefctl`

Given all that is going on in the world, I think it would be a good time to reconsider the use of "blacklist" in chefctl and perhaps swap it out for "denylist" (or some equivalent noun/verb).

See:

# `blacklist` should be an Array of Regexp.
# If blacklist is provided, commands that match any of the entries are
# not included in the output.
# Returns an Array of Hashes with keys: `:pid`, `:command`, `:nsid`
def list_processes(command, blacklist = nil, parents = false,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.