(command.CommandList children: [ (command.ShFunction name: gen_knife_config body: (command.BraceGroup children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:19) fd: -1 here_begin: {(EOF)} here_end_span_id: 62 stdin_parts: [ ('current_dir = File.dirname(__FILE__)\n') ('log_level :info\n') ('log_location STDOUT\n') ('node_name ') (Id.Right_DoubleQuote '"') (admin) (Id.Right_DoubleQuote '"') ('\n') ('client_key ') (Id.Right_DoubleQuote '"') ('#{current_dir}/admin.pem') (Id.Right_DoubleQuote '"') ('\n') ('validation_client_name ') (Id.Right_DoubleQuote '"') (bcpc-validator) (Id.Right_DoubleQuote '"') ('\n') ('validation_key ') (Id.Right_DoubleQuote '"') ('#{current_dir}/bcpc-validator.pem') (Id.Right_DoubleQuote '"') ('\n') ('chef_server_url ') (Id.Right_DoubleQuote '"') ('https://bcpc-bootstrap/organizations/bcpc') (Id.Right_DoubleQuote '"') ('\n') ("cache_type 'BasicFile'\n") ('cache_options( :path => ') (Id.Right_DoubleQuote '"') ("#{ENV['HOME']}/.chef/checksums") (Id.Right_DoubleQuote '"') (' )\n') ('cookbook_path [') (Id.Right_DoubleQuote '"') ('#{current_dir}/../cookbooks') (Id.Right_DoubleQuote '"') (']\n') ] ) ] ) ] ) ) (command.ShFunction name: copy_client_keys body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(DQ ($ Id.VSub_DollarName '$SUDO_USER'))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:83) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OWNER) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$SUDO_USER')} spids: [88] ) ] ) ] spids: [72 85] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OWNER) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$USER')} spids: [95] ) ] ) ] ) (C {(install)} {(-d)} {(-m0770)} {(-o)} {($ Id.VSub_DollarName '$OWNER')} {(.chef)}) (C {(sudo)} {(install)} {(-m0600)} {(-o)} {($ Id.VSub_DollarName '$OWNER')} {(/etc/opscode/admin.pem)} {(.chef/admin.pem)} ) (C {(sudo)} {(install)} {(-m0600)} {(-o)} {($ Id.VSub_DollarName '$OWNER')} {(/etc/opscode/bcpc-validator.pem)} {(.chef/bcpc-validator.pem)} ) ] ) ) (C {(Id.KW_Set set)} {(-x)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PROXY_INFO_FILE) op: assign_op.Equal rhs: {(DQ (/home/vagrant/proxy_info.sh))} spids: [156] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_f child: {($ Id.VSub_DollarName '$PROXY_INFO_FILE')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:170) ) ] action: [(C {(.)} {($ Id.VSub_DollarName '$PROXY_INFO_FILE')})] spids: [161 172] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_f child:{(./proxy_setup.sh)}) ) terminator: (Token id:Id.Op_Semi val:';' span_id:191) ) ] action: [(C {(.)} {(./proxy_setup.sh)})] spids: [182 193] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_z child:{(DQ ($ Id.VSub_Number '$1'))}) ) terminator: (Token id:Id.Op_Semi val:';' span_id:214) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BOOTSTRAP_IP) op: assign_op.Equal rhs: {(10.0.100.3)} spids: [219] ) ] ) ] spids: [203 216] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BOOTSTRAP_IP) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [225] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_z child:{(DQ ($ Id.VSub_Number '$2'))}) ) terminator: (Token id:Id.Op_Semi val:';' span_id:242) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:USER) op: assign_op.Equal rhs: {(root)} spids: [247] ) ] ) ] spids: [231 244] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:USER) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [253] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_f child:{(.chef/knife.rb)}) ) terminator: (Token id:Id.Op_Semi val:';' span_id:271) ) ] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(knife)} {(node)} {(delete)} { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:282) command_list: (command.CommandList children:[(C {(hostname)} {(-f)})]) ) } {(-y)} ) (C {(true)}) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(knife)} {(client)} {(delete)} {($ Id.VSub_DollarName '$USER')} {(-y)}) (C {(true)}) ] ) (C {(mv)} {(.chef/)} { (DQ (.chef_found_) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:318) command_list: (command.CommandList children: [(C {(date)} {(Id.Lit_Other '+') (DQ ('%m-%d-%Y %H:%M:%S'))})] ) ) ) } ) ] spids: [262 273] ) ] ) (C {(install)} {(-d)} {(-m0700)} {(.chef)}) (command.Simple words: [{(gen_knife_config)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:341) fd: -1 arg_word: {(.chef/knife.rb)} ) ] ) (C {(cp)} {(-p)} {(.chef/knife.rb)} {(.chef/knife-proxy.rb)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.Unary op_id: Id.BoolUnary_z child: {(DQ ($ Id.VSub_DollarName '$http_proxy'))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:367) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('http_proxy ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:376) ) (${ Id.VSub_Name http_proxy) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:380) ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:383) fd: -1 arg_word: {(.chef/knife-proxy.rb)} ) ] ) (command.Simple words: [ {(echo)} { (DQ ('https_proxy ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:392) ) (${ Id.VSub_Name https_proxy) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:396) ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:399) fd: -1 arg_word: {(.chef/knife-proxy.rb)} ) ] ) ] spids: [354 369] ) ] ) (C {(copy_client_keys)}) (C {(knife)} {(ssl)} {(fetch)}) (C {(cd)} {(cookbooks)}) (command.ForEach iter_name: cookbook iter_words: [ {(DQ ('apt 1.10.0'))} {(ubuntu)} {(cron)} {(ntp)} {(DQ ('yum 3.2.2'))} {(DQ ('logrotate 1.6.0'))} ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.Unary op_id: Id.BoolUnary_d child: { (braced_var_sub token: (Token id:Id.VSub_Name val:cookbook span_id:463) suffix_op: (suffix_op.Unary op_id: Id.VOp1_Percent arg_word: {(' *')} ) ) } ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:469) ) ] action: [ (C {(knife)} {(cookbook)} {(site)} {(download)} {($ Id.VSub_DollarName '$cookbook')} {(--config)} {(../.chef/knife-proxy.rb)} ) (C {(tar)} {(zxf)} { (braced_var_sub token: (Token id:Id.VSub_Name val:cookbook span_id:498) suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{(' *')}) ) (Id.Lit_Star '*') (.tar.gz) } ) (C {(rm)} { (braced_var_sub token: (Token id:Id.VSub_Name val:cookbook span_id:509) suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{(' *')}) ) (Id.Lit_Star '*') (.tar.gz) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_f child: { (braced_var_sub token: (Token id:Id.VSub_Name val:cookbook span_id:524) suffix_op: (suffix_op.Unary op_id: Id.VOp1_Percent arg_word: {(' *')} ) ) (.patch) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:531) ) ] action: [ (C {(pushd)} { (braced_var_sub token: (Token id:Id.VSub_Name val:cookbook span_id:539) suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{(' *')}) ) } ) (command.Simple words: [{(patch)} {(-p1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:549) fd: -1 arg_word: {(../) (braced_var_sub token: (Token id:Id.VSub_Name val:cookbook span_id:553) suffix_op: (suffix_op.Unary op_id: Id.VOp1_Percent arg_word: {(' *')} ) ) (.patch) } ) ] ) (C {(popd)}) ] spids: [517 533] ) ] ) ] spids: [454 471] ) ] ) ] ) ) ] )