This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
498 knife search users "*:*" | |
499 knife search node "*:*" | |
500 ohai | |
501 knife search node "plat*:ubuntu" | |
502 knife search node "*:*" | |
503 knife search node | |
504 knife search node "*:*" | |
505 knife search node "ipaddress:10.*" | |
506 knife search node "ipaddress:10.*" -a platform | |
507 knife search node "ipaddress:10.* AND platform:ubuntu" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name "base" | |
description "Base Server Role" | |
run_list "recipe[ntp]", "recipe[motd]", "recipe[chef-client]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "mark", | |
"production" : { | |
"comment": "Mark in Production", | |
"uid": 3001, | |
"gid": 0, | |
"home": "/home/mark", | |
"shell": "/bin/zsh" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mark = data_bag_item('admins','mark') | |
user mark['id'] do | |
comment mark[node.chef_environment]['comment'] | |
uid mark[node.chef_environment]['uid'] | |
gid mark[node.chef_environment]['gid'] | |
home mark[node.chef_environment]['home'] | |
shell mark[node.chef_environment]['shell'] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl rand -base64 512 | tr -d '\r\n' > ~/.chef/encrypted_data_bag_secret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search( :users, "*:*" ).each do | user_account | | |
user_id = user_account['id'] | |
user_data = Chef::EncryptedDataBagItem.load("users", user_id) | |
user user_data['id'] do | |
comment user_data['comment'] | |
uid user_data['uid'] | |
gid user_data['gid'] | |
home user_data['home'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_inline_resources | |
action :create do | |
resource_name = new_resource.file_name.gsub('/', '_') | |
execute "create#{resource_name}" do | |
command "dd if=/dev/zero of=#{new_resource.file_name} bs=1024 count=#{new_resource.blocks}" | |
not_if { ::File.exists?(new_resource.file_name) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
action :destroy do | |
resource_name = new_resource.file_name.gsub('/', '_') | |
execute "swapoff#{resource_name}" do | |
command "swapoff #{new_resource.file_name}" | |
only_if "grep -q #{new_resource.file_name} /proc/swaps" | |
end | |
execute "delete#{resource_name}" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bats | |
@test "git binary is found in PATH" { | |
run which git | |
[ "$status" -eq 0 ] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
driver: | |
name: vagrant | |
provisioner: | |
name: chef_solo | |
platforms: | |
- name: ubuntu-12.04 | |
- name: centos-6.4 |