From 2175ce79e1fa716e9de53744ad872b32b02d5b5c Mon Sep 17 00:00:00 2001 From: jianli-97 Date: Mon, 11 Dec 2023 14:59:48 +0800 Subject: [PATCH] update libvirt asset --- cmd/command/opts/opts.go | 3 +- data/assets_vfsdata.go | 12 ++-- .../data/terraform/libvirt/master.tf.template | 2 +- .../data/terraform/libvirt/worker.tf.template | 2 +- pkg/configmanager/asset/clusterasset.go | 8 +-- pkg/configmanager/asset/infraasset.go | 64 ++++++++++++------- pkg/infra/generate.go | 6 +- 7 files changed, 53 insertions(+), 44 deletions(-) diff --git a/cmd/command/opts/opts.go b/cmd/command/opts/opts.go index 0fed918..3087d75 100644 --- a/cmd/command/opts/opts.go +++ b/cmd/command/opts/opts.go @@ -69,8 +69,7 @@ type OpenStack struct { } type Libvirt struct { - UserName string - RemoteIP string + URI string OSImagePath string CIDR string Gateway string diff --git a/data/assets_vfsdata.go b/data/assets_vfsdata.go index d9154d5..40abd7b 100644 --- a/data/assets_vfsdata.go +++ b/data/assets_vfsdata.go @@ -429,17 +429,17 @@ var Assets = func() http.FileSystem { }, "/terraform/libvirt/master.tf.template": &vfsgen۰CompressedFileInfo{ name: "master.tf.template", - modTime: time.Date(2023, 12, 8, 9, 11, 20, 121855055, time.UTC), - uncompressedSize: 1954, + modTime: time.Date(2023, 12, 11, 6, 12, 49, 256547974, time.UTC), + uncompressedSize: 1907, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x9c\x55\x5d\x6b\xdb\x30\x14\x7d\xf7\xaf\x10\x62\x83\xb4\x6b\x95\x3e\x8c\x6d\x0c\x02\x1b\x1d\x6c\x79\x28\x0b\x1d\x7d\x2a\xc5\xa8\xf2\x4d\x22\x22\x4b\xae\x74\xed\x2e\x04\xff\xf7\xa1\x0f\x3b\x76\x92\xad\xdb\x0a\xc5\xca\xd5\x3d\xe7\x7e\x9d\x6b\x23\x58\xcb\x97\xc6\x96\x64\x97\x11\x62\xe1\xa9\x96\x16\x8a\xbc\xb2\xa6\x91\x05\x58\x17\xcc\x84\x28\xf9\xd8\x48\x8b\x64\x96\x7e\x13\xe2\x4c\x6d\x05\x90\x19\xa1\x45\xc9\x45\x23\x05\xb7\xd3\xe4\x45\x93\x4b\x03\xd6\x49\xa3\xbd\xcf\x15\x7b\xcf\xde\x45\x7b\x9b\xf9\xff\x36\xcb\xba\x18\x84\x76\xb8\x40\x5e\x5b\xe9\x11\x4f\x50\xd6\x6f\x9c\x5b\x7f\x9c\x4e\x77\x3b\xb6\x50\x1c\x7d\x96\xec\xce\x81\xd5\xbc\x84\xb6\xfd\x34\x34\xdf\x42\x69\x10\xf2\xf9\xa2\x6d\xa7\x6e\xeb\x10\x4a\xea\x43\x34\xdc\x4a\xfe\xa8\x80\x50\xa9\x1d\x72\x2d\x20\x17\xa6\xd6\x29\x52\x01\x4b\x5e\x2b\x5f\x14\xdd\xed\xd8\x0d\x77\x08\x96\x5d\xfb\xfb\xb6\x3d\x84\x57\x11\x82\xdb\x0a\x7c\x11\x33\xa2\xa4\xc3\x89\x43\x2b\xf5\xea\x6c\xc4\xb5\xa7\xf2\xd9\x78\x1a\x0b\xa9\x59\x5d\xa1\x79\x63\x54\x5d\x02\x25\xb4\x3b\x78\xee\x90\x99\xa7\x6e\xb8\x65\xe3\x7c\x33\x42\x7c\xd1\x21\x30\xa1\xaf\x76\xbe\x66\x8e\x13\xfa\xda\x5d\x26\x86\x0b\x02\x0a\x4a\xd0\x38\xd9\xc7\xff\x66\x1c\xc6\x5e\x5d\x44\x72\x26\x75\x01\x3f\xcf\xce\x5a\x3f\x89\xca\x18\x15\x08\x69\xca\xdd\x1b\xf7\x53\x1d\x76\xf7\xfb\x8f\x79\xc9\x57\x90\x2f\x38\xae\x53\x6b\x8e\x6b\x92\x2b\x2d\x51\x1a\x4d\x09\xdd\x1f\x07\x75\xbd\x50\x98\x8f\x39\x2a\xac\x27\xf9\xf7\xd2\x84\xd1\x08\xda\x0f\x63\x29\x15\x4c\x8e\xe1\xf3\x95\x4e\xc5\x1c\xc0\x4f\x97\xa6\x01\x9f\x8d\xdd\x50\x42\xfb\xd3\x6e\x90\x79\xc8\x5d\x6f\x8a\x4b\x0d\xa1\x89\xa5\x29\x06\x76\x1e\x6c\x85\x29\xb9\xd4\xc9\xb6\xf9\xe0\x98\x32\x82\x2b\x7f\xc3\x8b\xc2\x82\x73\xe0\xc8\x8c\xdc\x8f\xda\x7e\x3d\xff\x72\xdb\xb6\xf4\x21\xf3\xf8\xb5\xa8\xd2\xee\x81\xf6\x9a\x2c\x7c\x75\x5c\x39\x08\xeb\xe4\x3d\xb4\x3b\x72\x40\x5b\x43\xdc\x5f\x1f\x2d\x37\x5a\x6d\x47\x30\x42\xfc\xd2\x9b\x1a\xa1\xc3\x0a\x59\xd8\xc3\xf1\xa7\x3c\xc2\xfd\x8a\x23\x3c\xf3\xed\xa1\xcb\xd7\x68\x8e\x5e\xbf\x11\x7d\x6c\x41\x68\xa2\x43\xe3\xc6\xe2\xe8\xfe\x5e\x10\xc9\xde\xed\xef\x35\x91\x11\xd2\x88\xaa\x7e\x09\x7e\xbd\xb8\x3b\x81\x2c\xa1\x34\x76\xfb\x67\xe4\xed\xe7\x9b\x13\x48\x61\x2c\x18\xd7\xaf\x45\x78\x65\x8c\x37\x85\xf5\x87\x73\x26\x8b\xfb\x01\xfe\xc1\xeb\xa2\x46\xe3\x90\x5b\xec\x23\x87\x69\xfa\x49\x4b\xb7\x49\xe3\x8a\xdb\x9f\xcb\x62\x40\x1f\x6d\x2c\x3d\x4e\x51\x07\xbd\x24\x29\xe7\x52\x23\xd8\x25\x17\x90\x28\x3b\x7b\xff\xc2\x39\xd8\x02\xd6\x3f\x79\x19\xc5\xb5\x4e\x8d\xff\xbf\xd9\x0c\x37\x20\xe1\xef\x83\x06\xaa\x51\xda\x0f\xc1\xf5\x99\x4b\xcc\x97\xc6\xe6\x0a\xb8\x83\xbd\xc2\x43\x45\x2b\xcb\xab\xb5\x14\x9d\x94\xbb\x77\x75\x5a\xba\x46\x0b\x9a\xbe\x65\x0e\x41\xe7\xe1\x7a\x46\x68\x8a\x4e\x3b\x16\x61\xb4\x33\x0a\x4e\x93\x54\xb8\x8d\x24\xc8\xed\x0a\x30\xaf\x4c\xf8\x28\xd2\xab\x5e\xf7\xa6\xc6\xaa\x46\xff\xc5\x68\xde\x46\x89\x37\x5c\xd5\x30\xe8\x63\xdc\x03\x16\xb7\x80\x9d\xb3\xa3\x41\xb0\x2b\xd6\xb7\x24\x6b\x7f\x05\x00\x00\xff\xff\x95\xe5\x0c\x12\xa2\x07\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x9c\x55\x5f\x6b\xdb\x3e\x14\x7d\xf7\xa7\x10\xe2\xf7\x83\xb4\xb4\x5a\x1f\xc6\xb6\x97\x3c\x8c\x0e\xb6\x3c\x94\x85\x8e\x3e\x95\x62\x6e\xe5\x9b\x44\x44\x96\x3c\xe9\xda\x5d\x08\xfe\xee\x43\xb2\xec\xd8\x49\xb6\x6e\x2b\x14\x2b\x57\xf7\x9c\xfb\xef\x5c\x9b\xd0\x39\x58\x59\x57\xb2\x7d\xc6\x98\xc3\xef\xb5\x72\x58\xe4\x95\xb3\x8d\x2a\xd0\xf9\x68\x66\x4c\xab\xe7\x46\x39\x62\xf3\xf4\x9b\x31\x6f\x6b\x27\x91\xcd\x19\x2f\x4a\x90\x8d\x92\xe0\xde\x24\x2f\x9e\x5c\x1a\x74\x5e\x59\x13\x7c\x6e\xc4\x7b\xf1\xae\xb3\xb7\x59\xf8\x6f\xb3\xac\x8f\xc1\x78\x8f\x8b\xe4\xb5\x53\x01\xb1\xdf\x8b\xa5\x06\x0a\xa9\x89\x87\xfb\x45\xdb\xf2\x80\x69\xc0\x29\x78\xd6\xc8\xb8\x32\x9e\xc0\x48\xcc\xa5\xad\x4d\x82\x16\xb8\x82\x5a\x53\x82\xdf\x81\x27\x74\xe2\x36\xdc\x9f\xc2\xab\x0e\x42\xbb\x0a\x43\x56\x73\xa6\x95\xa7\x99\x27\xa7\xcc\xfa\x62\xc2\x75\xa0\x5a\x2c\xdb\x98\xb9\xc3\x54\x7d\x9f\x79\xde\x58\x5d\x97\xc8\x19\xef\x0f\x81\x3b\x66\x16\xa8\x1b\x70\x62\x9a\x6f\xc6\x98\x81\x12\x63\x60\xc6\xff\xdb\x87\x32\x81\x66\xfc\x7f\x7f\x9d\x18\xae\x18\x6a\x2c\xd1\xd0\xec\x10\xff\x8b\xf5\x14\x60\x6d\x7b\xd5\x91\x0b\x65\x0a\xfc\x71\x71\xd1\x86\xd6\x56\xd6\xea\x48\xc8\x53\xee\xc1\x78\x18\xd3\xb8\xa1\x5f\xbf\x2d\x4a\x58\x63\xbe\x04\xda\xa4\xd6\x9c\xd6\xa4\xd6\x46\x91\xb2\x86\x33\x7e\x38\x8e\xea\x7a\xa5\xb0\x10\x73\x52\xd8\x40\xf2\xf7\xa5\x49\x6b\x08\x4d\x18\xc6\x4a\x69\x9c\x9d\xc2\x17\x6b\x93\x8a\x39\x82\x9f\x2f\xcd\x20\xbd\x58\xb7\xe5\x8c\x0f\xa7\xfd\x28\xf3\x98\xbb\xd9\x16\xd7\x06\x63\x13\x4b\x5b\x8c\xec\x10\x6d\x85\x2d\x41\x99\x64\xdb\x7e\xf0\x42\x5b\x09\x3a\xdc\x40\x51\x38\xf4\x1e\x3d\x9b\xb3\xc7\x49\xdb\x6f\x17\x9f\xee\xdb\x96\x3f\x65\x01\xbf\x91\x55\x5a\x26\x34\x41\x93\x45\xa8\x0e\xb4\xc7\xb8\x1f\xc1\xc3\xf8\x13\x07\x72\x35\x76\x0b\x19\xa2\xe5\xd6\xe8\xdd\x04\xc6\x58\xd8\x62\x5b\x13\xf6\x58\xa9\x0a\x77\x3c\xfe\x94\x47\xbc\x5f\x03\xe1\x0b\xec\x8e\x5d\x3e\x77\xe6\xce\xeb\x17\xa2\xef\x5a\x10\x9b\xe8\xc9\xfa\xa9\x38\xfa\xbf\x57\x44\x72\x70\xfb\x73\x4d\x64\x8c\x35\xb2\xaa\x5f\x83\xdf\x2e\x1f\xce\x20\x4b\x2c\xad\xdb\xfd\x1e\x79\xff\xf1\xee\x0c\x52\x5a\x87\xd6\x0f\x6b\x11\x5f\x19\xd3\x4d\x11\xc3\xe1\x52\xa8\xe2\x71\x84\x7f\x0a\xba\xa8\xc9\x7a\x02\x47\x43\xe4\x38\xcd\x30\x69\xe5\xb7\x69\x5c\xdd\xf6\xe7\xaa\x18\xd1\x77\x36\x91\x1e\xe7\xa8\xa3\x5e\x92\x94\x73\x65\x08\xdd\x0a\x24\x26\xca\xde\x3e\xbc\x70\x8e\xb6\x40\x0c\x4f\x28\x3b\x71\x6d\x52\xe3\xff\x6d\x36\xe3\x0d\x48\xf8\xc7\xa8\x81\x6a\x92\xf6\x53\x74\x7d\x01\x45\xf9\xca\xba\x5c\x23\x78\x3c\x28\x3c\x56\xb4\x76\x50\x6d\x94\xec\xa5\xdc\xbf\xab\xd3\xd2\x35\x46\xf2\xf4\x71\xf2\x84\x26\x8f\xd7\x73\xc6\x53\x74\xde\xb3\x48\x6b\xbc\xd5\x78\x9e\xa4\xa2\x5d\x47\x42\xe0\xd6\x48\x79\x65\xe3\x57\x8e\xdf\x0c\xba\xb7\x35\x55\x35\x85\x2f\x46\xf3\xb6\x93\x78\x03\xba\xc6\x51\x1f\xbb\x3d\x10\xdd\x16\x88\x4b\x71\x32\x08\x71\x23\x86\x96\x64\xed\xcf\x00\x00\x00\xff\xff\x3c\x7e\x96\x16\x73\x07\x00\x00"), }, "/terraform/libvirt/worker.tf.template": &vfsgen۰CompressedFileInfo{ name: "worker.tf.template", - modTime: time.Date(2023, 12, 8, 9, 11, 13, 161768766, time.UTC), - uncompressedSize: 1954, + modTime: time.Date(2023, 12, 11, 6, 12, 56, 334643962, time.UTC), + uncompressedSize: 1907, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x9c\x55\xdf\x6b\xdb\x30\x10\x7e\xf7\x5f\x21\xc4\x06\x69\xd7\x2a\x7d\x18\xdb\x18\x04\x36\x3a\xd8\xf2\x30\x16\x3a\xca\x1e\x4a\x31\xaa\x7d\x49\x44\x64\xc9\x3d\x9d\xdd\x85\xe0\xff\x7d\x48\x96\x1d\x3b\xc9\xd6\x6d\x85\x62\xe5\x74\xdf\x77\xbf\xbe\xb3\x09\x10\xe5\xd2\x62\xc1\x76\x09\x63\x08\x8f\x95\x42\xc8\xd3\x12\x6d\xad\x72\x40\x17\xcc\x8c\x69\xf5\x50\x2b\x24\x36\x8b\xbf\x19\x73\xb6\xc2\x0c\xd8\x8c\xf1\xbc\x90\x59\xad\x32\x89\xd3\xe8\xc5\xa3\x4b\x0d\xe8\x94\x35\xde\xe7\x4a\xbc\x15\x6f\x5a\x7b\x93\xf8\xff\x26\x49\xba\x18\x8c\x77\xb8\x40\x5e\xa1\xf2\x88\x47\x28\xaa\x57\xce\xad\xdf\x4f\xa7\xbb\x9d\x58\x68\x49\x3e\x4b\x71\xeb\x00\x8d\x2c\xa0\x69\x3e\x0c\xcd\x37\x50\x58\x82\x74\xbe\x68\x9a\xa9\xdb\x3a\x82\x82\xfb\x10\xb5\x44\x25\x1f\x34\x30\xae\x8c\x23\x69\x32\x48\x33\x5b\x99\x18\x29\x87\xa5\xac\xb4\x2f\x8a\xef\x76\xe2\x87\xc5\x0d\xa0\xb8\xf6\xf7\x4d\x73\x08\x2f\x5b\x08\x6d\x4b\xf0\x45\xcc\x98\x56\x8e\x26\x8e\x50\x99\xd5\xd9\x88\x6b\x4f\xe5\xb3\xf1\x34\x08\xb1\x59\x5d\xa1\x69\x6d\x75\x55\x00\x67\xbc\x3b\x78\xee\x90\x99\xa7\xae\x25\x8a\x71\xbe\x09\x63\xbe\xe8\x10\x98\xf1\x17\x3b\x5f\xb3\xa4\x09\x7f\xe9\x2e\x23\xc3\x05\x03\x0d\x05\x18\x9a\xec\xe3\x7f\xb1\x8e\xda\x5e\x5d\xb4\xe4\x42\x99\x1c\x7e\x9e\x9d\x35\x7e\x12\xa5\xb5\x3a\x10\xf2\x98\xbb\x37\xee\xa7\x3a\xec\xee\xb7\xef\xf3\x42\xae\x20\x5d\x48\x5a\xc7\xd6\x1c\xd7\xa4\x56\x46\x91\xb2\x86\x33\xbe\x3f\x0e\xea\x7a\xa6\x30\x1f\x73\x54\x58\x4f\xf2\xef\xa5\x65\xd6\x10\x18\x3f\x8c\xa5\xd2\x30\x39\x86\xcf\x57\x26\x16\x73\x00\x3f\x5d\x9a\x01\x7a\xb2\xb8\xe1\x8c\xf7\xa7\xdd\x20\xf3\x90\xbb\xd9\xe4\x97\x06\x42\x13\x0b\x9b\x0f\xec\x32\xd8\x72\x5b\x48\x65\xa2\x6d\xf3\xce\x09\x6d\x33\xa9\xfd\x8d\xcc\x73\x04\xe7\xc0\xb1\x19\xbb\x1b\xb5\xfd\x7a\xfe\xe9\xa6\x69\xf8\x7d\xe2\xf1\xeb\xac\x8c\xbb\x07\xc6\x6b\x32\xf7\xd5\x49\xed\x20\xac\x93\xf7\x30\xee\xc8\x81\xb0\x82\x76\x7f\x7d\xb4\xd4\x1a\xbd\x1d\xc1\x18\xf3\x4b\x6f\x2b\x82\x0e\x9b\xa9\x1c\x0f\xc7\x1f\xf3\x08\xf7\x2b\x49\xf0\x24\xb7\x87\x2e\x9f\x5b\x73\xeb\xf5\x1b\xd1\xb7\x2d\x08\x4d\x74\x64\xdd\x58\x1c\xdd\xdf\x33\x22\xd9\xbb\xfd\xbd\x26\x12\xc6\xea\xac\xac\x9e\x83\x5f\x2f\x6e\x4f\x20\x0b\x28\x2c\x6e\xff\x8c\xbc\xf9\xf8\xf5\x04\x32\xb3\x08\xd6\xf5\x6b\x11\x5e\x19\xe3\x4d\x11\xfd\xe1\x5c\xa8\xfc\x6e\x80\xbf\xf7\xba\xa8\xc8\x3a\x92\x48\x7d\xe4\x30\x4d\x3f\x69\xe5\x36\x71\x5c\xed\xf6\xa7\x2a\x1f\xd0\xb7\x36\x11\x1f\xa7\xa8\x83\x5e\xa2\x94\x53\x65\x08\x70\x29\x33\x88\x94\x9d\xbd\x7f\xe1\x1c\x6c\x81\xe8\x9f\xb2\x68\xc5\xb5\x8e\x8d\xff\xbf\xd9\x0c\x37\x20\xe2\xef\x82\x06\xca\x51\xda\xf7\xc1\xf5\x49\x2a\x4a\x97\x16\x53\x0d\xd2\xc1\x5e\xe1\xa1\xa2\x15\xca\x72\xad\xb2\x4e\xca\xdd\xbb\x3a\x2e\x5d\x6d\x32\x1e\xbf\x65\x8e\xc0\xa4\xe1\x7a\xc6\x78\x8c\xce\x3b\x96\xcc\x1a\x67\x35\x9c\x26\x29\x69\xdb\x92\x90\xc4\x15\x50\x5a\xda\xf0\x51\xe4\x57\xbd\xee\x6d\x45\x65\x45\xfe\x8b\x51\xbf\x6e\x25\x5e\x4b\x5d\xc1\xa0\x8f\xed\x1e\x88\x76\x0b\xc4\xb9\x38\x1a\x84\xb8\x12\x7d\x4b\x92\xe6\x57\x00\x00\x00\xff\xff\x6f\x23\xc0\x9c\xa2\x07\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x9c\x55\x5f\x6b\xdb\x3e\x14\x7d\xf7\xa7\x10\xe2\xf7\x83\xb4\xb4\x5a\x1f\xc6\xb6\x97\x3c\x8c\x0e\xb6\x3c\x8c\x85\x8e\xb2\x87\x52\x8c\x2a\xdf\x24\x22\xb2\xe4\x5d\x5d\xbb\x0b\xc1\xdf\x7d\x48\x96\x1d\x3b\xc9\xd6\x6d\x85\x62\xe5\xea\x9e\x73\xff\x9d\x6b\x13\x20\xca\x95\xc3\x92\xed\x33\xc6\x10\xbe\xd7\x1a\xa1\xc8\x2b\x74\x8d\x2e\x00\x7d\x34\x33\x66\xf4\x53\xa3\x91\xd8\x3c\xfd\x66\xcc\xbb\x1a\x15\xb0\x39\xe3\x45\x29\x55\xa3\x95\xc4\x57\xc9\x8b\x27\x97\x06\xd0\x6b\x67\x83\xcf\x8d\x78\x2b\xde\x74\xf6\x36\x0b\xff\x6d\x96\xf5\x31\x18\xef\x71\x91\xbc\x46\x1d\x10\xfb\xbd\x58\x1a\x49\x21\x35\x71\x7f\xb7\x68\x5b\x1e\x30\x8d\x44\x2d\x9f\x0c\x30\xae\xad\x27\x69\x15\xe4\xca\xd5\x36\x41\x0b\x58\xc9\xda\x50\x82\x7f\x73\xb8\x05\x14\xb7\xe1\xfe\x14\x5e\x75\x10\xda\x55\x10\xb2\x9a\x33\xa3\x3d\xcd\x3c\xa1\xb6\xeb\x8b\x09\xd7\x81\x6a\xb1\x6c\x63\xe6\x08\xa9\xfa\x3e\xf3\xbc\x71\xa6\x2e\x81\x33\xde\x1f\x02\x77\xcc\x2c\x50\x37\x12\xc5\x34\xdf\x8c\x31\x2b\x4b\x88\x81\x19\xff\x6f\x1f\xca\x94\x34\xe3\xff\xfb\xeb\xc4\x70\xc5\xc0\x40\x09\x96\x66\x87\xf8\x9f\x9c\xa7\x00\x6b\xdb\xab\x8e\x5c\x68\x5b\xc0\x8f\x8b\x8b\x36\xb4\xb6\x72\xce\x44\x42\x9e\x72\x0f\xc6\xc3\x98\xc6\x0d\xfd\xf2\x75\x51\xca\x35\xe4\x4b\x49\x9b\xd4\x9a\xd3\x9a\xf4\xda\x6a\xd2\xce\x72\xc6\x0f\xc7\x51\x5d\x2f\x14\x16\x62\x4e\x0a\x1b\x48\xfe\xbe\x34\xe5\x2c\x81\x0d\xc3\x58\x69\x03\xb3\x53\xf8\x62\x6d\x53\x31\x47\xf0\xf3\xa5\x59\xa0\x67\x87\x5b\xce\xf8\x70\xda\x8f\x32\x8f\xb9\xdb\x6d\x71\x6d\x21\x36\xb1\x74\xc5\xc8\x2e\xa3\xad\x70\xa5\xd4\x36\xd9\xb6\xef\xbc\x30\x4e\x49\x13\x6e\x64\x51\x20\x78\x0f\x9e\xcd\xd9\xc3\xa4\xed\xb7\x8b\x0f\x77\x6d\xcb\x1f\xb3\x80\xdf\xa8\x2a\x2d\x13\xd8\xa0\xc9\x22\x54\x27\x8d\x87\xb8\x1f\xc1\xc3\xfa\x13\x07\xc2\x1a\xba\x85\x0c\xd1\x72\x67\xcd\x6e\x02\x63\x2c\x6c\xb1\xab\x09\x7a\xac\xd2\x05\x1e\x8f\x3f\xe5\x11\xef\xd7\x92\xe0\x59\xee\x8e\x5d\x3e\x76\xe6\xce\xeb\x17\xa2\xef\x5a\x10\x9b\xe8\xc9\xf9\xa9\x38\xfa\xbf\x17\x44\x72\x70\xfb\x73\x4d\x64\x8c\x35\xaa\xaa\x5f\x82\xdf\x2e\xef\xcf\x20\x4b\x28\x1d\xee\x7e\x8f\xbc\x7b\xff\xf9\x0c\x52\x39\x04\xe7\x87\xb5\x88\xaf\x8c\xe9\xa6\x88\xe1\x70\x29\x74\xf1\x30\xc2\x3f\x06\x5d\xd4\xe4\x3c\x49\xa4\x21\x72\x9c\x66\x98\xb4\xf6\xdb\x34\xae\x6e\xfb\x73\x5d\x8c\xe8\x3b\x9b\x48\x8f\x73\xd4\x51\x2f\x49\xca\xb9\xb6\x04\xb8\x92\x0a\x12\x65\x6f\x1f\x5e\x38\x47\x5b\x20\x86\xa7\x2c\x3b\x71\x6d\x52\xe3\xff\x6d\x36\xe3\x0d\x48\xf8\x87\xa8\x81\x6a\x92\xf6\x63\x74\x7d\x96\x9a\xf2\x95\xc3\xdc\x80\xf4\x70\x50\x78\xac\x68\x8d\xb2\xda\x68\xd5\x4b\xb9\x7f\x57\xa7\xa5\x6b\xac\xe2\xe9\xe3\xe4\x09\x6c\x1e\xaf\xe7\x8c\xa7\xe8\xbc\x67\x51\xce\x7a\x67\xe0\x3c\x49\x45\xbb\x8e\x84\x24\xae\x81\xf2\xca\xc5\xaf\x1c\xbf\x19\x74\xef\x6a\xaa\x6a\x0a\x5f\x8c\xe6\x75\x27\xf1\x46\x9a\x1a\x46\x7d\xec\xf6\x40\x74\x5b\x20\x2e\xc5\xc9\x20\xc4\x8d\x18\x5a\x92\xb5\x3f\x03\x00\x00\xff\xff\xc6\xb8\x5a\x98\x73\x07\x00\x00"), }, "/terraform/openstack": &vfsgen۰DirInfo{ name: "openstack", diff --git a/data/data/terraform/libvirt/master.tf.template b/data/data/terraform/libvirt/master.tf.template index 917b029..2917e1b 100644 --- a/data/data/terraform/libvirt/master.tf.template +++ b/data/data/terraform/libvirt/master.tf.template @@ -8,7 +8,7 @@ terraform { } provider "libvirt" { - uri = "qemu+ssh://{{.Platform.Username}}@{{.Platform.Remote_IP}}/system" + uri = "{{.Platform.URI}}" } variable "instance_count" { diff --git a/data/data/terraform/libvirt/worker.tf.template b/data/data/terraform/libvirt/worker.tf.template index 061c297..158897b 100644 --- a/data/data/terraform/libvirt/worker.tf.template +++ b/data/data/terraform/libvirt/worker.tf.template @@ -8,7 +8,7 @@ terraform { } provider "libvirt" { - uri = "qemu+ssh://{{.Platform.Username}}@{{.Platform.Remote_IP}}/system" + uri = "{{.Platform.URI}}" } variable "instance_count" { diff --git a/pkg/configmanager/asset/clusterasset.go b/pkg/configmanager/asset/clusterasset.go index 69846ce..57ce811 100644 --- a/pkg/configmanager/asset/clusterasset.go +++ b/pkg/configmanager/asset/clusterasset.go @@ -162,9 +162,7 @@ func (clusterAsset *ClusterAsset) InitClusterAsset(infraAsset InfraAsset, opts * } opts.Master.IgnFilePath = make([]string, len(clusterAsset.Master)) - if err := checkStringValue(&master_node.Ign_Path, opts.Master.IgnFilePath[i], fmt.Sprintf("master-ign[%d]", i)); err != nil { - return nil, err - } + setStringValue(&master_node.Ign_Path, opts.Master.IgnFilePath[i], "") } // worker node if len(clusterAsset.Worker) == 0 { @@ -187,9 +185,7 @@ func (clusterAsset *ClusterAsset) InitClusterAsset(infraAsset InfraAsset, opts * } opts.Worker.IgnFilePath = make([]string, len(clusterAsset.Worker)) - if err := checkStringValue(&worker_node.Ign_Path, opts.Worker.IgnFilePath[i], fmt.Sprintf("worker-ign[%d]", i)); err != nil { - return nil, err - } + checkStringValue(&worker_node.Ign_Path, opts.Worker.IgnFilePath[i], "") } setStringValue(&clusterAsset.Kubernetes.Kubernetes_Version, opts.KubeVersion, "") diff --git a/pkg/configmanager/asset/infraasset.go b/pkg/configmanager/asset/infraasset.go index 410c726..c9335db 100644 --- a/pkg/configmanager/asset/infraasset.go +++ b/pkg/configmanager/asset/infraasset.go @@ -75,8 +75,7 @@ func convertMap(inputMap interface{}, platform string) (map[string]interface{}, }, true case "libvirt", "Libvirt": return map[string]interface{}{ - "username": "", - "remote_ip": "", + "uri": "", "osimage_path": "", "cidr": "", "gateway": "", @@ -116,17 +115,7 @@ type OpenStackAsset struct { } func initOpenStackAssetFromMap(openstackMap map[string]interface{}, opts *opts.OptionsList) (InfraAsset, error) { - openstackAsset := &OpenStackAsset{ - UserName: opts.InfraPlatform.OpenStack.UserName, - Password: opts.InfraPlatform.OpenStack.Password, - Tenant_Name: opts.InfraPlatform.OpenStack.Tenant_Name, - Auth_URL: opts.InfraPlatform.OpenStack.Auth_URL, - Region: opts.InfraPlatform.OpenStack.Region, - Internal_Network: opts.InfraPlatform.OpenStack.Internal_Network, - External_Network: opts.InfraPlatform.OpenStack.External_Network, - Glance_Name: opts.InfraPlatform.OpenStack.Glance_Name, - Availability_Zone: opts.InfraPlatform.OpenStack.Availability_Zone, - } + openstackAsset := &OpenStackAsset{} updateFieldFromMap("username", &openstackAsset.UserName, openstackMap) updateFieldFromMap("password", &openstackAsset.Password, openstackMap) @@ -138,32 +127,59 @@ func initOpenStackAssetFromMap(openstackMap map[string]interface{}, opts *opts.O updateFieldFromMap("glance_name", &openstackAsset.Glance_Name, openstackMap) updateFieldFromMap("availability_zone", &openstackAsset.Availability_Zone, openstackMap) + if err := checkStringValue(&openstackAsset.UserName, opts.InfraPlatform.OpenStack.UserName, "username"); err != nil { + return nil, err + } + if err := checkStringValue(&openstackAsset.Password, opts.InfraPlatform.OpenStack.Password, "password"); err != nil { + return nil, err + } + if err := checkStringValue(&openstackAsset.Tenant_Name, opts.InfraPlatform.OpenStack.Tenant_Name, "tenant_name"); err != nil { + return nil, err + } + if err := checkStringValue(&openstackAsset.Auth_URL, opts.InfraPlatform.OpenStack.Auth_URL, "auth_url"); err != nil { + return nil, err + } + if err := checkStringValue(&openstackAsset.Region, opts.InfraPlatform.OpenStack.Region, "region"); err != nil { + return nil, err + } + if err := checkStringValue(&openstackAsset.Internal_Network, opts.InfraPlatform.OpenStack.Internal_Network, "internal_network"); err != nil { + return nil, err + } + if err := checkStringValue(&openstackAsset.External_Network, opts.InfraPlatform.OpenStack.External_Network, "external_network"); err != nil { + return nil, err + } + if err := checkStringValue(&openstackAsset.Glance_Name, opts.InfraPlatform.OpenStack.Glance_Name, "glance_name"); err != nil { + return nil, err + } + if err := checkStringValue(&openstackAsset.Availability_Zone, opts.InfraPlatform.OpenStack.Availability_Zone, "availability_zone"); err != nil { + return nil, err + } + return openstackAsset, nil } type LibvirtAsset struct { - UserName string - Remote_IP string + URI string OSImage_Path string CIDR string Gateway string } func initLibvirtAssetFromMap(libvirtMap map[string]interface{}, opts *opts.OptionsList) (InfraAsset, error) { - libvirtAsset := &LibvirtAsset{ - UserName: opts.InfraPlatform.Libvirt.UserName, - Remote_IP: opts.InfraPlatform.Libvirt.RemoteIP, - OSImage_Path: opts.InfraPlatform.Libvirt.OSImagePath, - CIDR: opts.InfraPlatform.Libvirt.CIDR, - Gateway: opts.InfraPlatform.Libvirt.Gateway, - } + libvirtAsset := &LibvirtAsset{} - updateFieldFromMap("username", &libvirtAsset.UserName, libvirtMap) - updateFieldFromMap("remote_ip", &libvirtAsset.Remote_IP, libvirtMap) + updateFieldFromMap("uri", &libvirtAsset.URI, libvirtMap) updateFieldFromMap("osimage_path", &libvirtAsset.OSImage_Path, libvirtMap) updateFieldFromMap("cidr", &libvirtAsset.CIDR, libvirtMap) updateFieldFromMap("gateway", &libvirtAsset.Gateway, libvirtMap) + setStringValue(&libvirtAsset.URI, opts.InfraPlatform.Libvirt.URI, "qemu:///system") + if err := checkStringValue(&libvirtAsset.OSImage_Path, opts.InfraPlatform.Libvirt.OSImagePath, "osimage_path"); err != nil { + return nil, err + } + setStringValue(&libvirtAsset.CIDR, opts.InfraPlatform.Libvirt.CIDR, "192.168.132.0/24") + setStringValue(&libvirtAsset.Gateway, opts.InfraPlatform.Libvirt.Gateway, "192.168.132.1") + return libvirtAsset, nil } diff --git a/pkg/infra/generate.go b/pkg/infra/generate.go index af49dcb..2429d7f 100644 --- a/pkg/infra/generate.go +++ b/pkg/infra/generate.go @@ -62,8 +62,7 @@ func (openstack *OpenStack) SetPlatform(infraAsset asset.InfraAsset) { } type Libvirt struct { - Username string - Remote_IP string + URI string OSImage_Path string CIDR string Gateway string @@ -71,8 +70,7 @@ type Libvirt struct { func (libvirt *Libvirt) SetPlatform(infraAsset asset.InfraAsset) { if libvirtAsset, ok := infraAsset.(*asset.LibvirtAsset); ok { - libvirt.Username = libvirtAsset.UserName - libvirt.Remote_IP = libvirtAsset.Remote_IP + libvirt.URI = libvirtAsset.URI libvirt.OSImage_Path = libvirtAsset.OSImage_Path libvirt.CIDR = libvirtAsset.CIDR libvirt.Gateway = libvirtAsset.Gateway -- Gitee