knife-proxmox-ve 0.1.2 → 0.1.3
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/README.md +14 -9
- data/lib/chef/knife/helpers/proxmox_vm_provision.rb +5 -4
- data/lib/chef/knife/proxmox_vm_bootstrap.rb +5 -0
- 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: 5d5214d06c2b3094351f1e2824fc0d3e9cceba436f2053bb32001b41fe18ea5c
|
|
4
|
+
data.tar.gz: fad9ae85bb184f7dd8fdb6e54cac5a15a8f9036f1f5f4a07b939cd0a4a0e3f3a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4d3a3bdff34585a82c46888572244512f06a7a17b94475b135f2d5f520c2b47d983e07f69cb40baa2ebc2fca8526db2cd5c6c7928ab1f778d2db28061167a05
|
|
7
|
+
data.tar.gz: 9008cdcd204db73879b3f2a4602e202d821dd70b9df217ebc8ff90e59342e7ff805c516497cd7c62970c531fd6f04df7e69f2fac84305836ba1f9faf821f7630
|
data/README.md
CHANGED
|
@@ -45,12 +45,16 @@ knife[:proxmox_clusters] = {
|
|
|
45
45
|
verify_ssl: true, # optional (default true); false warns every run
|
|
46
46
|
|
|
47
47
|
# Optional per-cluster provisioning defaults (any CLI flag overrides these):
|
|
48
|
-
storage:
|
|
49
|
-
bridge:
|
|
50
|
-
ciuser:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
storage: "local-lvm",
|
|
49
|
+
bridge: "vmbr0",
|
|
50
|
+
ciuser: "ubuntu",
|
|
51
|
+
ssh_public_key: "~/.ssh/id_ed25519.pub", # default authorized key; satisfies the auth
|
|
52
|
+
# requirement without --ssh-public-key. For
|
|
53
|
+
# `vm bootstrap`, :ciuser also becomes the
|
|
54
|
+
# default --connection-user.
|
|
55
|
+
nameserver: "10.0.0.1",
|
|
56
|
+
searchdomain: "example.com",
|
|
57
|
+
target_node: nil,
|
|
54
58
|
},
|
|
55
59
|
}
|
|
56
60
|
|
|
@@ -150,13 +154,14 @@ Both commands share the provisioning flags below.
|
|
|
150
154
|
| `--bridge vmbrN` / `--vlan TAG` | net0 bridge and VLAN tag (needs a VLAN-aware bridge). |
|
|
151
155
|
| `--ip CIDR\|dhcp` / `--gateway IP` / `--prefix N` | Static IPv4 (`10.0.10.5/24`, or a bare IP with `--prefix`) or `dhcp`. |
|
|
152
156
|
| `--nameserver IP` / `--searchdomain DOMAIN` | cloud-init DNS. |
|
|
153
|
-
| `--ciuser USER` | cloud-init user. |
|
|
154
|
-
| `--ssh-public-key PATH` | Public key injected via cloud-init (preferred auth). |
|
|
157
|
+
| `--ciuser USER` | cloud-init user. For `vm bootstrap`, also the default `--connection-user`. |
|
|
158
|
+
| `--ssh-public-key PATH` | Public key injected via cloud-init (preferred auth). Falls back to the cluster's `:ssh_public_key`. |
|
|
155
159
|
| `--cipassword` | Prompt (no echo) for a cloud-init password; or set `KNIFE_PROXMOX_CIPASSWORD`. |
|
|
156
160
|
| `--clone-timeout SEC` / `--boot-timeout SEC` | Clone and boot/SSH wait limits (default 600 / 300). |
|
|
157
161
|
|
|
158
162
|
For `vm bootstrap`, the standard `knife bootstrap` options are inherited: `-N/--node-name`,
|
|
159
|
-
`-r/--run-list`, `-E/--environment`, `--connection-user
|
|
163
|
+
`-r/--run-list`, `-E/--environment`, `--connection-user` (defaults to the resolved `:ciuser`,
|
|
164
|
+
since cloud-init creates the guest account under that name), `--ssh-identity-file`,
|
|
160
165
|
`--bootstrap-version`, `--ssh-verify-host-key` (defaults to `:accept_new` for the
|
|
161
166
|
freshly-created host), `--yes`, etc. They do not apply to `vm create`, which never bootstraps.
|
|
162
167
|
|
|
@@ -110,7 +110,8 @@ class Chef
|
|
|
110
110
|
|
|
111
111
|
option :ssh_public_key,
|
|
112
112
|
long: "--ssh-public-key PATH",
|
|
113
|
-
description: "Path to an SSH PUBLIC key authorized for the cloud-init user."
|
|
113
|
+
description: "Path to an SSH PUBLIC key authorized for the cloud-init user. " \
|
|
114
|
+
"Defaults to the cluster's :ssh_public_key when set."
|
|
114
115
|
|
|
115
116
|
option :cipassword,
|
|
116
117
|
long: "--cipassword",
|
|
@@ -246,8 +247,8 @@ class Chef
|
|
|
246
247
|
return if @ssh_public_key || @cipassword
|
|
247
248
|
|
|
248
249
|
ui.fatal!(
|
|
249
|
-
"no SSH credential for the new VM: pass --ssh-public-key PATH
|
|
250
|
-
"cloud-init password via #{ENV_CIPASSWORD} or --cipassword"
|
|
250
|
+
"no SSH credential for the new VM: pass --ssh-public-key PATH (or set the cluster's " \
|
|
251
|
+
":ssh_public_key), or provide a cloud-init password via #{ENV_CIPASSWORD} or --cipassword"
|
|
251
252
|
)
|
|
252
253
|
end
|
|
253
254
|
|
|
@@ -264,7 +265,7 @@ class Chef
|
|
|
264
265
|
# looks like a private key (a common copy-paste mistake that must never be
|
|
265
266
|
# uploaded as an authorized key).
|
|
266
267
|
def resolve_ssh_public_key
|
|
267
|
-
path =
|
|
268
|
+
path = from_cli_or_cluster(:ssh_public_key)
|
|
268
269
|
return nil if blank?(path)
|
|
269
270
|
|
|
270
271
|
@ssh_public_key_path = File.expand_path(path)
|
|
@@ -95,6 +95,11 @@ class Chef
|
|
|
95
95
|
def apply_provision_auth!(spec)
|
|
96
96
|
super
|
|
97
97
|
|
|
98
|
+
# cloud-init creates the guest account as :ciuser, so the bootstrap must connect as that
|
|
99
|
+
# same user. Fall back to it when the operator did not pass an explicit --connection-user.
|
|
100
|
+
ciuser = from_cli_or_cluster(:ciuser)
|
|
101
|
+
config[:connection_user] ||= ciuser if ciuser
|
|
102
|
+
|
|
98
103
|
config[:connection_password] = @cipassword if @cipassword
|
|
99
104
|
|
|
100
105
|
return unless @ssh_public_key
|