knife-proxmox-ve 0.1.1 → 0.1.2
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 +4 -4
- data/lib/chef/knife/helpers/proxmox_vm_provision.rb +10 -7
- data/lib/knife-proxmox-ve/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bff2fdcc58a1aeadf186e297e838ddb91510536f7cf0169ccb25a3091c590931
|
|
4
|
+
data.tar.gz: 9cdc6b30bfe1a9d8da2feb3f8cf622973dbb0ab553c13c10a3a9729ea444a46a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 118d4dd196b869f226c11801b728b4d71661c9aa9756210b3857bf6f629c45515199a9b2e0b9b0f27b07bbf1cee995de81eaa1e1e8102a228d415eae7a94a460
|
|
7
|
+
data.tar.gz: b2b0d7b679086f772f7d844c22635c9a749110405362788ece0e7de99a23eec68a97c1e7e18ddfdad30500a5bfb606e8f8ed4b396a61faa9a32a0a1a4f2226ae
|
|
@@ -13,9 +13,11 @@ class Chef
|
|
|
13
13
|
# cloud-init auth and plants it on the guest, but never touches the bootstrap connection.
|
|
14
14
|
# The bootstrap command layers that on by overriding #apply_provision_auth!.
|
|
15
15
|
module ProxmoxVmProvision
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
|
|
16
|
+
# A bridge is any Linux network interface: a classic bridge (vmbr0), an SDN VNet
|
|
17
|
+
# (arbitrary name, e.g. "mail"), an OVS bridge, a bond, etc. We only enforce what the
|
|
18
|
+
# kernel itself does on an interface name — 1..15 chars, no whitespace, no "/", and not
|
|
19
|
+
# "." or "..". IP/gateway validation is handled separately by IPAddr below.
|
|
20
|
+
BRIDGE_PATTERN = %r{\A(?!\.{1,2}\z)[^\s/]{1,15}\z}
|
|
19
21
|
|
|
20
22
|
# A pasted PRIVATE key must never travel as an authorized public key.
|
|
21
23
|
PRIVATE_KEY_MARKER = /-----BEGIN [A-Z ]*PRIVATE KEY-----/
|
|
@@ -73,8 +75,8 @@ class Chef
|
|
|
73
75
|
# --- Networking -------------------------------------------------------
|
|
74
76
|
|
|
75
77
|
option :bridge,
|
|
76
|
-
long: "--bridge
|
|
77
|
-
description: "Network bridge for net0 (e.g. vmbr0)."
|
|
78
|
+
long: "--bridge NAME",
|
|
79
|
+
description: "Network bridge for net0 (e.g. vmbr0 or an SDN VNet name)."
|
|
78
80
|
|
|
79
81
|
option :vlan,
|
|
80
82
|
long: "--vlan TAG",
|
|
@@ -193,9 +195,10 @@ class Chef
|
|
|
193
195
|
def validate_bridge!
|
|
194
196
|
bridge = config[:bridge]
|
|
195
197
|
return if bridge.nil?
|
|
196
|
-
return if
|
|
198
|
+
return if BRIDGE_PATTERN.match?(bridge)
|
|
197
199
|
|
|
198
|
-
ui.fatal!("--bridge #{bridge.inspect} is not a valid
|
|
200
|
+
ui.fatal!("--bridge #{bridge.inspect} is not a valid interface name " \
|
|
201
|
+
"(1-15 chars, no whitespace or '/'; e.g. vmbr0 or an SDN VNet name)")
|
|
199
202
|
end
|
|
200
203
|
|
|
201
204
|
def validate_ip!
|