foreman_datacenter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76f5b1abf0cce09777cce5f45036844100f191d1
|
4
|
+
data.tar.gz: 0d0bb581e1af837951a9faca94fda6918b9f77cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 830efe9ae3bbf0a6a1835a95b86841f1c9751434454762f6c65075c707b7801e703640aa56edb242355511e5cbdaf7423c89202d9a1a4257996b39ed56b0dabc
|
7
|
+
data.tar.gz: dccfa972aefe23c9aa20cf81ebfe9c1bdce4e14188f777e9012aeec8ed0e5e9e85a5993f8cddbe5a49934bf8348f054951685e471b3daf6a890f3cdb4e2f7daf
|
@@ -18,6 +18,8 @@ module ForemanDatacenter
|
|
18
18
|
has_many :non_management_interfaces, -> { where(mgmt_only: false) },
|
19
19
|
:class_name => 'ForemanDatacenter::DeviceInterface'
|
20
20
|
has_many :modules, :class_name => 'ForemanDatacenter::DeviceModule'
|
21
|
+
has_one :ipmi_interface, -> { where(name: 'ipmi', mgmt_only: true) },
|
22
|
+
:class_name => 'ForemanDatacenter::DeviceInterface'
|
21
23
|
belongs_to_host
|
22
24
|
|
23
25
|
enum face: [:front, :rear]
|
@@ -47,7 +49,11 @@ module ForemanDatacenter
|
|
47
49
|
end
|
48
50
|
|
49
51
|
def ip_address
|
50
|
-
|
52
|
+
ipmi_interface.try(:ip_address) || primary_ip4
|
53
|
+
end
|
54
|
+
|
55
|
+
def mac_address
|
56
|
+
ipmi_interface.try(:mac_address)
|
51
57
|
end
|
52
58
|
|
53
59
|
def manufacturer_id
|
@@ -97,6 +103,8 @@ module ForemanDatacenter
|
|
97
103
|
self.name = host.name
|
98
104
|
device_type = DeviceType.for_host(host)
|
99
105
|
self.device_type = device_type if device_type
|
106
|
+
serial = host.fact_value_by_name('serialnumber')
|
107
|
+
self.serial = serial.value if serial
|
100
108
|
end
|
101
109
|
|
102
110
|
private
|
@@ -114,7 +122,8 @@ module ForemanDatacenter
|
|
114
122
|
name: interface.identifier,
|
115
123
|
form_factor: ForemanDatacenter::DeviceInterface::DEFAULT_FORM_FACTOR,
|
116
124
|
mac_address: interface.mac,
|
117
|
-
ip_address: interface.ip
|
125
|
+
ip_address: interface.ip,
|
126
|
+
mgmt_only: interface.identifier == 'ipmi'
|
118
127
|
)
|
119
128
|
end
|
120
129
|
end
|
@@ -104,10 +104,10 @@
|
|
104
104
|
<tr>
|
105
105
|
<td>Primary IPv4</td>
|
106
106
|
<td>
|
107
|
-
<% if @device.
|
107
|
+
<% if @device.ip_address.blank? %>
|
108
108
|
Not defined
|
109
109
|
<% else %>
|
110
|
-
<%= @device.
|
110
|
+
<%= @device.ip_address %></td>
|
111
111
|
<% end %>
|
112
112
|
</tr>
|
113
113
|
<tr>
|
@@ -116,9 +116,20 @@
|
|
116
116
|
<% if @device.primary_ip6.blank? %>
|
117
117
|
Not defined
|
118
118
|
<% else %>
|
119
|
-
<%= @device.primary_ip6
|
119
|
+
<%= @device.primary_ip6 %>
|
120
120
|
<% end %>
|
121
|
-
|
121
|
+
</td>
|
122
|
+
</tr>
|
123
|
+
<tr>
|
124
|
+
<td>MAC address</td>
|
125
|
+
<td>
|
126
|
+
<% if @device.mac_address.blank? %>
|
127
|
+
Not defined
|
128
|
+
<% else %>
|
129
|
+
<%= @device.mac_address %>
|
130
|
+
<% end %>
|
131
|
+
</td>
|
132
|
+
</tr>
|
122
133
|
</tbody>
|
123
134
|
</table>
|
124
135
|
</div>
|