This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'optparse' | |
| require 'fileutils' | |
| options = {} | |
| optparse = OptionParser.new do |opts| | |
| opts.banner = """ | |
| This script is used to remove all Katello related packages and services. | |
| This should only be used if you are sure you are wanting to completly remove Katello from this machine and lose all of your settings and synced content.\n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app/models/compute_resources/foreman/model/vmware.rb b/app/models/compute_resources/foreman/model/vmware.rb | |
| index 58b6d9c..5bd8df3 100644 | |
| --- a/app/models/compute_resources/foreman/model/vmware.rb | |
| +++ b/app/models/compute_resources/foreman/model/vmware.rb | |
| @@ -447,10 +447,14 @@ module Foreman::Model | |
| args = parse_networks(args) | |
| args = args.with_indifferent_access | |
| if args[:provision_method] == 'image' | |
| + Rails.logger.error "VMW: args #{args.inspect}" | |
| clone_vm(args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Connect-VIServer -Server <vcenterfqdn> -User <adminuser> -Password <adminpassword> | |
| Write-Host "Gathering clusters and ESXi hosts" | |
| $sleep = 1 | |
| Get-Cluster | |
| Get-VMHost | Select Name, @{N="Cluster";E={Get-Cluster -VMHost $_}} | |
| Write-Host "------------Finish Cluster/ESXi collection--------" | |
| Write-Host "Gathering information on Distributed Switches" | |
| $sleep = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'fog' | |
| client = ::Fog::Compute.new( | |
| :provider => 'vsphere', | |
| :vsphere_username => '', | |
| :vsphere_password => '', | |
| :vsphere_server => '', | |
| :vsphere_expected_pubkey_hash => '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Connect-VIServer -Server vcenter.server.example.com -User admin_user -Password "password" | |
| Write-Host "Gathering clusters" | |
| Get-Cluster | |
| Get-Cluster | Get-ResourcePool | |
| $cluster = Get-Cluster "cluster_name" | Get-View | |
| $cluster | |
| $cluster.Configuration.DrsConfig | |
| $cluster.Configuration.DasConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $subnet24 = "10.10.1" | |
| 1..254 | | |
| foreach-object { | |
| $ip = $subnet24 + "." + $_ | |
| if (test-connection $ip -count 1 -quiet) { Write-Host "USED:$ip" } else { Write-Host "EMPT:$ip" } | |
| } | |
| #USED:10.10.2.1 | |
| #EMPT:10.10.2.2 |
NewerOlder