chef

chef-run vs chef under systemd - different gem repos

前提是你 提交于 2019-12-10 23:53:34
问题 I'm trying to make chef swap the official rubygems repo with my own local one. It kind of does work but let's say 'not always'. More on that below. bash-4.2$ /opt/chef/embedded/bin/gem sources *** CURRENT SOURCES *** https://rubygems.org/ Chef is running under control of systemd. When I check in journal what chef has done so far I get Jan 14 07:39:24 myserver.srv chef-client[32274]: [2016-01-14T07:39:24+01:00] INFO: Processing execute[add_my_own_repo] action run (mycookbook::gem line 5) Jan

Chef-client dying mid run

无人久伴 提交于 2019-12-10 23:38:47
问题 We recently started having trouble with chef-client dying in the middle of a run after taking a lot more time stuck on various parts of the run-list that normally proceeded much quicker. I've been on my home wifi and my colleague has been on the work wifi, which has been having some connectivity problems of its own. If your ssh connection gets interrupted to a machine while chef-client is running, does that crash the run in seemingly inexplicable ways? I am using PutTY to connect from my Win7

Chef recipe for RoR Heroku

我的梦境 提交于 2019-12-10 23:36:46
问题 Is there a chef cookbook or recipe for creating a Ruby on Rails heroku-like stack on a vagrant lucid32 (or 64). I have tried the vagrant-heroku box, but it doesn't seem come all that ready after all and felt a bit buggy* . I wonder if it would be more efficiently done some other way. A well documented guide on how to build such stack would also do. This guy comes pretty close, but misses all the PostgreSQL part and versions details. disclaimer: I am a newbie, with "bit buggy" I mean it wasn't

mysql chef database recipe fails on large file

折月煮酒 提交于 2019-12-10 22:28:43
问题 "MySQL server has gone away". Hmm. I am using vagrant and chef to setup my virtual development environment. I'm almost there, but on the last step chef fails when attempting to execute my external db_setup.sql file. I can execute this same script by SSH'ing into the virtual server and it installs without difficulty. This is my problem code (in cookbooks/database/recipies/mysql.rb file): # Query a database from a sql script on disk mysql_database 'run script' do database_name 'my_db'

How do I authenticate when I do a git clone with Chef? [duplicate]

一世执手 提交于 2019-12-10 21:56:27
问题 This question already has answers here : Git authentication in Chef (6 answers) Closed 5 years ago . I am new to all this but I am guessing I will be using SSH keys ... but how? git '/home/vagrant/foo' do repository 'me@repo.domain.com:/usr/git/app.git' reference 'master' action :sync user "vagrant" group "vagrant" end 回答1: Here what worked for me: 1 - Generate a SSH key pair (public + private) The public key you will add to your git repo 2 - Generate a key for encryption openssl rand -base64

Get list of installed cookbooks along with their version

风流意气都作罢 提交于 2019-12-10 21:32:40
问题 I have a server that has been provisioned via chef. Now I like to know exactly which cookbook versions have been installed on this server. Being a chef-newbee, I worked around using grep like the following, but I like to know whether or not there is some official way of getting that information. sudo grep -E '^version|"version":' /var/chef/cache/cookbooks/*/metadata* Is there a chef command that lists all the installed cookbooks along with their versions? 回答1: Variation on some of the above.

How can I get test kitchen run same chef recipe multiple times?

北城以北 提交于 2019-12-10 21:16:17
问题 I have a chef recipe that I'm using for deploying an application. Each time the recipe runs it creates a new "release" (with the current timestamp) directory and deletes older "release" directories leaving only the 5 most recent "release" directories. (similar to how Capistrano's keep_releases works). To test that functionality I need to run my "deploy" recipe 6 times and verify that there are only 5 "release" directories. It seems that I am not able to have the same recipe in the run_list

How to find out version of software package installed on the node?

北城以北 提交于 2019-12-10 20:13:09
问题 I'm adapting Apache cookbook to work with 2.4 Apache. Opscode cookbook is currently failing because it's generating conf file with LockFile keyword that is excluded from the list of the Apache 2.4 keywords. I want to make a general solution, and populate my conf file depending on the version of software. To do so, I have to find out what's the version of already installed software. This same question has been bothering me for about a time now, but I've been managing to avoid it. Since I'm

Updating $PATH with `magic_shell` Cookbook

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 19:52:51
问题 I created 2 cookbooks: java_kevin and maven_kevin: cookbooks/java_kevin/recipes/default.rb node.default['user'] = 'vagrant' node.default['user_home'] = '/home/' + node['user'] node.default['my_dir'] = node['user_home'] + '/my' node.default['vagrant'] = '/vagrant' node.default['java_home'] = node['my_dir'] + '/jdk1.7.0_51' # Install Java 7 RPM execute "install_oracle_java7" do command "rpm -ivh --prefix=" + node['my_dir'] + " jdk-7u51-linux-x64.rpm" cwd node['vagrant'] creates node['java_home'

How to get Docker host IP on Travis CI?

≡放荡痞女 提交于 2019-12-10 17:21:29
问题 I have a Rails repo on Travis. It has a docker-compose.yml file: postgres: image: postgres ports: - "5433:5432" environment: - POSTGRES_USER=calories - POSTGRES_PASSWORD=secretpassword (I had to use 5433 as the host port because 5432 gave me an error: Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use ) And a travis.yml: sudo: required services: - docker language: ruby cache: bundler before_install: # Install docker-compose - curl -L https://github.com/docker