@@ -6,6 +6,7 @@ export JOB_DIR=/var/vcap/jobs/$JOB_NAME
6
6
export OPENSEARCH_PATH_CONF=${JOB_DIR} /config
7
7
export YQ_PACKAGE_DIR=/var/vcap/packages/yq
8
8
export PATH=$YQ_PACKAGE_DIR /bin:$PATH
9
+ export OPENSEARCH_SECURITY_CONFIG_PATH=${OPENSEARCH_PATH_CONF} /opensearch-security
9
10
10
11
sysctl -q -w vm.max_map_count=262144
11
12
mkdir -p ${OPENSEARCH_HOME} /plugins
@@ -17,7 +18,7 @@ source /var/vcap/packages/openjdk-17/bosh/runtime.env
17
18
18
19
# Copy default security config if it doesn't already exist
19
20
# Have to copy files that don't exist otherwise securityadmin.sh invocation will fail
20
- cp -u ${OPENSEARCH_HOME} /config/opensearch-security/* .yml ${OPENSEARCH_PATH_CONF} /opensearch-security
21
+ cp -u ${OPENSEARCH_HOME} /config/opensearch-security/* .yml " $OPENSEARCH_SECURITY_CONFIG_PATH "
21
22
22
23
< %
23
24
api = p(" opensearch.cf.domain" )
@@ -29,17 +30,17 @@ cf auth "<%= client %>" "<%= password %>" --client-credentials
29
30
30
31
cd ${OPENSEARCH_HOME}
31
32
chown -R vcap:vcap config plugins
32
- chown -R vcap:vcap ${OPENSEARCH_PATH_CONF} /opensearch-security
33
+ chown -R vcap:vcap " $OPENSEARCH_SECURITY_CONFIG_PATH "
33
34
34
35
# Prepare tenants, roles, and role mappings so that they don't get overridden by securityadmin.sh
35
36
# script invocation in post-start
36
37
for org in $( cf orgs | tail -n +4) ; do
37
38
ORG_GUID=$( cf org " $org " --guid)
38
39
ROLE_NAME=" $org -tenant"
39
40
40
- yq -i " .\" $org \" ={\" description\" :\" tenant for $org \" }" " $OPENSEARCH_PATH_CONF /opensearch-security /tenants.yml"
41
- yq -i " .\" $ROLE_NAME \" ={\" tenant_permissions\" :[{\" tenant_patterns\" : [\" $org \" ],\" allowed_actions\" : [\" kibana_all_write\" ]}]}" " $OPENSEARCH_PATH_CONF /opensearch-security /roles.yml"
42
- yq -i " .\" $ROLE_NAME \" ={\" backend_roles\" : [\" $ORG_GUID \" ]}" " $OPENSEARCH_PATH_CONF /opensearch-security /roles_mapping.yml"
41
+ yq -i " .\" $org \" ={\" description\" :\" tenant for $org \" }" " $OPENSEARCH_SECURITY_CONFIG_PATH /tenants.yml"
42
+ yq -i " .\" $ROLE_NAME \" ={\" tenant_permissions\" :[{\" tenant_patterns\" : [\" $org \" ],\" allowed_actions\" : [\" kibana_all_write\" ]}]}" " $OPENSEARCH_SECURITY_CONFIG_PATH /roles.yml"
43
+ yq -i " .\" $ROLE_NAME \" ={\" backend_roles\" : [\" $ORG_GUID \" ]}" " $OPENSEARCH_SECURITY_CONFIG_PATH /roles_mapping.yml"
43
44
done
44
45
45
46
# leaving all plugin files and plugins installed for now
0 commit comments