Skip to content

Commit 26c9861

Browse files
authored
vsphere nested enable ara (#62748)
1 parent 91b1d2f commit 26c9861

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Diff for: ci-operator/step-registry/ipi/conf/vsphere/nested/ipi-conf-vsphere-nested-commands.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import sys
99
import yaml
10+
import shutil
1011

1112
def log(msg):
1213
print(msg)
@@ -32,6 +33,9 @@ def ip_to_ptr(ip_address):
3233
leased_resource = os.environ.get("LEASED_RESOURCE")
3334
shared_dir = os.environ.get("SHARED_DIR")
3435

36+
artifact_dir = os.environ.get("ARTIFACT_DIR")
37+
home = os.environ.get('HOME')
38+
3539
if cluster_profile_name is None:
3640
log("CLUSTER_PROFILE_NAME is undefined")
3741
sys.exit(1)
@@ -60,8 +64,12 @@ def ip_to_ptr(ip_address):
6064
os.environ["HOSTS_PER_FAILURE_DOMAIN"] = os.environ["HOSTS"]
6165
os.environ["CLUSTER_NAME"] = f'{os.environ["NAMESPACE"]}-{os.environ["UNIQUE_HASH"]}'
6266

67+
ara_dir = f'{artifact_dir}/ara'
68+
os.makedirs(ara_dir, exist_ok=True)
69+
70+
6371
for key in os.environ:
64-
if "PASSWORD" in key:
72+
if "password" in key.lower():
6573
continue
6674
print(f"export {key}={os.environ[key]}")
6775

@@ -132,3 +140,9 @@ def ip_to_ptr(ip_address):
132140

133141
with open(os.path.join(shared_dir, "install-config.yaml"), "w") as install_config_file:
134142
yaml.dump(install_config, install_config_file)
143+
144+
145+
# Copy ara's sqlite db to artifacts
146+
ara_sql = f"{home}/.ara/server/ansible.sqlite"
147+
shutil.copy2(ara_sql, ara_dir)
148+

Diff for: ci-operator/step-registry/ipi/conf/vsphere/nested/ipi-conf-vsphere-nested-ref.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ ref:
88
cpu: 10m
99
memory: 100Mi
1010
env:
11+
- name: ANSIBLE_CALLBACK_PLUGINS
12+
default: "/opt/app-root/lib64/python3.11/site-packages/ara/plugins/callback"
13+
documentation: |-
14+
Enable ARA
1115
- name: HOSTS
1216
default: "1"
1317
documentation: |-
@@ -35,4 +39,4 @@ ref:
3539
mount_path: /var/run/vault/vsphere-ibmcloud-ci
3640
documentation: >-
3741
Provisions a nested environment in the vCenter associated with the ${SHARED_DIR}/LEASE_single.json. The install-config.yaml
38-
will be updated to reflect the nested vCenter. This step is to be called after some other step that sets up
42+
will be updated to reflect the nested vCenter. This step is to be called after some other step that sets up

0 commit comments

Comments
 (0)