py-pve-cloud 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl
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.
Potentially problematic release.
This version of py-pve-cloud might be problematic. Click here for more details.
- pve_cloud/cli/pvclu.py +12 -4
- {py_pve_cloud-0.1.1.dist-info → py_pve_cloud-0.2.0.dist-info}/METADATA +1 -1
- {py_pve_cloud-0.1.1.dist-info → py_pve_cloud-0.2.0.dist-info}/RECORD +7 -7
- {py_pve_cloud-0.1.1.dist-info → py_pve_cloud-0.2.0.dist-info}/WHEEL +0 -0
- {py_pve_cloud-0.1.1.dist-info → py_pve_cloud-0.2.0.dist-info}/entry_points.txt +0 -0
- {py_pve_cloud-0.1.1.dist-info → py_pve_cloud-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {py_pve_cloud-0.1.1.dist-info → py_pve_cloud-0.2.0.dist-info}/top_level.txt +0 -0
pve_cloud/cli/pvclu.py
CHANGED
|
@@ -5,6 +5,7 @@ import socket
|
|
|
5
5
|
import paramiko
|
|
6
6
|
import dns.resolver
|
|
7
7
|
import base64
|
|
8
|
+
import re
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
def get_cloud_domain(target_pve):
|
|
@@ -57,9 +58,15 @@ def get_cloud_env(pve_host):
|
|
|
57
58
|
|
|
58
59
|
_, stdout, _ = ssh.exec_command("cat /etc/pve/cloud/secrets/patroni.pass")
|
|
59
60
|
|
|
60
|
-
patroni_pass = stdout.read().decode('utf-8')
|
|
61
|
+
patroni_pass = stdout.read().decode('utf-8').strip()
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
# fetch bind update key for ingress dns validation
|
|
64
|
+
_, stdout, _ = ssh.exec_command("sudo cat /etc/pve/cloud/secrets/internal.key")
|
|
65
|
+
bind_key_file = stdout.read().decode('utf-8')
|
|
66
|
+
|
|
67
|
+
bind_internal_key = re.search(r'secret\s+"([^"]+)";', bind_key_file).group(1)
|
|
68
|
+
|
|
69
|
+
return cluster_vars, patroni_pass, bind_internal_key
|
|
63
70
|
|
|
64
71
|
|
|
65
72
|
def get_online_pve_host_prsr(args):
|
|
@@ -90,7 +97,7 @@ def get_ssh_master_kubeconfig(cluster_vars, stack_name):
|
|
|
90
97
|
def export_envr(args):
|
|
91
98
|
ansible_host = get_online_pve_host(args.target_pve)
|
|
92
99
|
cloud_domain = get_cloud_domain(args.target_pve)
|
|
93
|
-
cluster_vars, patroni_pass = get_cloud_env(ansible_host)
|
|
100
|
+
cluster_vars, patroni_pass, bind_internal_key = get_cloud_env(ansible_host)
|
|
94
101
|
print(f"export PVE_ANSIBLE_HOST='{ansible_host}'")
|
|
95
102
|
print(f"export PVE_CLOUD_DOMAIN='{cloud_domain}'")
|
|
96
103
|
|
|
@@ -101,7 +108,8 @@ def export_envr(args):
|
|
|
101
108
|
print(f"export TF_VAR_cluster_proxy_ip='{cluster_vars['pve_haproxy_floating_ip_internal']}'")
|
|
102
109
|
print(f"export TF_VAR_pve_cloud_pg_cstr=\"postgresql+psycopg2://postgres:{patroni_pass}@{cluster_vars['pve_haproxy_floating_ip_internal']}:5000/pve_cloud?sslmode=disable\"")
|
|
103
110
|
print(f"export TF_VAR_master_b64_kubeconf='{get_ssh_master_kubeconfig(cluster_vars, args.stack_name)}'")
|
|
104
|
-
|
|
111
|
+
print(f"export TF_VAR_bind_master_ip='{cluster_vars['bind_master_ip']}'")
|
|
112
|
+
print(f"export TF_VAR_bind_internal_key='{bind_internal_key}'")
|
|
105
113
|
|
|
106
114
|
|
|
107
115
|
def main():
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
pve_cloud/cli/pvcli.py,sha256=sRMVhpUQzDF1sRP9d8u-aDUkCRp6KoneiqZX_mLCgGU,3151
|
|
2
|
-
pve_cloud/cli/pvclu.py,sha256=
|
|
2
|
+
pve_cloud/cli/pvclu.py,sha256=Nxa97Ky2rlMtS1sR0AA-NOdqq2D7_5HcPHeS_bD7DJo,5738
|
|
3
3
|
pve_cloud/lib/inventory.py,sha256=0W31j34jtxUa-3Cxe0HmHJqc_8CpvvxyDqd0sAZ5oCI,31
|
|
4
4
|
pve_cloud/orm/alchemy.py,sha256=1PABOo2d-ceIwlSZPYx19aXZFszDXMh8YIXgkLT-554,5000
|
|
5
5
|
pve_cloud/orm/alembic.ini,sha256=7140n-YUj06aAIHOHACm8U0xhUFUoBZ4Jw23KlYB9EA,4865
|
|
@@ -11,9 +11,9 @@ pve_cloud/orm/migrations/versions/7868bcd05006_migrate_old.py,sha256=rU8Bw2tYDyn
|
|
|
11
11
|
pve_cloud/orm/migrations/versions/7dea8c4ee39f_init.py,sha256=iMDyHhtyvpSywMnLhiSEL3W12YSm6sPa18XRgzQcwDg,954
|
|
12
12
|
pve_cloud/orm/migrations/versions/944a8fd5d5bc_ext_ctrl_plns.py,sha256=LnVAShLaU1asz1L7TYs7oI9SnLxPp2IOA6K83kHNkN0,1674
|
|
13
13
|
pve_cloud/orm/migrations/versions/d9b711555be8_ext_control_plane.py,sha256=uBqv1r5pLX-RjqciKYx0zvWyygJMa5u58DTnVfIEAF0,1073
|
|
14
|
-
py_pve_cloud-0.
|
|
15
|
-
py_pve_cloud-0.
|
|
16
|
-
py_pve_cloud-0.
|
|
17
|
-
py_pve_cloud-0.
|
|
18
|
-
py_pve_cloud-0.
|
|
19
|
-
py_pve_cloud-0.
|
|
14
|
+
py_pve_cloud-0.2.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
15
|
+
py_pve_cloud-0.2.0.dist-info/METADATA,sha256=nysOCmhfUFKm3YJHCSw-pZ4sm-wLN0v99dLLZvlJckA,425
|
|
16
|
+
py_pve_cloud-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
py_pve_cloud-0.2.0.dist-info/entry_points.txt,sha256=VvncsKmTJ46irz-9wQZ4Zo1FgNBjRltGDBKR9ht18mE,84
|
|
18
|
+
py_pve_cloud-0.2.0.dist-info/top_level.txt,sha256=mpT7ttGRyZJVt_obhPLBHyIBcjKhUdJ-qVsMEVX5WJg,10
|
|
19
|
+
py_pve_cloud-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|