Skip to content

Instantly share code, notes, and snippets.

@yaodong
Created August 26, 2014 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaodong/206366885c31ee5fc827 to your computer and use it in GitHub Desktop.
Save yaodong/206366885c31ee5fc827 to your computer and use it in GitHub Desktop.
chef cookbooks
source "https://api.berkshelf.com"
cookbook 'build-essential', '~> 2.0.6'
cookbook 'sudo', '~> 2.7.0'
cookbook 'users', '~> 1.7.0'
cookbook 'chef-solo-search', '~> 0.5.1'
cookbook 'sshd', '~> 1.1.0'
cookbook 'fail2ban', '~> 2.2.0'
cookbook 'ufw', '~> 0.7.4'
cookbook 'apt-periodic', '~> 0.2.0'
{
"id": "deploy",
"password": "$1$IYaI2C7l$S37uGtAoFNgfVYYXzNkfV0",
"ssh_keys": [
"ssh-rsa AAA..........ACH test@local"
],
"groups": [ "sysadmin"],
"shell": "\/bin\/bash"
}
source "https://ruby.taobao.org"
gem "knife-solo"
gem "chef"
gem "berkshelf"
{
"run_list": [
"role[server]"
],
"automatic": {
"ipaddress": "117.121.26.11"
}
}
{
"name": "server",
"description": "",
"json_class": "Chef::Role",
"default_attributes": {
"authorization": {
"sudo": {
"groups": ["sysadmin"],
"users": ["deploy"],
"passwordless": false
}
},
"sshd": {
"sshd_config": {
"PasswordAuthentication": "no",
"X11Forwarding": "no",
"UsePAM": "no",
"PermitRootLogin": "no"
}
}
},
"override_attributes": {
"firewall": {
"rules": [
{
"http": { "port": 80 },
"https": { "port": 443 }
}
]
}
},
"chef_type": "role",
"run_list": [
"build-essential",
"chef-solo-search",
"users::sysadmins",
"sudo",
"sshd",
"fail2ban",
"ufw",
"apt-periodic"
],
"env_run_lists": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment