1 Reply Latest reply on Mar 22, 2018 5:22 AM by ymichalak

    [vRA 7.3] - BMC EPIagent Custom Properties to Make Software Jobs Available

    ymichalak Enthusiast

      Hi team,

       

      we have create "Properties Groups" for BMC EPIagent.

       

      In the documentation here, page 55 is said :

       

      Specifies a software job or policy to be applied to all machines provisioned from the blueprint. Set the value to job_type=job_path, where job_type  is the numeral that represents the BMC BladeLogic job type and job_path is the location of the job in BMC BladeLogic, for example 4=/Utility/putty. NNNN is a number from 1000 to 1999. The first property must start with 1000 and increment in numerical order for each additional property

       

      Ok this is done with the "Properties Group" :

       

      "Vrm.Software.Id1000" = "2=/ASSET/DEV/Windows/EMEA_Baseline/ASSET-Win_Finalization_DC4";

      "Vrm.Software.Id1001" = "4=/ASSET/DEV/Windows/EMEA_Baseline/Office/2016/Office_2016_64_bits";

      Now we want to deploy Vrm.Software.Id1000 in FIRST and after the software Vrm.Software.Id1001, etc.......

       

      Actually Vrm.Software.Id1001 is always deployed in FIRST.

      Of course we have tried to invert the numbers but the Office Package is always the first to be installed

      Do you know how we can force the installation order of BMC Bladelogic Packages with the EPIPowershell agent ?

       

      Thx for your help ...Have a Nice Week

        • 1. Re: [vRA 7.3] - BMC EPIagent Custom Properties to Make Software Jobs Available
          ymichalak Enthusiast

          Ok now works......

          It's necessary to UPDATE InstallSoftware.ps1 file.

          We have changed these lines :

           

          $softwareList = @{}

              foreach ($a in $dict.Keys) {

                  #Check for import flag

                  if ( ($a.StartsWith("bmc.import")) -and ($import.Equals("false")) ) {

                  $import = "true"

                  }

           

           

                  if ( $a.StartsWith("vrm.software")) {

                      [string[]] $strSplit = [regex]::split($dict[$a], "[.*/]")

                     

                      #Get the Batch Job Name

                      $softwareBatch = $strSplit[$strSplit.Length -1].Replace("`"","")

                     

                      #Get the Batch Location

                      $softwareLocation = $dict[$a].Replace($softwareBatch,"").Replace("`"","")

                     

                      if ( $softwareLocation -eq $null ) {

                          $softwareLocation = "/"

                      } elseif ($softwareLocation.EndsWith("/")) {

                          $softwareLocation = $softwareLocation.TrimEnd("/")

                      }

                     

                      #Add quotes back to properties

                      $softwareLocation = "{0}$softwareLocation{1}" -f ("`"","`"")

                      $softwareBatch = "{0}$softwareBatch{1}" -f ("`"","`"")

                     

                      #Add to the Software Hashtable

                      if ( $softwareBatch.Contains("License Server") ) {

                          $licList.Add($softwareBatch, $softwareLocation)

                      } else {

                          $softwareList.Add($softwareBatch, $softwareLocation)

                      }

                  }

              }

           

           

          for this :

           

          $tempList = [ordered]@{}

          $softwareList = [ordered]@{}

              foreach ($a in $dict.Keys) {

                  #Check for import flag

                  if ( ($a.StartsWith("bmc.import")) -and ($import.Equals("false")) ) {

                  $import = "true"

                  }

           

                  #extracting the BL jobs to play

                  if ( $a.StartsWith("vrm.software")) {

                      $tempList.Add($a, $dict[$a])

                      $tempList

                  }

              }

           

              #ordering the job list using the key

              $tempList = $tempList.GetEnumerator() | Sort-Object -Property name

              write "list"

              write $tempList

              write "keys"

              write $tempList.Keys

              write "type"

              write $tempList.GetType()

             

              #playing magic as before

              foreach ($b in $tempList){

                  write "loop"

                  write $b

                  write $b.key

                  write $b.value

                  if ( $b.key.StartsWith("vrm.software")) {

                      [string[]] $strSplit = [regex]::split($b.value, "[.*/]")

                     

                      #Get the Batch Job Name

                      $softwareBatch = $strSplit[$strSplit.Length -1].Replace("`"","")

                     

                      #Get the Batch Location

                      $softwareLocation = $b.value.Replace($softwareBatch,"").Replace("`"","")

                     

                      if ( $softwareLocation -eq $null ) {

                          $softwareLocation = "/"

                      } elseif ($softwareLocation.EndsWith("/")) {

                          $softwareLocation = $softwareLocation.TrimEnd("/")

                      }

                     

                      #Add quotes back to properties

                      $softwareLocation = "{0}$softwareLocation{1}" -f ("`"","`"")

                      $softwareBatch = "{0}$softwareBatch{1}" -f ("`"","`"")

                     

                      #Add to the Software Hashtable

                      if ( $softwareBatch.Contains("License Server") ) {

                          $licList.Add($softwareBatch, $softwareLocation)

                      } else {

                          $softwareList.Add($softwareBatch, $softwareLocation)

                      }

                  }

              }