egon 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/undercloud-install-instack-virt.rb +1 -0
- data/bin/undercloud-install-satellite.rb +1 -0
- data/bin/undercloud-install-vanilla-rhel.rb +1 -0
- data/egon.gemspec +1 -0
- data/lib/egon/overcloud/undercloud_handle/deployment.rb +9 -6
- data/lib/egon/overcloud/undercloud_handle/flavor.rb +0 -2
- data/lib/egon/undercloud/commands.rb +1 -1
- data/lib/egon/undercloud/installer.rb +10 -0
- data/lib/egon/undercloud/ssh-connection.rb +28 -0
- data/lib/egon/version.rb +1 -1
- data/test/test_ssh_connection.rb +4 -0
- data/test/test_undercloud.rb +5 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDcyY2IwNmU3NGJiZTUzZTA0YzEwNmRlN2ZmMjYzZjBjNjNjODFjOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGY3YTNkM2VjYjMwYzhkYTkxZjZmNjg3ZThjYTU3Y2UxNTdmZTAzNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGVhOWJkNmQ0M2U4ODk2MGU1M2YwMTc5ZjZhMjU0NjY2MjRiNzI0OGI4YTZm
|
10
|
+
NWNkMjE5NTBmNGE1ZjIyOWZhNmY3M2I1NTYwYjBiNTVmMmFmOTU4OTUzMDdh
|
11
|
+
ZDRmMGE5NDIyZDdmNWMwNjAzNGFjNzlmMjYyZTYxMzNhZTliYjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWNkYzU2YWNiMDg4M2MyMzk0ODlmY2U3NWUyNzNhM2I1M2M2NjEzYjczZjZk
|
14
|
+
ODBiNDhkNjZlOTEzZWQwMTZmMDNjNjc5NDkyNzY1NWIyNmQ2ZjNmMzNlMDg4
|
15
|
+
ZmIxMjQ5NTM2OGE0ZjU2ODAwNzE3YjNkYTAxYzgzZTEwMTM4Y2Y=
|
data/egon.gemspec
CHANGED
@@ -27,13 +27,16 @@ module Overcloud
|
|
27
27
|
def deploy_plan(plan_name)
|
28
28
|
plan = get_plan(plan_name)
|
29
29
|
templates = Hash[plan.provider_resource_templates]
|
30
|
+
|
30
31
|
# temporary workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1212740
|
31
|
-
templates
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
templates.keys.each do |template_path|
|
33
|
+
if template_path.index('puppet/') == 0
|
34
|
+
new_template_path = template_path.sub('puppet/','')
|
35
|
+
templates[new_template_path] = templates[template_path]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
templates["hieradata/RedHat.yaml"] = templates["puppet/hieradata/RedHat.yaml"]
|
39
|
+
templates["yum_update.sh"] = templates["extraconfig/tasks/yum_update.sh"]
|
37
40
|
|
38
41
|
stack_parameters = {
|
39
42
|
:stack_name => plan.name,
|
@@ -41,8 +41,6 @@ module Overcloud
|
|
41
41
|
:extra_specs => {
|
42
42
|
:cpu_arch => cpu_arch,
|
43
43
|
:'capabilities:boot_option' => 'local',
|
44
|
-
:'baremetal:deploy_kernel_id' => get_baremetal_deploy_kernel_image.id,
|
45
|
-
:'baremetal:deploy_ramdisk_id' => get_baremetal_deploy_ramdisk_image.id
|
46
44
|
}
|
47
45
|
}
|
48
46
|
|
@@ -27,7 +27,7 @@ module Egon
|
|
27
27
|
end
|
28
28
|
|
29
29
|
OSP7_COMMON = "
|
30
|
-
sudo yum install -y http://
|
30
|
+
sudo yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
|
31
31
|
sudo yum install -y https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm
|
32
32
|
sudo curl -o /etc/yum.repos.d/rdo-management-trunk.repo http://trunk-mgt.rdoproject.org/centos-kilo/current-passed-ci/delorean-rdo-management.repo
|
33
33
|
sudo yum install -y python-rdomanager-oscplugin
|
@@ -38,6 +38,16 @@ module Egon
|
|
38
38
|
@connection.execute(commands)
|
39
39
|
}
|
40
40
|
end
|
41
|
+
|
42
|
+
def check_ports
|
43
|
+
# closed ports 5385, 36357
|
44
|
+
ports = [8774, 9292, 8777, 9696, 8004, 5000, 8585, 5672]
|
45
|
+
ports.each do |p|
|
46
|
+
if !@connection.port_open?(p)
|
47
|
+
set_failure(true)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
41
51
|
end
|
42
52
|
end
|
43
53
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'curb'
|
1
2
|
require 'net/ssh'
|
2
3
|
require 'stringio'
|
3
4
|
|
@@ -12,6 +13,33 @@ module Egon
|
|
12
13
|
@user = user
|
13
14
|
@password = password
|
14
15
|
end
|
16
|
+
|
17
|
+
def port_open?(port, local_ip="127.0.0.1", remote_ip="192.0.2.1", seconds=1)
|
18
|
+
t = Thread.new {
|
19
|
+
Net::SSH.start(@host, @user, :password => @password, :timeout => 2,
|
20
|
+
:auth_methods => ["password"],
|
21
|
+
:number_of_password_prompts => 0) do |session|
|
22
|
+
puts "Forwarding #{port} #{remote_ip} #{port}"
|
23
|
+
session.forward.local( port, remote_ip, port )
|
24
|
+
session.loop { true }
|
25
|
+
end
|
26
|
+
}
|
27
|
+
|
28
|
+
sleep 1
|
29
|
+
begin
|
30
|
+
url = "#{local_ip}:#{port}"
|
31
|
+
puts "Testing #{url}"
|
32
|
+
http = Curl.get(url)
|
33
|
+
puts http.body_str
|
34
|
+
puts "Port #{port} is open"
|
35
|
+
t.kill
|
36
|
+
true
|
37
|
+
rescue Curl::Err::GotNothingError, Curl::Err::ConnectionFailedError
|
38
|
+
puts "Port #{port} is closed"
|
39
|
+
t.kill
|
40
|
+
false
|
41
|
+
end
|
42
|
+
end
|
15
43
|
|
16
44
|
def call_complete
|
17
45
|
@on_complete.call if @on_complete
|
data/lib/egon/version.rb
CHANGED
data/test/test_ssh_connection.rb
CHANGED
@@ -10,4 +10,8 @@ describe "SSHConnection" do
|
|
10
10
|
expect(io.string.strip!).to eq("execution expired")
|
11
11
|
end
|
12
12
|
|
13
|
+
it "check port is open" do
|
14
|
+
connection = Egon::Undercloud::SSHConnection.new("127.0.0.1", "stack", "test")
|
15
|
+
connection.port_open?(1111).should eq false
|
16
|
+
end
|
13
17
|
end
|
data/test/test_undercloud.rb
CHANGED
@@ -40,6 +40,11 @@ describe "undercloud installer" do
|
|
40
40
|
it "connection should timeout and installer indicate failure" do
|
41
41
|
run_and_assert_installer(@installer, true)
|
42
42
|
end
|
43
|
+
|
44
|
+
it "check ports should fail on mock connection" do
|
45
|
+
@installer.check_ports
|
46
|
+
expect(@installer.failure?).to be true
|
47
|
+
end
|
43
48
|
|
44
49
|
end
|
45
50
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: egon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Egon and Fusor team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 3.2.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: curb
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.8.8
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.8.8
|
83
97
|
description: ''
|
84
98
|
email:
|
85
99
|
- foreman-dev+egon@googlegroups.com
|