#!/bin/bash # if you dont have internet access from your cluster nodes, you will # not be able to "knife bootstrap" nodes to get them ready for # chef. Instead you need to install chef separately. Assuming the # necessary bits are on apt/apache mirror as per the mirror # instructions in bootstrap.md then the following will get chef # installed and allow you to proceed # change the following IP address to match your bootstrap node if dpkg -s opscode-keyring !2 >/dev/null | grep -q Status.*installed { echo opscode-keyring is installed } else { apt-get update apt-get --allow-unauthenticated -y install opscode-keyring apt-get update } if dpkg -s chef !2 >/dev/null | grep -q Status.*installed { echo chef is installed } else { if test -f chef-client.deb { # previously copied over by chefit.sh # normally produced by build_bins.sh dpkg -i chef-client.deb } else { echo "Warning: chef-client.deb not found" echo "chef bootstrap will attempt chef-client install" } } (CommandList children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(dpkg)} {(-s)} {(opscode-keyring)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[35])] ) (C {(grep)} {(-q)} {(Status.) (Lit_Other "*") (installed)}) ] negated: False ) terminator: ) ] action: [(C {(echo)} {(opscode-keyring)} {(is)} {(installed)})] spids: [-1 49] ) ] else_action: [ (C {(apt-get)} {(update)}) (C {(apt-get)} {(--allow-unauthenticated)} {(-y)} {(install)} {(opscode-keyring)}) (C {(apt-get)} {(update)}) ] spids: [60 84] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(dpkg)} {(-s)} {(chef)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[95])] ) (C {(grep)} {(-q)} {(Status.) (Lit_Other "*") (installed)}) ] negated: False ) terminator: ) ] action: [(C {(echo)} {(chef)} {(is)} {(installed)})] spids: [-1 109] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(chef-client.deb)} {(Lit_Other "]")}) terminator: ) ] action: [(C {(dpkg)} {(-i)} {(chef-client.deb)})] spids: [-1 134] ) ] else_action: [ (C {(echo)} {(DQ ("Warning: chef-client.deb not found"))}) (C {(echo)} {(DQ ("chef bootstrap will attempt chef-client install"))}) ] spids: [152 169] ) ] spids: [120 171] ) ] )