chef

How can I get Chef to run apt-get update before running other recipes

拥有回忆 提交于 2019-12-03 02:34:52
问题 Right now I have the following in my Vagrantfile: config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "cookbooks" chef.add_recipe "apt" chef.add_recipe "build-essential" chef.add_recipe "chef-redis::source" chef.add_recipe "openssl" chef.add_recipe "git" chef.add_recipe "postgresql::server" chef.add_recipe "postgresql::client" end In order to install the software added to my recipe_list, I need to get the VM to issue an apt-get update before installing the other software. I was

Chef deploy_resource private repo, ssh deploy keys and ssh_wrapper

二次信任 提交于 2019-12-03 01:30:01
I'm having loads of trouble getting my Chef recipe to clone a private repo. Well, I had it working yesterday but after 'cheffin' my Vagrant box half a dozen times, I've broken it. I'm a Chef newbie as you may guess. Following the deploy_resource guide here, I've created my deploy.rb recipe (shortened): deploy_branch "/var/www/html/ps" do repo git@github.com:simonmorley/private-v2.git ssh_wrapper "/tmp/.ssh/chef_ssh_deploy_wrapper.sh" branch "rails4" migrate false environment "RAILS_ENV" => node[:ps][:rails_env] purge_before_symlink %w{conf data log tmp public/system public/assets} create_dirs

Chef solo can't find cookbook during kitchen test run

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to add a Test Kitchen for a bunch of cookbooks that we use to provision a Jenkins CI instance. We use Berkshelf to manage dependencies. The file structure is as follows: | .gitignore | .kitchen.yml | Berksfile | Berksfile.lock | bootstrap.sh | chefignore | metadata.rb | provision.sh | readme.md | solo.json | solo.rb | tree.txt | VERSION | +---.kitchen | | default-ubuntu-1404.yml | | | +---kitchen-vagrant | | \---kitchen-chef-jenkins-default-ubuntu-1404 | | | Vagrantfile | | | | | \---.vagrant | | \---machines | | \---default | | \

Vagrant provisioning shell vs puppet vs chef

我的梦境 提交于 2019-12-03 01:21:40
问题 I have the following setup: Many different projects which are separate git repositories, but all have mostly the same server configuration Each project in turn depends on many other projects and we use the composer dependency manager to get them together (PHP language here). I want to use Vagrant and include a Vagrant file in each repository, so my team members can clone a repository, run vagrant up and be ready to go. My question is now directed towards the provisioning. I need to install

Including a Chef LWRP from another cookbook

自古美人都是妖i 提交于 2019-12-03 01:18:07
I wrote a small LWRP my app cookbook ( trim_log ), and it works. However, now I am trying to move this particular LWRP in to the commons cookbook so that my other cookbooks can also use it. The problem is that I cannot figure out how to load in the trim_log resource/provider in to any of the cookbooks, including my app cookbook. ├── app │ ├── recipes │ └── default.rb ├── commons ├── providers │ └── trim_log.rb └── resources └── trim_log.rb I have defined the trim_log provider/resource in the commons cookbook. Now I wish to use this trim_log provider/resource in the app cookbook. How can I make

Vagrant & Chef: uninitialized constant Chef::Resource::LWRPBase

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I get this error when i try to run "vagrant provision": Running chef-solo... stdin: is not a tty [2014-05-15T12:21:41+00:00] INFO: *** Chef 10.14.2 *** [2014-05-15T12:21:41+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[build-essential]", "recipe[vim]", "recipe[git]", "recipe[mysql::server]", "recipe[apache2]", "recipe[php]", "recipe[vhosts]", "recipe[apache2::mod_php5]", "recipe[php::module_mysql]", "recipe[php::module_apc]", "recipe[php::module_curl]", "recipe[phpmyadmin]", "recipe[phpredis]", "recipe[redis-package::server]",

Split the string to get only the first 5 characters

风格不统一 提交于 2019-12-03 00:45:40
问题 I would like to go to the location /var/log/src/ap-kernelmodule-10.001-100 But looks like my code has to deal with ap-kernelmodule-10.002-100, ap-kernelmodule-10.003-101 etc. I would like to reach the location with a split string and execute my command. eg : /var/log/src/ap-kernelmodule-10./ This ruby script for a Linux machine, so I used Mixlib:: ShellOut. begin cmd = Mixlib::ShellOut.new("command run here" , :cwd => '/var/cache/acpchef/src/ap-kernelmodule-10xxx') cmd.run_command end 回答1:

Using knife ec2 plugin to create VM in VPC private subnet

ぃ、小莉子 提交于 2019-12-03 00:25:16
Although I've written a fair amount of chef, I'm fairly new to both AWS/VPC and administrating network traffic (especially a bastion host). Using the knife ec2 plugin, I would like the capability to dynamically create and bootstrap a VM from my developer workstation. The VM should be able to exist in either a public or private subnet of my VPC. I would like to do all of this without use of an elastic IP. I would also like for my bastion host to be hands off (i.e. I would like to avoid having to create explicit per-VM listening tunnels on my bastion host) I have successfully used the knife ec2

Installing chef-server in a docker container

烂漫一生 提交于 2019-12-03 00:07:30
I have been trying to install Chef-Server in a Docker container and I am having some trouble. I am running a VM with an up to date version of Ubuntu 12.04 and latest install of Docker. I run a base Docker Ubuntu 12.04 container and install chef-server, version 11.0.12 and that goes well. The problem is running the required 'sudo chef-server-ctl reconfigure' step after install. The setup freezes at * link[/opt/chef-server/init/rabbitmq] action create (up to date) * link[/opt/chef-server/service/rabbitmq] action create (up to date) * **ruby_block[supervise_rabbitmq_sleep] action run** and I get

How to pass attributes in chef-client without JSON file?

不问归期 提交于 2019-12-02 23:41:36
I know we can pass node attributes in chef-{client/solo} with --json-attributes(-j) flag. This flag always expect a JSON file as input. Is their any method I can directly pass the attributes as JSON objects. I tried doing it. For eg: chef-client -j {"attr":"value"} But it ends up with a failure message as: FATAL: I cannot find {"attr":"value"} As it expects a JSON file. I need to pass JSON objects as in our env I can't create a json file. I don't want to use attributes/role/environment files as well. Is there any other way to pass the attributes ? Have you tried piping the JSON to STDIN? echo