chef

ruby unexplained syntax error ** unexpected tPOW

我怕爱的太早我们不能终老 提交于 2020-01-07 03:05:57
问题 running this : knife cookbook upload compat_resource failing due to syntax error: FATAL: /apps/chef-repo/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb:56: syntax error, unexpected tPOW, expecting ')' FATAL: new(**options) FATAL: ^ I'm suspecting that the version that's running the knife is under 2. how can I run knife with a specific ruby verion. how can I reinstall chef with ruby > 2 ? gem env RubyGems Environment: - RUBYGEMS VERSION: 1.8.23 - RUBY VERSION

How to update chef cookbooks in a developer workflow

余生长醉 提交于 2020-01-07 02:44:21
问题 I'm managing a chef server and I want to pull the latest cookbooks (if they have been changed, or new ones added). This is so that I can develop on the newest changes, and be sure I'm not working with stale data. I would assume it would be similar to git workflow where I pull the latest and merge if necessary. I know I can issue a "knife download /" but this seems costly and time-consuming, to download the entire repo each time. Oddly enough - I haven't been able to find any articles or

How to use script resource to substitute variable value [duplicate]

倾然丶 夕夏残阳落幕 提交于 2020-01-06 19:34:25
问题 This question already has an answer here : How to substitute variable value in “docker run” command (1 answer) Closed 3 years ago . I am using chef script resource and trying to assign a fingerprint value as below script 'retrieve_ucp_master_fingerprint' do interpreter "bash" code <<-EOH export FINGERPRINT=D0:19:C5:80:42:66:56:AC:6F docker run --rm -i -v /var/run/docker.sock:/var/run/docker.sock --name ucp docker/ucp join --replica --fingerprint $FINGERPRINT EOH end However, chef is not at

How to set chef attributes via Jenkins?

◇◆丶佛笑我妖孽 提交于 2020-01-06 15:59:28
问题 I want to run a set of generic cookbooks that will a user-selected version of our product in our lab, and want to use jenkins to do this. What is the best way for my Jenkins job to pass this information during the node bootstrap? Is it via the -j option, for example -j '{"load_version" : "$LOAD_VERSION"}', where $LOAD_VERSION is a parameter of the Jenins job with several choices? 回答1: Yes, -j will let you supply a JSON blob of attributes to the first chef-client run of your recipes. It's

How to set chef attributes via Jenkins?

那年仲夏 提交于 2020-01-06 15:59:06
问题 I want to run a set of generic cookbooks that will a user-selected version of our product in our lab, and want to use jenkins to do this. What is the best way for my Jenkins job to pass this information during the node bootstrap? Is it via the -j option, for example -j '{"load_version" : "$LOAD_VERSION"}', where $LOAD_VERSION is a parameter of the Jenins job with several choices? 回答1: Yes, -j will let you supply a JSON blob of attributes to the first chef-client run of your recipes. It's

how to create\edit encrypted data bag item from a chef recipe

二次信任 提交于 2020-01-06 15:18:40
问题 motivation: the node will try to fetch a key from the data bag, if the key does not exist, it will generate one. this is handy when there you scale your cluster and have to share a password for it. note that there won't be any node creation in parallel, so race condition will be avoided. there is a part in chef documentation that relates to create and edit data bag item from a recipe, though there is nothing there that relates to creating a new encrypted data bag item. can anyone please shed

Chef Server return 404 for all knife and chef-client request

元气小坏坏 提交于 2020-01-06 13:12:06
问题 I am trying to setup chef-server and chef-client for automatic deployment of packages on virtual machines run on Openstack. I am following the instructions on https://docs.chef.io/install_server.html. The version of the package is chef-server 12.0.8, on ubuntu 14.04 server (chef-server-core_12.0.8-1_amd64.deb). Several attempts have been made, always with a clean machine, and always with the same result, even with a slightly older chef-server version (12.0.3, I believe). User gets created,

Chef Berks Install (Berkshelf) Timesout contacting Artifactory repository (Faraday Timeout / Actor Crashed)

不羁的心 提交于 2020-01-06 05:59:53
问题 Artifactory 5.8.4 Professional Chef Development Kit Version: 1.1.16 chef-client version: 12.17.44 delivery version: master (83358fb62c0f711c70ad5a81030a6cae4017f103) berks version: 5.2.0 kitchen version: 1.14.2 In Artifactory, I have this repository (virtual): avirtual-repo Berksfile contains : # cat Berksfile # vim: ft=berksfile.ruby: source "http://artifactory-server:8181/artifactory/api/chef/avirtual-repo" cookbook "top_level_cookbook_name", ">= 0.0.0" When, I'm running berks install , it

Getting “ Cannot run program ”bash“” while building chef in jenkins

China☆狼群 提交于 2020-01-05 17:09:18
问题 I have installed chef-plugin in jenkins and did the following configurations: Run chef client on remote host: enabled: checked ssh host: "remote host" ssh login: root chef_json template: "{ "run-list" :[ "recipe[test]" ] }" color output: checked and got the following error: Started by user swetha sreeramoju Building in workspace C:\.jenkins\workspace\chef-sample [2015-05-27 19:06:44 +0530] INFO: [34m[47mrendering ERB template[0m[0m [2015-05-27 19:06:44 +0530] INFO: [34m[47mparsing JSON string

Chef: Force use of modified attributes in template

余生颓废 提交于 2020-01-04 05:37:18
问题 I have noob chef question. I need to update a directory path in a template and copy it to two different places. The directory path is different for each instance although the template file is the same. I have the following attributes file (default.rb): node['conf_dir'] = '/opt/app/etc' I have the following template file (myconfig.conf.erb): ConfigDir = <%= node['conf_dir'] %> I have the following in my recipe file: template '/opt/app/etc/myconfig.conf' do source 'myconfig.conf.erb' owner