Questions tagged [chef]
Chef is an open source configuration management framework for infrastructure automation.
635
questions
0
votes
2
answers
1k
views
Best practices - Conditionals for Chef resources without guard attributes?
We are setting up a cluster using Apache Ambari.
Our Chef run is interrupted by the need to use Ambari to provision the Hadoop cluster. Current installs are a three part process:
Initial Chef run ...
0
votes
0
answers
48
views
What does output of Chef "knife node show" command mean?
With reference to the following command:
knife node show hostname
I see output for:
Run List:
Roles:
Recipes:
What does Recipes: mean in this context? I presume it means that these are the recipes ...
4
votes
1
answer
85
views
Chef large recipe vs lots of small recipes
I was wondering what the general consensus is when it comes to one large CHEF recipe vs a lot of smaller ones.
As an example, say you want to deploy a Radius server, would you have seperate recipes ...
0
votes
2
answers
257
views
rb_sys_fail_path_in(rb_file_s_rename, (filepath1, filepath2)- errno == 0 error when running a newly installed version of chef
I have 1 box that seems to not want to run chef, while I have 5 other identical boxes that are working just fine using the same rhel and chef versions. On the non-working box, Chef runs correctly when ...
3
votes
2
answers
10k
views
Prevent chef recipe from executing previously executed action?
I have a simple recipe like the following, and currently I am using a local file to indicate if the command has been run or not
execute "test" do
command "sh test.sh && touch /opt/myapp/...
7
votes
4
answers
20k
views
Does chef-client use a local cache? If so, can I clear it?
This might be a stupid question. I don't know a lot about chef. I am using chef 11.8.2 on a node. I have a weird problem which might be caused by the chef client caching things rather than downloading ...
2
votes
1
answer
477
views
How to copy ssh keys on a new VM
I have the following situation:
-new CentOS6 VM (created within a Hyper-v failover cluster), joined Windows AD via script
I need to bootstrap this new VM in chef server and to deploy an application ...
3
votes
1
answer
402
views
What are the commands for restarting a service after a file is changed in Chef?
I am unable to figure out the correct solution in that if only when a file is updated, i.e. a conf file of a service, then the service is restarted (stopped and then started).
This is what I have in ...
0
votes
2
answers
2k
views
Clone git repo via https without entering the password manually
I've got a stack in Amazon OpsWorks and within this stack I got a RailsApp Layer. The repository is only accessible via https and is protected with username and password. On my machine I can clone the ...
0
votes
1
answer
2k
views
Chef clients time out trying to connect to server
I'm not sure whether the problem is on client or server. All my machines are Ubuntu 12.04 x64. I'm on Digital Ocean, and I have to configure iptables to "survive".
Server Story
My Chef Server is on ...
1
vote
1
answer
2k
views
Multiple related resources in chef recipe
I need to run some commands depending on a result of previous execution, which again depends on some package being installed.
On the first run, I'd expect something like:
install package "XXX"
get ...
2
votes
3
answers
2k
views
How to install APC on a vagrant box running Ubuntu with PHP?
In my "Vagrant" file I have this line:
chef.add_recipe("php::module_apc")
But it gives me this error:
[2013-01-11T22:14:53+00:00] INFO: Processing package[php-apc] action install (php::module_apc ...
1
vote
1
answer
2k
views
Bootstrapping servers with chef, and changing the SSH Port
I have a full set of recipes that are working to bootstrap a server at Rackspace, it configures and installs everything as needed. Now, I want to change the default port SSH runs on. This is fairly ...
5
votes
2
answers
3k
views
"one-off" use of http_proxy in a Chef remote_file resource
I have a use case where most of my remote_file resources and yum resources download files directly from an internal server. However, there is a need to download one or two files with remote_file that ...
1
vote
2
answers
3k
views
Chef: Knife ssh connection error
I try to run a command on all my nodes but get the following error. The chef docs say it should work like this.
me$ sudo knife ssh "name:*" "uptime" -x myuser
WARNING: Failed to connect to -- Errno::...
2
votes
3
answers
2k
views
Installing something from source using chef, should I be doing some checks
I'm installing something from source using chef and the script resource. Should I be doing a check for the resultant executable etc. as part of it?
e.g. What I currently have is:
remote_file "/tmp/...
1
vote
2
answers
3k
views
How to automatically increase the partition size of multiple Ubuntu nodes in VMware vSphere?
We have dozens of Ubuntu nodes where I have to resize the hard disk drive to different sizes. Currently I’m doing all of the following steps manually:
Increase the size of each node’s virtual hard ...
1
vote
2
answers
2k
views
Where is this chef attribute coming from and why can't I change it?
An attribute for a chef node is not being updated when I change the role, the old value is persisting.
The node['nagios']['custom_variables']['styleurl'] attribute is not updating to the new value of ...
7
votes
4
answers
7k
views
bootstrap (add node) localhost in chef
Problem. Following command line
knife bootstrap 127.0.0.1 -r 'recipe[chef-client]' -x user -p password --sudo
returns
Bootstrapping Chef on 127.0.0.1
WARNING: Failed to connect to 127.0.0.1 -- ...
0
votes
1
answer
1k
views
Chef: 'search' not finding nodes by role on dev
I'm working on spinning up a cluster of nodes. In myrepo/cookbooks/mycookbook/.kitchen.yml I have
driver:
name: vagrant
provisioner:
name: chef_zero
roles_path: '../../roles'
...
1
vote
3
answers
2k
views
ssh command to add a public key to the local `authorized_keys`?
Is there a single line command to tell SSH to add a provided public key to the local machine's authorized_keys file? A local version of ssh-copy-id?
I am writing a chef recipe and want to ensure a ...
2
votes
1
answer
83
views
How can chef run a command as a username?
In a Linux system, it is feasible to do
sudo systemctl start my_server
sudo -u ubuntu command ...
so that the command is run as the username ('ubuntu' in this case). However, and when I run chef with ...
2
votes
1
answer
5k
views
What's the difference between Chef Cookbooks and Chef Roles?
My current understanding:
You can add a recipe to a client. A recipe can contain other recipes.
You can add a role to a client. A role can contain other roles and recipes.
Then what's the practical ...
0
votes
1
answer
1k
views
Is there a way to update attributes files directly in chef server without uploading cookbook again
I am using hosted chef environment in windows.I need to update the attribute file during each chef client run. Currently ,I update it manually and upload the cookbook in chef server.Is there any way ...
8
votes
3
answers
7k
views
How do I provide dpkg configuration parameters to aptitude or apt-get?
When installing gitolite I find that:
# aptitude install gitolite
The following NEW packages will be installed:
gitolite
0 packages upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
...
2
votes
1
answer
2k
views
How to use an SSH Gateway with Chef's Knife Bootstrap
I'm just getting started with Chef and have a few nodes in a private network that I need to first ssh into a gateway node to gain access to. For the moment i'm using purely password based ...
0
votes
2
answers
8k
views
Chef Private Key Could Not Be Loaded from /user.pem
I just finished the install chef-server tutorial at Chef's website, using an ec2 instance for my chef-server (t2.medium Ubuntu 16.04 AMI), and my laptop for my workstation, which also runs Ubuntu 16....
1
vote
0
answers
89
views
Is there a way to pass a role json file to the chef-run utility in chef-workstation?
The chef-run executable provided in chef workstation allows you to run adhoc configuration tasks. The documentation also states that you can run commands, recipes and even cookbooks on remote machines ...
0
votes
1
answer
291
views
chef generate cookbook asking yes or no repeatedly
I'm trying to create a chef cookbook using the following command:
chef generate cookbook cookbooks/create_files
on the following versions of chef
Chef Workstation version: 0.10.41
Chef Infra Client ...
0
votes
2
answers
130
views
Using Configuration management tools to synchronize large files
We are looking into using a configuration mangement tool (like Salt or Puppet) to automate what is currently a lot of manual work. One requirement is that we have to distribute rather large files / ...
24
votes
3
answers
21k
views
Configuration management: push versus pull based topology
The more established configuration management (CM) systems like Puppet and Chef use a pull-based approach: clients poll a centralized master periodically for updates. Some of them offer a masterless ...
11
votes
2
answers
11k
views
Chef recipe order of execution redux
Given the following recipe:
ruby_block "block1" do
block do
puts "in block1"
end
action :create
end
remote_file "/tmp/foo" do
puts "in remote_file"
source "https://yahoo....
1
vote
2
answers
3k
views
Check version using Chef
I have a small application installed on a few servers, I wanted to write a quick recipe that will allow me to gather the version number from these servers.
This is what I've written:
bash "Get app ...
0
votes
1
answer
63
views
Which server configuration management tool to use for my personal nextcloud deployment [closed]
I want to deploy a personal nextcloud application.
I already have setup nextcloud using docker-compose, which tool should I use for server configuration management?
I have the following things to ...
1
vote
3
answers
712
views
Auto-Retry Config Push with Ansible or Saltstack?
I'm trying to choose a configuration management system for 500-2000 very-geographically-distributed hosts. Due to varying network reliability, it's possible that a number of hosts may be temporarily ...
0
votes
1
answer
65
views
How do I specify a Chef attribute that applies to a cluster?
Chef has a concept of environment attributes that applies to all hosts within an environment. It also has a concept of attributes that are specific to a single node. But is there a way to specify an ...
5
votes
1
answer
290
views
What do the default opsworks cookbooks actually do?
The company I'm working for is making a move to AWS and so I've been given the opportunity to start investigating the various services they provide. OpsWorks looks really good for rolling out mass ...
3
votes
2
answers
2k
views
How to add a windows node for chef
I have 3 servers
Following this guide for the chefmaster and chefworkstation
https://www.itzgeek.com/how-tos/linux/centos-how-tos/setup-chef-12-centos-7-rhel-7.html
chefmaster 192.168.1.200 ...
1
vote
0
answers
333
views
How to upgrade Ruby Bundle version in AWS Opsworks
I have a project running on AWS Opsworks, which has current bundler version of 1.5.3 on Ruby 2.2.2.
i want to upgrade the bundle version to 1.17.3
but when i try to do it i am getting this error
...
-1
votes
2
answers
629
views
Can we write a chef cookbook to enable epel repository on centos
I have configured 3 centos servers for chefworkstation, chefserver and chefclient. Now I want to install nginx using the cookbook. For that I have below script.
package 'nginx' do
action :install
...
17
votes
2
answers
30k
views
Chef: create a directory for a template if it doesn't already exist
If I have a template being created, how can I ensure that the directory exists? For instance:
template "#{node[:app][:deploy_to]}/#{node[:app][:name]}/shared/config/database.yml" do
source '...
4
votes
2
answers
3k
views
How to specify both a recipe and a version of a cookbook at the same time?
I'm trying to specify both a cookbook version and a recipe on a nodes run_list and so far haven't been able to figure out how to do so. I can specify the version just fine and that works, and I can ...
4
votes
2
answers
10k
views
Getting "Couldn't connect to realm service" error while joining rhel7 instance to a domain
I am trying to join a rhel7 node to a domain using a chef cookbook but getting error:
realm: Couldn't connect to realm service: Error calling
StartServiceByName for org.freedesktop.realmd:
GDBus....
21
votes
6
answers
39k
views
Is there a more elegant way to remotely run chef-client?
This is the way recommended in the Chef Fast Start tutorial:
knife ssh name:mynode -a ipaddress -x ubuntu -i mycredentials.pem "sudo chef-client"
This is really clumsy. Is there really not a better ...
0
votes
1
answer
1k
views
chef: The authenticity of host 'x.x.x.x' can't be established
I'm running knife bootstrap command I'm getting following error
Connecting to x.x.x.x WARN: [SSH] PTY requested: stderr will be merged
into stdout The authenticity of host 'x.x.x.x ()' can't be
...
0
votes
1
answer
295
views
Chef: Kitchen Converge fails on Windows 10 Guest using Vagrant FileTransporter Error
As described in the bug I created here:
https://github.com/test-kitchen/kitchen-vagrant/issues/407
When I perform a kitchen converge on a freshly created Windows 10 box, it connects and begins ...
3
votes
2
answers
2k
views
Test Kitchen not detecting winrm and uses SSH for windows guest
I'm new to test kitchen with windows
I'm testing chef recipes on a windows machine using Test Kitchen with Vagrant (virtualbox)
I have win-2012-r2 box that works fine with Vagrant (both winrm and ...
0
votes
1
answer
212
views
How to allow HTTP traffic using chef cookbook?
Previously, I have installed nginx using chef cookbook. Then I did research about firewall rules. For allowing HTTP traffic I have below script.
firewall_rule 'http' do
port 80
protocol :tcp
...
0
votes
2
answers
303
views
Chef: "notifies :restart" - stop watchdog prior to restarting service
We are using the community Chef apache2 cookbook with great success; my question revolves around using the "notifies" notification mechanism to tell Apache 2 of configuration changes.
We run a custom ...
1
vote
0
answers
1k
views
Using Chef for setting Windows Active Directory GPO policies on domain controller
I am looking to use Chef to automate the setting of active directory controlled group policy settings (typically on the primary PDC per forest).
I cant find any specific AD GPO functions, on the ...