Permalink
Browse files

Fixed subscription-manager registration for rhel-7

Subscription manager was set to execute even if no username & password is set.
I've moved subscription-manager commands under an if check to verify that a username & password is in fact set.
  • Loading branch information...
1 parent 80609d7 commit 3f03325bc4b7866e108d8aec1f4ef4ad6af5e359 @johbro johbro committed with johbro Aug 13, 2015
Showing with 8 additions and 9 deletions.
  1. +8 −9 vagrant/Vagrantfile
View
@@ -1009,17 +1009,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if vm.vm.box.start_with? 'rhel-' or vm.vm.box.start_with? 'atomic-rhel-'
if username != '' and password != ''
vm.vm.provision 'shell', inline: "subscription-manager register --username=#{username} --password=#{password}"
- end
- # attach correct pools
- if vm_poolid.is_a?(Array)
- vm_poolid.each do |j|
- vm.vm.provision 'shell', inline: "subscription-manager attach --pool=#{j}"
+ # attach correct pools
+ if vm_poolid.is_a?(Array)
+ vm_poolid.each do |j|
+ vm.vm.provision 'shell', inline: "subscription-manager attach --pool=#{j}"
+ end
+ elsif vm_poolid
+ # auto attach if value is true
+ vm.vm.provision 'shell', inline: 'subscription-manager attach --auto'
end
-
- elsif vm_poolid
- # auto attach if value is true
- vm.vm.provision 'shell', inline: 'subscription-manager attach --auto'
end
# enable particular repositories

0 comments on commit 3f03325

Please sign in to comment.