(command.CommandList
  children: [
    (C {<Id.KW_Set set>} {<-e>})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: 
                        {
                          (DQ 
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              command_list: (command.CommandList children:[(C {<pwd>})])
                            )
                          )
                        }
                      right: 
                        {
                          (DQ 
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              command_list: 
                                (command.CommandList
                                  children: [(C {<git>} {<rev-parse>} {<--show-toplevel>})]
                                )
                            )
                          )
                        }
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.Simple
              words: [
                {<printf>}
                {(SQ <'#### WARNING: This should be run in the git top level directory! ####\\n'>)}
              ]
              redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{</dev/stderr>})]
            )
          ]
          spids: [28 53]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ENVIRONMENT)
          op: assign_op.Equal
          rhs: {<Test-Laptop>}
          spids: [69]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PROXY)
          op: assign_op.Equal
          rhs: {<proxy.example.com> <Id.Lit_Other ':'> <80>}
          spids: [72]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DNS_SERVERS)
          op: assign_op.Equal
          rhs: {(SQ <'"8.8.8.8", "8.8.4.4"'>)}
          spids: [77]
        )
      ]
    )
    (C {<export>} {<Id.Lit_VarLike 'BOOTSTRAP_VM_MEM='> <3096>})
    (C {<export>} {<Id.Lit_VarLike 'BOOTSTRAP_VM_CPUs='> <2>})
    (C {<export>} {<Id.Lit_VarLike 'CLUSTER_VM_MEM='> <5120>})
    (C {<export>} {<Id.Lit_VarLike 'CLUSTER_VM_CPUs='> <4>})
    (C {<printf>} {(DQ <'#### Setup configuration files'> <Id.Lit_Other '\\'> <n>)})
    (C {<sed>} {<-i>} {(SQ <'s/vb.gui = true/vb.gui = false/'>)} {<Vagrantfile>})
    (C {<sed>} {<-i>} 
      {
        (DQ <'s/#export PROXY=.*'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
          <'/export PROXY='> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$PROXY') 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) </>
        )
      } {<proxy_setup.sh>}
    )
    (C {<sed>} {<-i>} 
      {
        (DQ <s/> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <dns_servers> 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' : '> <Id.Lit_Other '\\'> <'[ '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <8.8.8.8> 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <', '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <8.8.4.4> 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' '> <Id.Lit_Other '\\'> <']/'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
          <dns_servers> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' : '> <Id.Lit_Other '\\'> <'[ '> 
          ($ Id.VSub_DollarName '$DNS_SERVERS') <' '> <Id.Lit_Other '\\'> <']/'>
        )
      } {<environments/> (${ Id.VSub_Name ENVIRONMENT) <.json>}
    )
    (C {<sed>} {<-i>} 
      {
        (DQ <'s#'> <Id.Lit_Other '\\'> <'('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
          <bootstrap> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <': {'> <Id.Lit_Other '\\'> <')#'> 
          <Id.Lit_Other '\\'> <1> <Id.Lit_Other '\\'> <n> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <proxy> 
          (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' : '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <'http://'> 
          ($ Id.VSub_DollarName '$PROXY') (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <','> <Id.Lit_Other '\\'> <'n#'>
        )
      } {<environments/> (${ Id.VSub_Name ENVIRONMENT) <.json>}
    )
    (C {<printf>} {(DQ <"#### Setup VB's and Bootstrap"> <Id.Lit_Other '\\'> <n>)})
    (C {<source>} {<./vbox_create.sh>})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<download_VM_files>})
        (command.Subshell
          command_list: 
            (command.CommandList
              children: [
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (C {<echo>} 
                      {
                        (DQ <'############## VBOX DOWNLOAD VM FILES RETURNED '> ($ Id.VSub_QMark '$?') 
                          <' ##############'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                )
              ]
            )
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<create_bootstrap_VM>})
        (command.Subshell
          command_list: 
            (command.CommandList
              children: [
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (C {<echo>} 
                      {
                        (DQ <'############## VBOX CREATE BOOTSTRAP VM RETURNED '> 
                          ($ Id.VSub_QMark '$?') <' ##############'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                )
              ]
            )
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<create_cluster_VMs>})
        (command.Subshell
          command_list: 
            (command.CommandList
              children: [
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (C {<echo>} 
                      {
                        (DQ <'############## VBOX CREATE CLUSTER VMs RETURNED '> 
                          ($ Id.VSub_QMark '$?') <' ##############'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                )
              ]
            )
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<install_cluster>})
        (command.Subshell
          command_list: 
            (command.CommandList
              children: [
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (C {<echo>} 
                      {
                        (DQ <'############## bootstrap_chef.sh returned '> ($ Id.VSub_QMark '$?') 
                          <' ##############'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                )
              ]
            )
        )
      ]
    )
    (C {<printf>} {(DQ <'#### Cobbler Boot'> <Id.Lit_Other '\\'> <n>)})
    (C {<printf>} 
      {(DQ <'Snapshotting pre-Cobbler and booting (unless already running)'> <Id.Lit_Other '\\'> <n>)}
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:vms_started)
          op: assign_op.Equal
          rhs: {(DQ <False>)}
          spids: [344]
        )
      ]
    )
    (command.ForEach
      iter_name: i
      iter_words: [{<1>} {<2>} {<3>}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Pipeline
                  children: [
                    (C {<vboxmanage>} {<showvminfo>} {<bcpc-vm> ($ Id.VSub_DollarName '$i')})
                    (C {<grep>} {<-q>} {(SQ <'^State:.*running'>)})
                  ]
                  negated: F
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:vms_started)
                      op: assign_op.Equal
                      rhs: {(DQ <True>)}
                      spids: [384]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Pipeline
                  children: [
                    (C {<vboxmanage>} {<showvminfo>} {<bcpc-vm> ($ Id.VSub_DollarName '$i')})
                    (C {<grep>} {<-q>} {(SQ <'^State:.*running'>)})
                  ]
                  negated: F
                )
                (C {<VBoxManage>} {<snapshot>} {<bcpc-vm> ($ Id.VSub_DollarName '$i')} {<take>} 
                  {<Shoe-less>}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Pipeline
                  children: [
                    (C {<vboxmanage>} {<showvminfo>} {<bcpc-vm> ($ Id.VSub_DollarName '$i')})
                    (C {<grep>} {<-q>} {(SQ <'^State:.*running'>)})
                  ]
                  negated: F
                )
                (C {<VBoxManage>} {<startvm>} {<bcpc-vm> ($ Id.VSub_DollarName '$i')} {<--type>} 
                  {<headless>}
                )
              ]
            )
          ]
        )
    )
    (C {<printf>} {(DQ <'Checking VMs are up: '> <Id.Lit_Other '\\'> <n>)})
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: [
        (command.AndOr
          ops: [Id.Op_DPipe Id.Op_DPipe]
          children: [
            (command.Pipeline
              children: [(C {<nc>} {<-w>} {<1>} {<-q>} {<0>} {<10.0.100.11>} {<22>})]
              negated: T
            )
            (command.Pipeline
              children: [(C {<nc>} {<-w>} {<1>} {<-q>} {<0>} {<10.0.100.12>} {<22>})]
              negated: T
            )
            (command.Pipeline
              children: [(C {<nc>} {<-w>} {<1>} {<-q>} {<0>} {<10.0.100.13>} {<22>})]
              negated: T
            )
          ]
        )
      ]
      body: 
        (command.DoGroup
          children: [
            (C {<sleep>} {<60>})
            (C {<printf>} {(DQ <'Hosts down: '>)})
            (command.ForEach
              iter_name: m
              iter_words: [{<11>} {<12>} {<13>}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.Simple
                          words: [
                            {<nc>}
                            {<-w>}
                            {<1>}
                            {<-q>}
                            {<0>}
                            {<10.0.100.> ($ Id.VSub_DollarName '$m')}
                            {<22>}
                          ]
                          redirects: [
                            (redir.Redir
                              op: <Id.Redir_Great '>'>
                              fd: -1
                              arg_word: {</dev/null>}
                            )
                          ]
                        )
                        (C {<echo>} {<-n>} {(DQ <10.0.100.> ($ Id.VSub_DollarName '$m') <' '>)})
                      ]
                    )
                  ]
                )
            )
            (C {<printf>} {(DQ <Id.Lit_Other '\\'> <n>)})
          ]
        )
    )
    (C {<printf>} {(DQ <'Snapshotting post-Cobbler'> <Id.Lit_Other '\\'> <n>)})
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DBracket
          expr: 
            (bool_expr.Binary
              op_id: Id.BoolBinary_GlobDEqual
              left: {(DQ ($ Id.VSub_DollarName '$vms_started'))}
              right: {(DQ <True>)}
            )
        )
        (C {<VBoxManage>} {<snapshot>} {<bcpc-vm1>} {<take>} {<Post-Cobble>})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DBracket
          expr: 
            (bool_expr.Binary
              op_id: Id.BoolBinary_GlobDEqual
              left: {(DQ ($ Id.VSub_DollarName '$vms_started'))}
              right: {(DQ <True>)}
            )
        )
        (C {<VBoxManage>} {<snapshot>} {<bcpc-vm2>} {<take>} {<Post-Cobble>})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DBracket
          expr: 
            (bool_expr.Binary
              op_id: Id.BoolBinary_GlobDEqual
              left: {(DQ ($ Id.VSub_DollarName '$vms_started'))}
              right: {(DQ <True>)}
            )
        )
        (C {<VBoxManage>} {<snapshot>} {<bcpc-vm3>} {<take>} {<Post-Cobble>})
      ]
    )
    (C {<printf>} {(DQ <'#### Chef all the nodes'> <Id.Lit_Other '\\'> <n>)})
    (C {<vagrant>} {<ssh>} {<-c>} {(DQ <'sudo apt-get install -y sshpass'>)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:cobbler_pass)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                command_list: 
                  (command.CommandList
                    children: [
                      (C {<vagrant>} {<ssh>} {<-c>} 
                        {
                          (DQ <'cd chef-bcpc; knife data bag show configs '> 
                            ($ Id.VSub_DollarName '$ENVIRONMENT') <" | grep 'cobbler-root-password:'|sed 's/.* //'">
                          )
                        }
                      )
                    ]
                  )
              )
            }
          spids: [702]
        )
      ]
    )
    (C {<printf>} {(DQ <'#### Chef the first headnode(s)'> <Id.Lit_Other '\\'> <n>)})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.Pipeline
                  children: [
                    (C {<vagrant>} {<ssh>} {<-c>} 
                      {
                        (DQ <'cd chef-bcpc; ./cluster-assign-roles.sh '> 
                          ($ Id.VSub_DollarName '$ENVIRONMENT') <' bcpc-vm1'>
                        )
                      }
                    )
                  ]
                  negated: T
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (C {<printf>} {(DQ <'## set the first machine to admin'> <Id.Lit_Other '\\'> <n>)})
            (C {<vagrant>} {<ssh>} {<-c>} 
              {
                (SQ 
                  <
'cd chef-bcpc; echo -e "/\\"admin\\": false\\ns/false/true\\nw\\nq\\n" | EDITOR=ed knife client edit `knife client list | grep bcpc-vm1`'
                  >
                )
              }
            )
            (C {<vagrant>} {<ssh>} {<-c>} 
              {
                (DQ <'cd chef-bcpc; echo '> ($ Id.VSub_DollarName '$cobbler_pass') 
                  <' | sudo knife bootstrap -E '> ($ Id.VSub_DollarName '$ENVIRONMENT') <" -r 'role[BCPC-Headnode]' 10.0.100.11 -x ubuntu --sudo">
                )
              }
            )
          ]
          spids: [726 743]
        )
      ]
    )
    (command.ForEach
      iter_name: i
      iter_words: [{<2>} {<3>}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<printf>} {(DQ <'## Machine bcpc-vm'> (${ Id.VSub_Name i) <Id.Lit_Other '\\'> <n>)})
            (C {<vagrant>} {<ssh>} {<-c>} 
              {
                (DQ <'cd chef-bcpc; ./cluster-assign-roles.sh '> ($ Id.VSub_DollarName '$ENVIRONMENT') 
                  <' bcpc-vm'> ($ Id.VSub_DollarName '$i')
                )
              }
            )
          ]
        )
    )
    (C {<printf>} {(DQ <'Snapshotting post-Cobbler'> <Id.Lit_Other '\\'> <n>)})
    (C {<VBoxManage>} {<snapshot>} {<bcpc-vm1>} {<take>} {<Full-Shoes>})
    (C {<VBoxManage>} {<snapshot>} {<bcpc-vm2>} {<take>} {<Full-Shoes>})
    (C {<VBoxManage>} {<snapshot>} {<bcpc-vm3>} {<take>} {<Full-Shoes>})
  ]
)