chef

JClouds-Chef not bootstrapping & configuring VM

佐手、 提交于 2019-12-12 02:55:15
问题 I am trying to get the following JClouds-Chef code (v1.7.3) to bootstrap Chef Client on a brand new Linux VM and then execute a run list to actually configure that VM with an app stack ( typical_app ): public class ChefPlugin { public static void main(String[] args) { ChefPlugin.provision(); System.out.println("And done!"); System.exit(0); } public static provision() { String vmIp = "myapp01"; String vmSshUsername = "myadmin"; String vmSshPassword = "12345"; String endpoint = "https:/

RegexpError in chef when running knife bootstrap

纵然是瞬间 提交于 2019-12-12 02:45:30
问题 I am going through the "Learn to install and manage your own Chef server / Manage a node on your Chef server" tutorial over at learn.chef.io but have run into an issue that Google apparently doesn't know about. I'm trying to run everything locally, so have the following set up: Chef Workstation - my Fedora 20 laptop Chef Server - a VM running CentOS 7 minimal Chef Node - another VM running CentOS 7 minimal I've set up the Workstation and Server, users and organisations, extracted the Starter

Mock Chef::ReservedNames::Win32::Version.new in Chef unit/rspec test?

不羁岁月 提交于 2019-12-12 02:41:49
问题 I found Fauxhai works for mocking the information in "node" but it doesn't mock Chef::ReservedNames::Win32::Version.new. Is there anyway to mock this? 回答1: Standard RSpec applies so allow(Chef::ReservedNames::Win32::Version).to receive(:new).and_return(double('fake version')) or similar. 来源: https://stackoverflow.com/questions/34931987/mock-chefreservednameswin32version-new-in-chef-unit-rspec-test

When are default node attributes set during a chef client run?

岁酱吖の 提交于 2019-12-12 01:56:43
问题 I edited sample code to clarify my issue. I think the answers make more sense now since my first recipe is indeed inside a ruby_block. When are default node attributes available during a client run? Let me clarify. My example is simplified, but what I'm trying to do is more complex than this, but the concept is similar. I bootstrapped a node, which ran with an empty run list. So far so good. Now I add my hello_world cookbook to my node's run list. knife node run_list add node_name "recipe

chef versioning - is there an order of precedence?

隐身守侯 提交于 2019-12-11 23:23:12
问题 As i understand it, you can set the version for a cookbook in its metadata.rb file. You can subsequently reference that version in three places. Other cookbook metadata, environments or run_lists. What happens if you specify a version constraint for the same cookbook in more than one of those locations with different version numbers. Which version is enforced? The reason for asking is if a Role isn't versioned like a cookbook... and maybe the production environment is configured to lock

How apply chef cookbook/recipes to multiple nodes?

a 夏天 提交于 2019-12-11 23:15:55
问题 Here is example how apply cookbook to node with Chef. But nothing told about multiple nodes. For example I have a akka application, which is passed akka.cluster.seed-nodes parameters. So the algorithm should be: Define array "IP" with ip addresses like [192.168.1.1], [192.168.1.2], [192.168.1.3] Define empty array "bootsrapped" with bootsrapped ip addresses starting iteration over "IP" invoke knife bootstrap with current ip and "pass" -Dakka.cluster.seed-nodes with "bootsrapped" values store

Vagrant creating an incorrect client.pem on chef node (I think)

两盒软妹~` 提交于 2019-12-11 20:56:48
问题 I'm using Vagrant to create a chef node, and it spins up the image and then the initial chef-client run fails. When I ssh into the machine, delete /etc/chef/client.pem , and run sudo chef-client again, it succeeds, but without the run_list that I passed in from vagrant. This is what the failure looks like: $ vagrant up Bringing machine 'default' up with 'vsphere' provider... ==> default: Calling vSphere CloneVM with the following settings: ==> default: -- Template VM: myOrg/vm/myFolder

Tomcat not Restarting :: Syntax error on line 106 of /etc/httpd/conf/httpd.conf

↘锁芯ラ 提交于 2019-12-11 20:12:02
问题 When i logged into my remote system (Amazon Linux) after executing apache2 recipe, the httpd service was running, i checked it by using service httpd status , then i wrote service httpd restart after that service stopped but didnt restart. It gives me following error. [root@java-app1 webapps]# sudo service httpd restart Stopping httpd: [ OK ] Starting httpd: httpd: Syntax error on line 106 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/mods-enabled/systemd.load: Cannot

Chef git cookbook: how to fix permission denied while cloning private repo?

蹲街弑〆低调 提交于 2019-12-11 19:29:29
问题 I have a cookbook, that uses deploy_key cookbook to generate deploy key & git cookbook to clone private gitlab project. Chef always says that he has deployed keys successfully and gave them proper rights. But sometimes it works fine, sometimes it gives following error, and i can't get why. ==> default: ================================================================================ ==> default: Error executing action `sync` on resource 'git[/home/vagrant/webtest]' ==> default: ===============

Install Postgres 9.2 on CentOS 6.5 using Chef

旧巷老猫 提交于 2019-12-11 19:14:05
问题 Env: CentOS 6.5, Chef, Vagrant, Berkshelf Added cookbook "postgresql" in my Berksfile Ran $ berks install followed berks upload which uploaded my cookbook to my hosted Enterprise Chef server. Added my postgresql attributes to my cookbook my_cookbook/attributes/default.rb default['postgresql']['version'] = '9.2' default['postgresql']['client']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-devel"] default['postgresql']['server']['packages'] = ["postgresql#{node[