chef

Chef: private supermarket cookbook directly on server

十年热恋 提交于 2019-12-25 01:43:34
问题 I have a cookbook which is available on a private chef supermarket and I have 4 chef servers which need this cookbook to be available so that corresponding nodes can consume it. We can use berks install and berks upload multiple times to achieve this. Is there a simpler way to do this? If it is not possible, why does chef not allow this? 回答1: if you have 4 different chef servers, then i assume that you are using 4 different keys for authentication when you interact with the chef server. this

Adding a sudoers file in chef fails at verification

自闭症网瘾萝莉.ら 提交于 2019-12-24 18:58:11
问题 goal I'm trying to add/edit a sudoers file in Chef. After a lot of serach (and broken sudoers) I found this question and the answer seemed to be exactly what I am after. My cookbook So in my chef I added the following visudo cookbook: The recipe: ~/chef-repo/cookbook/visudo/recipes/allowUpgrade.rb template '/etc/sudoers.d/allowUpgrade' do cookbook 'visudo' source 'allowUpgrade.erb' owner'root' group 'root' mode '0440' verify "visudo -c -f %{path}" end My template: ~/chef-repo/cookbooks/visudo

Use Berkshelf with custom CA certificate

喜你入骨 提交于 2019-12-24 15:42:30
问题 I have a custom Chef server on premises with a TLS certificate that is signed by our own CA server. I added the CA certificate to .chef/trusted_certs and now knife ssl verify works fine. But when I try to upload cookbooks using Berksfile I run into the following error: $ berks upload E, [2016-03-26T15:02:18.290419 #8629] ERROR -- : Ridley::Errors::ClientError: SSL_connect returned=1 errno=0 state=error: certificate verify failed E, [2016-03-26T15:02:18.291025 #8629] ERROR -- : /Users/chbr/

JSON must be no more than 1000000 bytes

陌路散爱 提交于 2019-12-24 14:53:14
问题 We have a Jenkins-Chef setup with a QA build project to a website for a client. The build gets the code from Bitbucket, and a script uploads the cookbooks from the Chef Client to the Chef Server. These builds ran fine for a long time. Two days ago the automated and manual builds started failing with the following error (taken from the Jenkins console output): Updated Environment qa Uploading example-deployment [0.1.314] ERROR: Request Entity Too Large Response: JSON must be no more than

Where to Store Local Software Packages for Chef Recipe

爱⌒轻易说出口 提交于 2019-12-24 14:16:11
问题 I have a Ruby .deb package that I built from source using checkinstall. I'm using it with a Chef recipe to install Ruby on one of my nodes. Right now I'm storing it under files/default in my recipe, where one would normally store config files or templates to upload to the server. This works well enough but I wonder what the "right" way to solve this problem would be. Where do people store local binaries or packages when they want to install them with Chef this way? Should I create a server to

Configure providers from variables, in a generic way

…衆ロ難τιáo~ 提交于 2019-12-24 13:16:50
问题 How can I create a recipe that will populate its attributes using the fiels from an instance of an object in a generic way? As an example, consider the following recipe: component = $auth_docker docker_image component.name do registry component.registry tag component.tag action :pull end When you have 50s of recipes that look like this, maintaining them really gets overwhelming. In Python, i would probably implement a solution that would look a bit like this: docker_image = DockerImage(**

JClouds-Chef: IllegalAccessError on TokenType2?

守給你的承諾、 提交于 2019-12-24 12:25:06
问题 I am using the JClouds-Chef API to bootstrap a Linux VM ( myapp01.me.example.com ) with Chef Client, and to then run the client and configure the VM with its app stack via a typicalapp role: package com.me.myorg.chef; import org.jclouds.Constants import org.jclouds.ContextBuilder import org.jclouds.chef.ChefContext import org.jclouds.chef.ChefService import org.jclouds.chef.config.ChefProperties import org.jclouds.chef.domain.BootstrapConfig import org.jclouds.chef.util.RunListBuilder import

In chef server, how to determine when a node is fully bootstrapped

这一生的挚爱 提交于 2019-12-24 10:50:04
问题 From python, I am using knife to launch a server. e.g. knife ec2 server create -r "role[nginx_server]" --region ap-southeast-1 -Z ap-southeast-1a -I ami-ae1a5dfc --flavor t1.micro -G nginx -x ubuntu -S sg_development -i /home/ubuntu/.ec2/sg_development.pem -N webserver1 I will then use the chef-server api to check for when the bootstrap is complete so I can then use boto and other tools to configure the newly created server. Pseudo code will look like this: cmd = """knife ec2 server create -r

gitlab-ctl reconfigure: Unable to determine node name

邮差的信 提交于 2019-12-24 10:45:23
问题 I did setup a new GitLab instance on Ubuntu 16.04.4 LTS. Installing the package went fine and GitLab seems to be up and running. I then started to configure the instance and setup SMTP in /etc/gitlab/gitlab.rb . Afterwards I ran sudo gitlab-ctl reconfigure . It failed with the following error message: Starting Chef Client, version 13.6.4 Running handlers: There was an error running gitlab-ctl reconfigure: Unable to determine node name: configure node_name or configure the system's hostname

How to provide a condition within Chef recipe to see if it running under test kitchen?

北城以北 提交于 2019-12-24 09:49:28
问题 I am using encrypted data bags within Chef and I want to add a condition within my Chef recipe as follows: If (test kitchen) then encryptkey = data_bag_item("tokens", "encryptkey") If ( not test kitchen ) then secret = Chef::EncryptedDataBagItem.load_secret("/etc/chef/encrypted_data_bag_secret") encryptkey = Chef::EncryptedDataBagItem.load("tokens", "encryptkey", secret) I have added data_bags_path and encrypted_data_bag_secret_key_path within kitchen.yml as follows: provisioner: name: chef