vagrant-registration 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,90 @@
1
+ # Generated from vagrant-registration-0.0.11.gem by gem2rpm -*- rpm-spec -*-
2
+ %global gem_name vagrant-registration
3
+
4
+ Name: rubygem-%{gem_name}
5
+ Version: 0.0.11
6
+ Release: 1%{?dist}
7
+ Summary: Enables guests to have a registration capability
8
+ Group: Development/Languages
9
+ License: GPL-2.0
10
+ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
11
+ BuildRequires: ruby(release)
12
+ BuildRequires: rubygems-devel >= 1.3.6
13
+ BuildRequires: ruby
14
+ # BuildRequires: rubygem(yard)
15
+ BuildArch: noarch
16
+ ###$$$$$$$$$$$$$$$$$
17
+ Requires: ruby(rubygems) >= 1.3.6
18
+
19
+ BuildRequires: ruby
20
+ BuildRequires: rubygems-devel >= 1.3.6
21
+ # BuildRequires: rubygem(yard)
22
+ ###$$$$$$$$$$$$$$$$$
23
+
24
+ %description
25
+ Enables guests to have a registration capability, this is expecially useful on
26
+ RHEL or SLES.
27
+
28
+
29
+ %package doc
30
+ Summary: Documentation for %{name}
31
+ Group: Documentation
32
+ Requires: %{name} = %{version}-%{release}
33
+ BuildArch: noarch
34
+
35
+ %description doc
36
+ Documentation for %{name}.
37
+
38
+ %prep
39
+ gem unpack %{SOURCE0}
40
+
41
+ %setup -q -D -T -n %{gem_name}-%{version}
42
+
43
+ gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
44
+
45
+ %build
46
+ # Create the gem as gem install only works on a gem file
47
+ gem build %{gem_name}.gemspec
48
+
49
+ # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
50
+ # by default, so that we can move it into the buildroot in %%install
51
+ %gem_install
52
+
53
+ %install
54
+ mkdir -p %{buildroot}%{gem_dir}
55
+ cp -a .%{gem_dir}/* \
56
+ %{buildroot}%{gem_dir}/
57
+
58
+
59
+
60
+
61
+ # Run the test suite
62
+ %check
63
+ pushd .%{gem_instdir}
64
+
65
+ popd
66
+
67
+ %files
68
+ %dir %{gem_instdir}
69
+ %exclude %{gem_instdir}/.gitignore
70
+ %license %{gem_instdir}/LICENSE.md
71
+ %{gem_instdir}/dummy.box
72
+ %{gem_libdir}
73
+ %{gem_instdir}/plugins
74
+ %exclude %{gem_cache}
75
+ %{gem_spec}
76
+
77
+ %files doc
78
+ %doc %{gem_docdir}
79
+ %doc %{gem_instdir}/CHANGELOG.md
80
+ %{gem_instdir}/Gemfile
81
+ %doc %{gem_instdir}/README.md
82
+ %{gem_instdir}/Rakefile
83
+ %{gem_instdir}/Vagrantfile
84
+ %doc %{gem_instdir}/doc
85
+ %{gem_instdir}/tests
86
+ %{gem_instdir}/vagrant-registration.gemspec
87
+
88
+ %changelog
89
+ * Mon Apr 27 2015 Josef Stribny <jstribny@redhat.com> - 0.0.11-1
90
+ - Initial package
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-registration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Langdon White
@@ -9,8 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-08 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2015-05-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: yard
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
14
28
  description: Enables guests to have a registration capability, this is expecially
15
29
  useful on RHEL or SLES
16
30
  email: langdon@fedoraproject.org
@@ -25,17 +39,55 @@ files:
25
39
  - README.md
26
40
  - Rakefile
27
41
  - Vagrantfile
42
+ - doc/VagrantPlugins.html
43
+ - doc/VagrantPlugins/GuestFedora.html
44
+ - doc/VagrantPlugins/GuestFedora/Cap.html
45
+ - doc/VagrantPlugins/GuestFedora/Cap/ChangeHostName.html
46
+ - doc/VagrantPlugins/GuestFedora/Cap/ConfigureNetworks.html
47
+ - doc/VagrantPlugins/GuestFedora/Cap/Flavor.html
48
+ - doc/VagrantPlugins/GuestFedora/Cap/NFSClient.html
49
+ - doc/VagrantPlugins/GuestFedora/Cap/NetworkScriptsDir.html
50
+ - doc/VagrantPlugins/GuestFedora/Guest.html
51
+ - doc/VagrantPlugins/GuestFedora/Plugin.html
52
+ - doc/VagrantPlugins/GuestRedHat.html
53
+ - doc/VagrantPlugins/GuestRedHat/Cap.html
54
+ - doc/VagrantPlugins/GuestRedHat/Cap/RedHatCertification.html
55
+ - doc/VagrantPlugins/GuestRedHat/Cap/Register.html
56
+ - doc/VagrantPlugins/GuestRedHat/Cap/SubscriptionManager.html
57
+ - doc/VagrantPlugins/GuestRedHat/Cap/Unregister.html
58
+ - doc/VagrantPlugins/GuestRedHat/Plugin.html
59
+ - doc/VagrantPlugins/Registration.html
60
+ - doc/VagrantPlugins/Registration/Action.html
61
+ - doc/VagrantPlugins/Registration/Action/Register.html
62
+ - doc/VagrantPlugins/Registration/Action/Unregister.html
63
+ - doc/VagrantPlugins/Registration/Config.html
64
+ - doc/VagrantPlugins/Registration/Errors.html
65
+ - doc/VagrantPlugins/Registration/Errors/RegisterError.html
66
+ - doc/VagrantPlugins/Registration/Errors/UnregisterError.html
67
+ - doc/VagrantPlugins/Registration/Errors/VagrantRHELError.html
68
+ - doc/VagrantPlugins/Registration/Plugin.html
69
+ - doc/_index.html
70
+ - doc/class_list.html
71
+ - doc/css/common.css
72
+ - doc/css/full_list.css
73
+ - doc/css/style.css
74
+ - doc/file.README.html
75
+ - doc/file_list.html
76
+ - doc/frames.html
77
+ - doc/index.html
78
+ - doc/js/app.js
79
+ - doc/js/full_list.js
80
+ - doc/js/jquery.js
81
+ - doc/method_list.html
82
+ - doc/top-level-namespace.html
28
83
  - dummy.box
29
84
  - lib/vagrant-registration.rb
30
85
  - lib/vagrant-registration/action.rb
31
86
  - lib/vagrant-registration/action/register.rb
32
87
  - lib/vagrant-registration/action/unregister.rb
33
88
  - lib/vagrant-registration/config.rb
34
- - lib/vagrant-registration/env.rb
35
- - lib/vagrant-registration/errors.rb
36
89
  - lib/vagrant-registration/plugin.rb
37
90
  - lib/vagrant-registration/version.rb
38
- - locales/en.yml
39
91
  - plugins/guests/fedora/cap/change_host_name.rb
40
92
  - plugins/guests/fedora/cap/configure_networks.rb
41
93
  - plugins/guests/fedora/cap/flavor.rb
@@ -44,15 +96,15 @@ files:
44
96
  - plugins/guests/fedora/guest.rb
45
97
  - plugins/guests/fedora/plugin.rb
46
98
  - plugins/guests/redhat/cap/redhat_certification_tool.rb
47
- - plugins/guests/redhat/cap/register.rb
99
+ - plugins/guests/redhat/cap/registration.rb
48
100
  - plugins/guests/redhat/cap/subscription_manager.rb
49
- - plugins/guests/redhat/cap/unregister.rb
50
101
  - plugins/guests/redhat/plugin.rb
51
- - tests/shell-scripts/test-rhel-eco-ident/Vagrantfile.centos
52
- - tests/shell-scripts/test-rhel-eco-ident/Vagrantfile.fedora
53
- - tests/shell-scripts/test-rhel-eco-ident/Vagrantfile.rhel
54
- - tests/shell-scripts/test-rhel-eco-ident/test-identification.sh
102
+ - tests/helpers.sh
103
+ - tests/run.sh
104
+ - tests/vagrantfiles/Vagrantfile.rhel_multi_machine
105
+ - tests/vagrantfiles/Vagrantfile.rhel_wrong_credentials
55
106
  - vagrant-registration.gemspec
107
+ - vagrant-registration.spec
56
108
  homepage:
57
109
  licenses:
58
110
  - GPL-2.0
@@ -1,21 +0,0 @@
1
- require "vagrant"
2
-
3
- module VagrantPlugins
4
- module Registration
5
- class Config < Vagrant.plugin("2", :config)
6
-
7
- # @return [Vagrant::UI::Colored]
8
- attr_accessor :ui
9
-
10
- def initialize(region_specific=false)
11
- vagrant_version = Gem::Version.new(::Vagrant::VERSION)
12
- if vagrant_version >= Gem::Version.new("1.5")
13
- @ui = ::Vagrant::UI::Colored.new
14
- @ui.opts[:target] = 'Registration'
15
- elsif vagrant_version >= Gem::Version.new("1.2")
16
- @ui = ::Vagrant::UI::Colored.new.scope('Registration')
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,19 +0,0 @@
1
- require "vagrant"
2
-
3
- module VagrantPlugins
4
- module Registration
5
- module Errors
6
- class VagrantRHELError < Vagrant::Errors::VagrantError
7
- error_namespace("vagrant_registration.errors")
8
- end
9
-
10
- class RegisterError < VagrantRegistrationError
11
- error_key(:register)
12
- end
13
-
14
- class UnregisterError < VagrantRegistrationError
15
- error_key(:unregister)
16
- end
17
- end
18
- end
19
- end
data/locales/en.yml DELETED
@@ -1,2 +0,0 @@
1
- en:
2
- #currently unsupported, a placeholder
@@ -1,33 +0,0 @@
1
- module VagrantPlugins
2
- module GuestRedHat
3
- module Cap
4
- class Register
5
- def self.register(machine)
6
- command = "subscription-manager register #{configuration_to_options(machine.config)}"
7
- machine.communicate.execute("cmd=$(#{command}); if [ \"$?\" != \"0\" ]; then echo $cmd | grep 'This system is already registered' || (echo $cmd 1>&2 && exit 1) ; fi", sudo: true)
8
- end
9
-
10
- private
11
-
12
- # Build additional subscription-manager options based on plugin configuration
13
- def self.configuration_to_options(config)
14
- options = []
15
- options << "--username=#{config.registration.username}"
16
- options << "--password=#{config.registration.password}"
17
- options << "--serverurl=#{config.registration.serverurl}" if config.registration.serverurl
18
- options << "--baseurl=#{config.registration.baseurl}" if config.registration.baseurl
19
- options << "--org=#{config.registration.org}" if config.registration.org
20
- options << "--environment=#{config.registration.environment}" if config.registration.environment
21
- options << "--name=#{config.registration.name}" if config.registration.name
22
- options << "--auto-attach" if config.registration.auto_attach
23
- options << "--activationkey=#{config.registration.activationkey}" if config.registration.activationkey
24
- options << "--servicelevel=#{config.registration.servicelevel}" if config.registration.servicelevel
25
- options << "--release=#{config.registration.release}" if config.registration.release
26
- options << "--force" if config.registration.force
27
- options << "--type=#{config.registration.type}" if config.registration.type
28
- options.join(' ')
29
- end
30
- end
31
- end
32
- end
33
- end
@@ -1,11 +0,0 @@
1
- module VagrantPlugins
2
- module GuestRedHat
3
- module Cap
4
- class Unregister
5
- def self.unregister(machine)
6
- machine.communicate.execute("subscription-manager unregister || :", sudo: true)
7
- end
8
- end
9
- end
10
- end
11
- end
@@ -1,14 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- Vagrant.configure('2') do |config|
5
- # Example configuration of new VM..
6
- config.vm.define :vagrant_ident_centos do |vagrant_host|
7
- # Box name
8
- vagrant_host.vm.box = 'gildub/fedora20'
9
- vagrant_host.vm.hostname = "vagrant_centos_ident_test"
10
-
11
- config.vm.synced_folder ".", "/vagrant", type: "rsync",
12
- rsync__exclude: [ ".git/", ".#*", "*~" ]
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- Vagrant.configure('2') do |config|
5
- # Example configuration of new VM..
6
- config.vm.define :vagrant_ident_fedora do |vagrant_host|
7
- # Box name
8
- vagrant_host.vm.box = 'gildub/fedora20'
9
- vagrant_host.vm.hostname = "vagrant_fedora_ident_test"
10
-
11
- config.vm.synced_folder ".", "/vagrant", type: "rsync",
12
- rsync__exclude: [ ".git/", ".#*", "*~" ]
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- Vagrant.configure('2') do |config|
5
- # Example configuration of new VM..
6
- config.vm.define :vagrant_ident_rhel do |vagrant_host|
7
- # Box name
8
- vagrant_host.vm.box = 'rhel-7.0'
9
- vagrant_host.vm.hostname = "vagrant_rhel_ident_test"
10
-
11
- config.vm.synced_folder ".", "/vagrant", type: "rsync",
12
- rsync__exclude: [ ".git/", ".#*", "*~" ]
13
- end
14
- end
@@ -1,114 +0,0 @@
1
- #!/bin/bash
2
-
3
- export PATH="/bin:/usr/bin"
4
- STATUS=0
5
-
6
- echo "get the plugin installed"
7
- vagrant plugin install vagrant-registration
8
-
9
- echo "do we have any plugins now?"
10
- exec 5>&1 && OUTPUT=$(vagrant plugin list | tee >(cat - >&5))
11
- if [ $? -ne 0 ]; then
12
- STATUS=$?
13
- echo "No plugins at all: Vagrant plugin test FAILED"
14
- exit $STATUS
15
- fi
16
-
17
- echo "do we have the vagrant-registration plugin?"
18
- TEST=$(echo "$OUTPUT" | grep vagrant-registration)
19
- STATUS=$?
20
- if [ -z "$TEST" ]; then
21
- echo "Plugin vagrant-registration did not get installed: Vagrant plugin test FAILED"
22
- echo "Output of vagrant plugin list:\n$OUTPUT\n"
23
- echo "Result of \"echo \$OUTPUT | grep vagrant-registration\":\n$TEST\n"
24
- exit $STATUS
25
- fi
26
-
27
- echo "let's start with the fedora vagrantfile"
28
- rm ./Vagrantfile
29
- ln -s ./Vagrantfile.fedora ./Vagrantfile
30
-
31
- echo "let's try and bring the machine up"
32
- exec 5>&1 && OUTPUT=$(vagrant up | tee >(cat - >&5))
33
- STATUS=$?
34
- if [ $? -ne 0 ]; then
35
- echo "Failed to bring up the machine: Launch FAILED"
36
- exit $STATUS
37
- fi
38
-
39
- echo "let's test that we can connect"
40
- OUTPUT=$(vagrant ssh -c 'echo \"connected!\"' | tee >(cat - >&5))
41
- STATUS=$?
42
- TEST=$(echo "$OUTPUT" | grep connected)
43
- if [ -z "$TEST" ]; then
44
- echo "Failed to connect to the machine: connect FAILED"
45
- exit $STATUS
46
- fi
47
-
48
- echo "time to clean up fedora box"
49
- vagrant destroy -f
50
- rm -rf .vagrant.d Vagrantfile
51
-
52
- echo "let's try the rhel box"
53
- rm ./Vagrantfile
54
- ln -s ./Vagrantfile.rhel ./Vagrantfile
55
-
56
- echo "let's try and bring the machine up"
57
- exec 5>&1 && OUTPUT=$(vagrant up | tee >(cat - >&5))
58
- STATUS=$?
59
- if [ $? -ne 0 ]; then
60
- echo "Failed to bring up the machine: Launch FAILED"
61
- exit $STATUS
62
- fi
63
-
64
- echo "let's test that we can connect"
65
- OUTPUT=$(vagrant ssh -c 'echo \"connected!\"' | tee >(cat - >&5))
66
- STATUS=$?
67
- TEST=$(echo "$OUTPUT" | grep connected)
68
- if [ -z "$TEST" ]; then
69
- echo "Failed to connect to the machine: connect FAILED"
70
- exit $STATUS
71
- fi
72
-
73
- echo "let's test that we are subscribed"
74
- OUTPUT=$(vagrant ssh -c 'sudo subscription-manager status' | tee >(cat - >&5))
75
- STATUS=$?
76
- TEST=$(echo "$OUTPUT" | grep Current)
77
- if [ -z "$TEST" ]; then
78
- echo "We are not subscribed: subscribe FAILED"
79
- exit $STATUS
80
- fi
81
-
82
- echo "time to clean up rhel box"
83
- vagrant destroy -f
84
- rm -rf .vagrant.d Vagrantfile
85
-
86
- echo "test implementation incomplete"
87
- exit;
88
-
89
- echo "let's try the centos box"
90
- rm ./Vagrantfile
91
- ln -s ./Vagrantfile.centos ./Vagrantfile
92
-
93
- echo "let's try and bring the machine up"
94
- exec 5>&1 && OUTPUT=$(vagrant up | tee >(cat - >&5))
95
- STATUS=$?
96
- if [ $? -ne 0 ]; then
97
- echo "Failed to bring up the machine: Launch FAILED"
98
- exit $STATUS
99
- fi
100
-
101
- echo "let's test that we can connect"
102
- OUTPUT=$(vagrant ssh -c 'echo \"connected!\"' | tee >(cat - >&5))
103
- STATUS=$?
104
- TEST=$(echo "$OUTPUT" | grep connected)
105
- if [ -z "$TEST" ]; then
106
- echo "Failed to connect to the machine: connect FAILED"
107
- exit $STATUS
108
- fi
109
-
110
- echo "time to clean up rhel box"
111
- vagrant destroy -f
112
- rm -rf .vagrant.d Vagrantfile
113
-
114
- echo "tests complete!"