Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Nikola Velkovski
    @parabolic
    but for now for coming from puppet
    this is perfect
    I don't need server agent
    just a CI
    and knife solo :)
    and use the same abstractions as in puppet
    with this setup I was able to build a lot of stuff on amazon
    Mat Schaffer
    @matschaffer
    Nice! Love hearing when people are getting good use out of it
    TylorF
    @TylorF
    Hey there. I'm writing a management utility for our chef deploy process and am attempting to run knife ec2 commands (with knife solo installed an configured) inside of a PTY, but when the actual chef run ends (in error or success) it doesn't seem to close the ssh connection it opened to do the bootstrapping. Is this intended behaviour and is there a way to override it? Or should I be looking somewhere other than knife-solo to fix this?
    Mat Schaffer
    @matschaffer
    @TylorF is the run not exiting or are you taking about the master socket still running?
    TylorF
    @TylorF
    @matschaffer user 26304 0.2 0.0 73364 1552 ? Ss 23:18 0:00 ssh: /home/user/.chef/knife-solo-sockets/<ipaddress>.amazonaws.com [mux] is what's in ps
    when I run chef exec knife ec2 etc in PTY, it waits for the PID to exit and that socket stays open
    I'm not sure if that's the intended operation in chef or not
    TylorF
    @TylorF
    I'm a little new to chef, but I've got all my stuff working if I run it by hand, and it runs within my PTY script, but the PTY just never ends
    Mat Schaffer
    @matschaffer
    @TylorF yeah that's the shared socket. Interesting that the PTY waits for it. I'm not really familiar with PTY scripts.
    You can add --ssh-control-master=no to turn that off
    It'll run a little more slowly since each rsync will reconnect to ssh
    TylorF
    @TylorF
    @matschaffer Is there a way to pass this with knife ec2? If I understand correctly knife ec2 is called first and then bootstraps with knife solo. Is it possible to set this in knife.rb? When passing it to knife ec2 it complains about there not being a parameter called '--ssh-control-master'
    TylorF
    @TylorF
    Hmm, I've chosen another path and instead am trying to use the knife ec2 gem within my ruby code, but now I think it's not running in solo mode. I think this path is better once I get it working, so don't worry about my previous question :)
    Mat Schaffer
    @matschaffer
    @TylorF no worries. I think you might be able to put knife[:ssh_control_master] = 'no' in your knife.rb if you decide to try it again
    Or switch to a knife-solo 0.4 release
    Mat Schaffer
    @matschaffer
    I don't believe regular bootstrap (without knife-solo) has any built in way to transfer cookbooks but if they're available elsewhere you can probably load them via a custom boostrapper
    Nikola Velkovski
    @parabolic
    Hi Guys
    I am facing an issue with the latest version of knife-solo
    Mat Schaffer
    @matschaffer
    Send over the error, I may be able to help you sort it out
    Nikola Velkovski
    @parabolic
    thanks
    so
    it;'s pretty straight forward
    I cannot edit or read encrypted databags but I can add them
    and deploying works fine
    knife solo data bag show cms
    WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/client.pem>
    ERROR: Your private key could not be loaded from /etc/chef/client.pem
    Check your configuration file and ensure that your private key is readable
    cat .chef/knife.rb 
    cookbook_path             ["cookbooks", "site-cookbooks"]
    node_path                 "nodes"
    role_path                 "roles"
    environment_path          "environments"
    data_bag_path             "data_bags"
    encrypted_data_bag_secret "data_bags_encryption_key"
    
    knife[:berkshelf_path] = "cookbooks"
    Chef::Config[:ssl_verify_mode] = :verify_peer if defined? ::Chef
    ls -la data_bags_encryption_key 
    -rw-r--r-- 1 kikola  684r  2  2016 data_bags_encryption_key
    Using chef 12.17.44
    Using knife-solo 0.6.0
    Nikola Velkovski
    @parabolic
    e.g.
    knife solo data bag create passwords something
    Created data_bag_item[something]
    Mat Schaffer
    @matschaffer
    I can give it a try later. Odd that only show would have a problem
    Nikola Velkovski
    @parabolic
    hmm
    I didn't realize it's not your gem sorry about that.
    it's only show and edit
    create and list work
    Mat Schaffer
    @matschaffer
    No worries, easy to confuse :)
    Nikola Velkovski
    @parabolic
    @matschaffer I solved it!
    thanks to you again
    :)
    thbishop/knife-solo_data_bag#35
    Hello @emados, if you put the following in .chef/knife.rb it should fix the issue:
    
    local_mode       true
    Mat Schaffer
    @matschaffer
    Yay! Good find
    Nikola Velkovski
    @parabolic
    Thanks a lot :)
    Mat Schaffer
    @matschaffer
    Any time :smile: