vagrant-atomic 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ae89fcd9e176e407d8a9904de9aeccc22688e12
4
- data.tar.gz: 75d69780dc27429a6011fffd193d07babbace82e
3
+ metadata.gz: ac48d4e6491035b1eaec1862db7610a1e1b93b49
4
+ data.tar.gz: cf51c03ef50adfd210b464178c872c33d586704a
5
5
  SHA512:
6
- metadata.gz: a30c23f402f5cdd2bdf46b35a70fdacd72053a282799a80b4e8b8aba8592039d5aa6f84d89170060c59b1e5bca1ddb4b5f6c9ef3b795d4644a3c7bbd2eb6125c
7
- data.tar.gz: f782d0fbf06939c5675c6fec5838499da64733f49bdace3939208d006593484b2eda27d8bd66765728fe03ef36a3fbc8d0188964d6222f5fda64b6d201c2886b
6
+ metadata.gz: a036bed19d81badb438ca45a869715ea3b6bc4c6f5503acc93501aa02988fd487b95532ad63cb90d6ba6285ec7694d36c236d5554761b5de1c811753f80019d1
7
+ data.tar.gz: 32f8035c3ed97d63d8c9f1100a28440a8510af21ce2eb74bb9700ad8726a3c1d37aa4cc15914d267a2ba22fd2fa1e8c0a64a78b622a5e842924a4df6645e2f7c
@@ -3,7 +3,6 @@ module VagrantPlugins
3
3
  module Cap
4
4
  module Docker
5
5
  def self.docker_daemon_running(machine)
6
- #not sure this is the best test, seems to always pass
7
6
  machine.communicate.test("test -S /run/docker.sock")
8
7
  end
9
8
  end
@@ -4,13 +4,7 @@ module VagrantPlugins
4
4
  module GuestAtomic
5
5
  class Guest < Vagrant.plugin("2", :guest)
6
6
  def detect?(machine)
7
- # For now we use this non 100% bullet proof solution.
8
- # Bugs issued to include word atomic in upstream releases
9
- # Centos: http://bugs.centos.org/view.php?id=8288
10
- # Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1200122
11
- #
12
- # machine.communicate.test("cat /etc/os-release | grep Atomic")
13
- machine.communicate.test("which rpm-ostree")
7
+ machine.communicate.test("grep 'ostree=' /proc/cmdline")
14
8
  end
15
9
  end
16
10
  end
@@ -10,7 +10,7 @@ module VagrantPlugins
10
10
  name "Atomic Host guest"
11
11
  description "Atomic Host guest support."
12
12
 
13
- guest("atomic", "redhat") do
13
+ guest("atomic", "fedora") do
14
14
  require File.expand_path("../guest", __FILE__)
15
15
  Guest
16
16
  end
@@ -0,0 +1,74 @@
1
+ begin
2
+ require 'vagrant'
3
+ rescue LoadError
4
+ raise 'The vagrant-atomic plugin must be run within Vagrant.'
5
+ end
6
+
7
+ module VagrantPlugins
8
+ module GuestAtomic
9
+ class Plugin < Vagrant.plugin("2")
10
+ name "Atomic Host guest"
11
+ description "Atomic Host guest support."
12
+
13
+ guest("atomic", "redhat") do
14
+ require File.expand_path("../", __FILE__)
15
+ Guest
16
+ end
17
+
18
+ guest_capability("atomic", "change_host_name") do
19
+ require_relative "cap/change_host_name"
20
+ Cap::ChangeHostName
21
+ end
22
+
23
+ guest_capability("atomic", "configure_networks") do
24
+ require_relative "cap/configure_networks"
25
+ Cap::ConfigureNetworks
26
+ end
27
+
28
+ guest_capability("atomic", "docker_daemon_running") do
29
+ require_relative "cap/docker"
30
+ Cap::Docker
31
+ end
32
+
33
+ # This sets up our log level to be whatever VAGRANT_LOG is
34
+ # for loggers prepended with 'vagrant_libvirt'
35
+ def self.setup_logging
36
+ require 'log4r'
37
+ level = nil
38
+ begin
39
+ level = Log4r.const_get(ENV['VAGRANT_LOG'].upcase)
40
+ rescue NameError
41
+ # This means that the logging constant wasn't found,
42
+ # which is fine. We just keep `level` as `nil`. But
43
+ # we tell the user.
44
+ level = nil
45
+ end
46
+ # Some constants, such as "true" resolve to booleans, so the
47
+ # above error checking doesn't catch it. This will check to make
48
+ # sure that the log level is an integer, as Log4r requires.
49
+ level = nil if !level.is_a?(Integer)
50
+ # Set the logging level on all "vagrant" namespaced
51
+ # logs as long as we have a valid level.
52
+ if level
53
+ logger = Log4r::Logger.new('vagrant_registration')
54
+ logger.outputters = Log4r::Outputter.stderr
55
+ logger.level = level
56
+ logger = nil
57
+ end
58
+ end
59
+
60
+ #shouldn't need these as I inherit
61
+ # guest_capability("atomic", "register") do
62
+ # require_relative "cap/register"
63
+ # Cap::Register
64
+ # end
65
+
66
+ # guest_capability("atomic", "unregister") do
67
+ # require_relative "cap/unregister"
68
+ # Cap::Unregister
69
+ # end
70
+
71
+
72
+ end
73
+ end
74
+ end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module GuestAtomic
3
- VERSION = "0.0.3"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -6,15 +6,13 @@ Gem::Specification.new do |s|
6
6
  s.version = VagrantPlugins::GuestAtomic::VERSION
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.license = "GPL-2.0"
9
- s.authors = ["Langdon White", "et al"]
9
+ s.authors = ["Langdon White", "Josef Strzibny", "et al"]
10
10
  s.email = "langdon@fedoraproject.org"
11
- s.summary = "Enables the Project Atomic OS (http://projectatomic.io) as a guest for vagrant"
12
- s.description = "Enables the Project Atomic OS (http://projectatomic.io) as a guest for vagrant. Tested with Fedora Atomic and RHEL Atomic"
13
-
11
+ s.summary = "Project Atomic guest for Vagrant"
12
+ s.description = "Adds the Project Atomic OS (http://projectatomic.io) as a guest for Vagrant. Tested with Fedora Atomic and RHEL Atomic."
13
+ s.homepage = "https://github.com/projectatomic/vagrant-atomic"
14
14
  s.required_rubygems_version = ">= 1.3.6"
15
- s.rubyforge_project = "vagrant-atomic"
16
15
 
17
- # this gemspec is, and parsing out the ignored files from the gitignore.
18
16
  # Note that the entire gitignore(5) syntax is not supported, specifically
19
17
  # the "!" syntax, but it should mostly work correctly.
20
18
  root_path = File.dirname(__FILE__)
metadata CHANGED
@@ -1,40 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-atomic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Langdon White
8
+ - Josef Strzibny
8
9
  - et al
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2015-03-11 00:00:00.000000000 Z
13
+ date: 2015-05-21 00:00:00.000000000 Z
13
14
  dependencies: []
14
- description: Enables the Project Atomic OS (http://projectatomic.io) as a guest for
15
- vagrant. Tested with Fedora Atomic and RHEL Atomic
15
+ description: Adds the Project Atomic OS (http://projectatomic.io) as a guest for Vagrant.
16
+ Tested with Fedora Atomic and RHEL Atomic.
16
17
  email: langdon@fedoraproject.org
17
18
  executables: []
18
19
  extensions: []
19
20
  extra_rdoc_files: []
20
21
  files:
21
- - vagrant-atomic.gemspec
22
+ - ".gitignore"
23
+ - CHANGELOG.md
24
+ - Gemfile
22
25
  - LICENSE
23
26
  - README.md
27
+ - Rakefile
24
28
  - Vagrantfile
25
29
  - lib/vagrant-atomic.rb
26
- - lib/vagrant-atomic/plugin.rb
27
- - lib/vagrant-atomic/guest.rb
28
- - lib/vagrant-atomic/cap/unregister.rb
29
- - lib/vagrant-atomic/cap/register.rb
30
30
  - lib/vagrant-atomic/cap/change_host_name.rb
31
31
  - lib/vagrant-atomic/cap/docker.rb
32
+ - lib/vagrant-atomic/guest.rb
33
+ - lib/vagrant-atomic/plugin.rb
34
+ - lib/vagrant-atomic/plugin.rb~
32
35
  - lib/vagrant-atomic/version.rb
33
- - CHANGELOG.md
34
- - Rakefile
35
- - Gemfile
36
- - .gitignore
37
- homepage:
36
+ - vagrant-atomic.gemspec
37
+ homepage: https://github.com/projectatomic/vagrant-atomic
38
38
  licenses:
39
39
  - GPL-2.0
40
40
  metadata: {}
@@ -44,18 +44,19 @@ require_paths:
44
44
  - lib
45
45
  required_ruby_version: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.3.6
55
55
  requirements: []
56
- rubyforge_project: vagrant-atomic
57
- rubygems_version: 2.0.14
56
+ rubyforge_project:
57
+ rubygems_version: 2.2.2
58
58
  signing_key:
59
59
  specification_version: 4
60
- summary: Enables the Project Atomic OS (http://projectatomic.io) as a guest for vagrant
60
+ summary: Project Atomic guest for Vagrant
61
61
  test_files: []
62
+ has_rdoc:
@@ -1,14 +0,0 @@
1
- module VagrantPlugins
2
- module GuestAtomic
3
- module Cap
4
- class Register
5
- def self.register(machine)
6
- username = machine.config.registration.subscriber_username
7
- password = machine.config.registration.subscriber_password
8
- command = "subscription-manager register --username=#{username} --password=#{password} --auto-attach"
9
- 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)
10
- end
11
- end
12
- end
13
- end
14
- end
@@ -1,24 +0,0 @@
1
- module VagrantPlugins
2
- module GuestAtomic
3
- module Cap
4
- class Unregister
5
- def self.unregister(machine)
6
- begin
7
- if machine.communicate.ready?
8
- machine.communicate.execute("subscription-manager unregister || :", sudo: true)
9
- end
10
- end
11
- end
12
- end
13
- end
14
- end
15
- end
16
-
17
-
18
- # if !machine.communicate.ready?
19
- # raise Vagrant::Errors::VMNotCreatedError
20
- # end
21
-
22
- # rescue IOError
23
- # Ignore, this probably means connection closed because it
24
- # shut down.