gogetit 0.2.0 → 0.2.1

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: e06872bd9f7527a326036e8208076da736b992b6
4
- data.tar.gz: 322ede4c1ae979880b93010b5b60e3def969e896
3
+ metadata.gz: a8894161933329fe5c330fdfe273572eaca29169
4
+ data.tar.gz: b1ece96587307c03ed4c858b5c4568bdffc789b3
5
5
  SHA512:
6
- metadata.gz: 50ad1167b838527060e1302b2a7179398cb6b7a1bde5ca9d9ad8aa31e44e5826b5bfe564f34ea55c6bd284715fb3409b53d7345681f5a2f65fbf667027ed2fb8
7
- data.tar.gz: e8a8b40a648503da5401ca20f12d95f4058bf2eb0ad6cd741b669d11c202425827cba3ee5fa1fec9359deaa5eec2c9b2e506e07d4c9c4cbf33bb5ba95aa15abd
6
+ metadata.gz: 579d18217f3eba138849cff0c7e3e06430843ff629c3e7a3a0e65f7d9655e0a066adbbea8ba012bd1467311a33a28a849a4caf93360bf83c42f4531967a6708a
7
+ data.tar.gz: 15b7091187727b452fa188a3d6cb7d70fa52270947c1f1a59b6a6c81bbc1dc11244c0d25703ffba319d01894c797c198518ebcdbf987e823393eee947f4fcbe8
data/README.md CHANGED
@@ -1,7 +1,13 @@
1
1
  # Gogetit
2
2
 
3
- Libraries with a CLI tool for dealing with things which I am working on such as MAAS, LXD, Libvirt and Chef.
4
- Using this, you will get to use them all together in automated and efficient way.
3
+ Libraries with a CLI tool for dealing with things such as [MAAS](https://docs.ubuntu.com/maas/2.2/en/), [LXD](https://github.com/lxc/lxd/tree/master/doc), Libvirt and Chef.
4
+ By using this, you will get to use them all together in automated and efficient way.
5
+
6
+ ## Features
7
+ - Provides an API and a CLI tool for dealing with Libvirt(KVM) and LXD.
8
+ - Aware of MAAS and works with [maas-client](https://github.com/itisnotdone/maas-client) to manage IP and FQDN allocation.
9
+ - Aware of Chef knife and its sub commands such as Vault to automate routine tasks.
10
+ - Being used by [kitchen-gogetkitchen](https://github.com/itisnotdone/kitchen-gogetkitchen) as a driver for Chef Test Kitchen.
5
11
 
6
12
  ## Installation
7
13
 
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  #spec.add_runtime_dependency 'etcd-rb', '~> 1.1.0'
36
36
  spec.add_runtime_dependency 'json', '~> 2.1.0'
37
37
  spec.add_runtime_dependency 'hyperkit', '~> 1.1.0'
38
- spec.add_runtime_dependency 'maas-client', '~> 0.1.24'
38
+ spec.add_runtime_dependency 'maas-client', '~> 0.2.0'
39
39
  spec.add_runtime_dependency 'ruby-libvirt', '~> 0.7.0'
40
40
  spec.add_runtime_dependency 'oga', '~> 2.10'
41
41
  spec.add_runtime_dependency 'net-ssh', '~> 4.1.0'
@@ -90,6 +90,20 @@ module Gogetit
90
90
  end
91
91
  end
92
92
 
93
+ def wait_until_available(fqdn, logger)
94
+ until ping_available?(fqdn)
95
+ logger.info("Calling <#{__method__.to_s}> for ping to be ready..")
96
+ sleep 3
97
+ end
98
+ logger.info("#{fqdn} is now available to ping..")
99
+
100
+ until ssh_available?(fqdn, 'ubuntu')
101
+ logger.info("Calling <#{__method__.to_s}> for ssh to be ready..")
102
+ sleep 3
103
+ end
104
+ logger.info("#{fqdn} is now available to ssh..")
105
+ end
106
+
93
107
  def ping_available?(fqdn)
94
108
  `ping -c 1 -W 1 #{fqdn}`
95
109
  $?.exitstatus == 0
@@ -1,3 +1,3 @@
1
1
  module Gogetit
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -63,6 +63,9 @@ module Gogetit
63
63
  logger.info("Calling to deploy...")
64
64
  maas.conn.request(:post, ['machines', system_id], {'op' => 'deploy'})
65
65
  maas.wait_until_state(system_id, 'Deployed')
66
+
67
+ fqdn = name + '.' + maas.get_domain
68
+ wait_until_available(fqdn, logger)
66
69
  logger.info("#{domain[:name]} has been created.")
67
70
  true
68
71
  end
@@ -41,19 +41,6 @@ module Gogetit
41
41
  end
42
42
  end
43
43
 
44
- def wait_until_available(fqdn)
45
- until ping_available?(fqdn)
46
- logger.info("Calling <#{__method__.to_s}> for ping to be ready..")
47
- sleep 3
48
- end
49
- logger.info("#{fqdn} is now available to ping..")
50
- until ssh_available?(fqdn, 'ubuntu')
51
- logger.info("Calling <#{__method__.to_s}> for ssh to be ready..")
52
- sleep 3
53
- end
54
- logger.info("#{fqdn} is now available to ssh..")
55
- end
56
-
57
44
  def create(name, args = {})
58
45
  logger.info("Calling <#{__method__.to_s}>")
59
46
  if container_exists?(name) or maas.domain_name_exists?(name)
@@ -68,7 +55,7 @@ module Gogetit
68
55
  conn.start_container(name, :sync=>"true")
69
56
 
70
57
  fqdn = name + '.' + maas.get_domain
71
- wait_until_available(fqdn)
58
+ wait_until_available(fqdn, logger)
72
59
  logger.info("#{name} has been created.")
73
60
  true
74
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gogetit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Draper
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.1.24
117
+ version: 0.2.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.1.24
124
+ version: 0.2.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: ruby-libvirt
127
127
  requirement: !ruby/object:Gem::Requirement