Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soctools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gn4-3-wp8-t3.1 SOC
soctools
Commits
9faf4455
Commit
9faf4455
authored
3 years ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
create script to ask variables interactively
parent
381a1590
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
configure.sh
+80
-0
80 additions, 0 deletions
configure.sh
group_vars/all/main.yml
+6
-2
6 additions, 2 deletions
group_vars/all/main.yml
group_vars/all/variables.template
+28
-0
28 additions, 0 deletions
group_vars/all/variables.template
with
114 additions
and
2 deletions
configure.sh
0 → 100755
+
80
−
0
View file @
9faf4455
#!/bin/bash
set
-e
if
[
-f
group_vars/all/variables.yml
]
;
then
echo
"Variables file (group_vars/all/variables.yml) is configure manually. please take a look if everything is correct and move to next step"
cat
group_vars/all/variables.yml
else
echo
"set FQDN which will be used to access the soctools services. (the DNS record should already be in place.)"
read
-p
'soctoolsproxy: '
soctoolsproxy
if
[
-z
$soctoolsproxy
]
;
then
echo
"Error: Empty string for soctoolsproxy! exiting..."
exit
1
fi
echo
echo
"Organization's top level domain (will be used as organization name and organization domain in different services)"
read
-p
'domain: '
domain
if
[
-z
$domain
]
;
then
echo
"Error: Empty string for domain! exiting..."
exit
1
fi
echo
echo
echo
echo
"Please provide following parameters for first socctolls user which will be created during the initialization with organization admin privileges:"
echo
"firstname - First name of the user"
echo
"lastname - Last name of the user"
echo
"username - Username of the user"
echo
"DN - Distinguished Name of the user, for user certificate"
echo
"CN - Common Name of the user, for user certificate"
echo
"Email will be generated automatically in Username@Domain format becouse of format restrictions in some services"
sleep
10
for
i
in
firstname lastname username DN CN
;
do
read
-p
"
${
i
}
: "
$i
if
[
-z
$i
]
;
then
echo
"Error: Empty string for
${
i
}
! exiting..."
exit
1
fi
done
echo
echo
echo
sleep
2
echo
"Please check the gethered variables and type 'yes' if everything is correct: "
echo
"soctoolsproxy:
$soctoolsproxy
"
echo
"domain:
$domain
"
echo
"firstname:
$firstname
"
echo
"lastname:
$lastname
"
echo
"username:
$username
"
echo
"DN:
$DN
"
echo
"CN:
$CN
"
echo
echo
sleep
10
read
-p
"Correct? type 'yes' or 'no': "
ANSWER
if
[
$ANSWER
=
"yes"
]
;
then
if
!
[
-f
group_vars/all/variables.template
]
;
then
echo
"template file(group_vars/all/variables.template) does not exists! exiting ..."
exit
1
else
cp
-f
group_vars/all/variables.template group_vars/all/variables.yml
sed
-i
"s/CHANGE_ME_TO_FQDN/
${
soctoolsproxy
}
/g"
group_vars/all/variables.yml
sed
-i
"s/soctools.test/
${
domain
}
/g"
group_vars/all/variables.yml
sed
-i
"11s/soc_admin/
${
firstname
}
/"
group_vars/all/variables.yml
sed
-i
"12s/SOC/
${
lastname
}
/"
group_vars/all/variables.yml
sed
-i
"13s/soc_admin/
${
username
}
/"
group_vars/all/variables.yml
sed
-i
"14s/soc_admin/
${
username
}
/"
group_vars/all/variables.yml
sed
-i
"15s/SOC_Admin/
${
DN
}
/"
group_vars/all/variables.yml
sed
-i
"16s/SOC_Admin/
${
CN
}
/"
group_vars/all/variables.yml
sed
-i
"26s/soc_admin/
${
username
}
/"
group_vars/all/variables.yml
echo
echo
echo
"variables file generated (group_vars/all/variables.yml)"
sleep
2
echo
"move to next command to deploy the soctools cluster."
echo
'Thank You!'
fi
else
echo
"Exiting based of user input ..."
exit
0
fi
fi
This diff is collapsed.
Click to expand it.
group_vars/all/main.yml
+
6
−
2
View file @
9faf4455
---
soctoolsproxy
:
"
CHANGE_ME_TO_FQDN"
maxmind_key
:
"
"
docker_build_dir
:
"
{{playbook_dir}}/build"
...
...
@@ -15,6 +13,12 @@ suffix: a20201004
kibana_plugins_version
:
"
v0.7"
THEHIVE_KIBANA_USER
:
username
:
"
kibana"
name
:
"
Kibana"
surname
:
"
User"
roles
:
'
["read",
"write"]'
haproxy_name
:
"
soctools-haproxy"
haproxy_version
:
"
2.2"
haproxy_img
:
"
{{repo}}/haproxy:{{version}}{{suffix}}"
...
...
This diff is collapsed.
Click to expand it.
group_vars/all/variables.template
0 → 100644
+
28
−
0
View file @
9faf4455
---
# set FQDN which will be used to access the soctools services. (the DNS record should already be in place.)
soctoolsproxy: "CHANGE_ME_TO_FQDN"
# Organization's top level domain (will be used as organization name and organization domain in different services)
domain: "soctools.test"
#List of users which will be created during the initialization with organization admin privileges
soctools_users:
- firstname: "soc_admin"
lastname: "SOC"
username: "soc_admin"
email: "soc_admin@{{domain}}"
DN: "CN=SOC_Admin"
CN: "SOC_Admin"
# - firstname: "soc_admin_2"
# lastname: "SOC"
# username: "soc_admin_2"
# email: "soc_admin_2@{{domain}}"
# DN: "CN=SOC_Admin_2"
# CN: "SOC_Admin_2"
# list of users(username) from previous step which will recive admin roles in ODFE. (Minimum one user is required)
ODFE_ADMIN_USERS:
- soc_admin
# - soc_admin_2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment