chef

Why does the LWRP custom definition gives me undefined method for nil:NilClass

蹲街弑〆低调 提交于 2019-12-22 08:40:11
问题 I have problem with my custom definition of this LWRP. resources : user_postgresql. actions :create, :alter default_action :create attribute :username, :kind_of => String attribute :password, :kind_of => String attribute :database_name, :kind_of => String providers : user_postgresql. def whyrun_supported? true end action :create do converge_by "Create [#{new_resource}]" do USER_NAME = new_resource.username USER_PASSWORD = new_resource.password unless (new_resource.password.nil? || new

How to implement a dynamic attribute default in chef LWRP definition

笑着哭i 提交于 2019-12-22 06:33:57
问题 I would like to be able to define a lightweight resource with let's say 3 parameters, two of them being basic/elementary parameters and the third being a combination of these two. I would also like to provide a possibility of customization of the third parameter. For example: How to modify following code to achieve above behaviour for the full_name attribute: resource definition: actions :install attribute :name, :kind_of => String, :name_attribute => true attribute :version, :kind_of =>

Chef node configuration issue with knife bootstrap- can't authenticate with server

大城市里の小女人 提交于 2019-12-22 05:22:29
问题 I am trying to setup a chef client node using knife bootstrap: knife bootstrap nodename -x user -P passwd --sudo Getting the following error messages:: Chef encountered an error attempting to create the client "nodename .url.com" Authentication Error - Failed to authenticate to the chef server (http 401). Server Response: Invalid signature for user or client 'chef-validator'* My config settings looks good, I have tried restarting all the chef-server services and tried configuring the chef

Chef Solo error: Cookbook apt not found

こ雲淡風輕ζ 提交于 2019-12-22 05:15:22
问题 Hy I'm trying to run a MongoDB recipe with Chef Solo on an Amazon EC2 Linux AMI. I've installed Omnibus, set the cookbook path in the .rb file, and the runlist in the .json file. I've copied the content of the mongodb recipe zip from github to to cookbook folder, and ran the chef-solo command. The result is below: FATAL: Chef::Exceptions::CookbookNotFound: Cookbook apt not found. If you're loading apt from another cookbook, make sure you configure the dependency in your metadata I'm pretty

Chef Server installation issues

試著忘記壹切 提交于 2019-12-22 04:43:12
问题 I have been trying to install chef server (chef-server-core-12.1.0-1.el6.x86_64.rpm), on my CentOS 6.5 machine using this guide: http://docs.chef.io/server/install_server.html#standalone This is a test environment, hence I Do not have a FQDN but the IP address is resolvable. After I run chef-server-ctl reconfigure, I try to create a user using: [root@xxx-xxx-xxx-xxx ~]# chef-server-ctl user-create myusername myfirstname mylastname myemail mypassword --filename /root/myfile.pem I fill

Chef Server installation issues

怎甘沉沦 提交于 2019-12-22 04:43:12
问题 I have been trying to install chef server (chef-server-core-12.1.0-1.el6.x86_64.rpm), on my CentOS 6.5 machine using this guide: http://docs.chef.io/server/install_server.html#standalone This is a test environment, hence I Do not have a FQDN but the IP address is resolvable. After I run chef-server-ctl reconfigure, I try to create a user using: [root@xxx-xxx-xxx-xxx ~]# chef-server-ctl user-create myusername myfirstname mylastname myemail mypassword --filename /root/myfile.pem I fill

线程之间的协作

空扰寡人 提交于 2019-12-22 03:38:00
引言 线程之间可以通过 wait() 、 notify() 和 notifyAll() 等方法,结合“生产者、消费者和队列”等设计模式来相互协作。线程之间协作的基础是 任务之间的握手 ,其基础特性是 互斥 。 wait()、notify()、notifyAll() 方法介绍: 以上三个方法都要获取对象监视器; wait() :挂起线程,并放弃当前对象监视器; notify() :唤醒一个等待‘notify()所在代码持有的对象监视器’的线程; notifyAll() :唤醒所有等待线程,并让他们竞争对象监视器; 其他方法 shutdown() : shutdownNow() : 一. wait() 和 notifyAll() 1.1基本特性 当任务遇到运行需要但是自身无法改变的条件时,可以调用 wait() 来等待这个条件发生变化,而且只有在 notify()、notifyAll() 发生时才会检查条件是否发生了变化。 注意,只有在同步代码块中才能使用 wait() 方法( notify() 方法同理),否则编译可以通过但是运行时会抛出 IllegalMonitorStateException 。 与 sleep()、yield() 不同的时: 在 wait() 期间锁是释放的,因此其他方法或代码块可以获得锁并执行; 可以通过 notify()、notifyAll()

Why can't chef resolve my cookbooks?

梦想与她 提交于 2019-12-22 01:38:03
问题 Intro I am learning Chef to automate the server management at work. I downloaded chefdk 3.0 from here and now I am trying to build my first cookbook using chef. Important I am using this in a Windows environment for testing purpose, I do expect it to fail since Windows does not have iptables, but I do not expect it to fail saying that it can't find the cookbook. I've tried using Windows cookbook and it works. The problem I am able to create the cookbook and run it, but I am not able to

chef rewind cookbook_file definition from a wrapper cookbook recipe

安稳与你 提交于 2019-12-22 01:32:26
问题 I am using an cookbook github.com opscode-cookbooks/openldap. I wrote an wrapper cookbook "lab_openldap" that includes "openldap::server" recipe. The server.rb recipe uses following clausule to upload the PEM file from cookbooks files/ssl/*.pem to server to the location node['openldap']['ssl_cert']. if node['openldap']['tls_enabled'] && node['openldap']['manage_ssl'] cookbook_file node['openldap']['ssl_cert'] do source "ssl/#{node['openldap']['server']}.pem" mode 00644 owner "root" group

Jenkins CI with Chef Server

半腔热情 提交于 2019-12-21 21:29:09
问题 Is there any way I can integrate Jenkins with Chef Server so that I can create jobs to be executed? I don't want to have to go to the Chef Workstation. Do I need to install jenkins on a separate server or the chef workstation? Can I execute all the recipes directly from the Jenkins console? 回答1: Yes. You can create jobs in jenkins and can be integrated with chef. Knife search would be the best option. you can run chef-client to run recipes through jenkins to any machine. 回答2: Look into this