-
Notifications
You must be signed in to change notification settings - Fork 0
/
customize
executable file
·55 lines (42 loc) · 1.29 KB
/
customize
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/bash
PATH=/opt/local/gnu/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin
# Exit if any command fails
set -o errexit
RUNDECK_VERSION="3.4.10-20220118"
MYSQLJ_VERS="8.0.27"
echo "* Setup rundeck env"
groupadd -g 1100 rundeck
useradd -m -s /usr/bin/bash -d /opt/rundeck -u 1100 -g rundeck rundeck
passwd -N rundeck
passwd -d rundeck
cd /opt/rundeck
curl -LO https://download.qutic.com/src/rundeck/rundeck-${RUNDECK_VERSION}.war
mkdir -p /opt/rundeck/.ssh
mkdir -p /opt/rundeck/.snmp
cat >> /opt/rundeck/.snmp/snmp.conf << EOF
defVersion 3
defSecurityName snmp-v3-readwrite
defSecurityLevel authNoPriv
defAuthPassphrase securepwd
printValueOnly yes
quickPrinting yes
EOF
cat >> /opt/rundeck/.ssh/environment << EOF
PATH=/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin:/sbin
EOF
chown -R rundeck:rundeck /opt/rundeck
chmod 0700 /opt/rundeck/.ssh
chmod 0750 /opt/rundeck/.snmp
chmod 0640 /opt/rundeck/.snmp/snmp.conf
# create log-smlink for later usage
ln -nfs /opt/rundeck/server/logs /var/log/rundeck
# smf support
sed -i \
"s#rundeck-@VER@.war#rundeck-${RUNDECK_VERSION}.war#" \
/opt/local/lib/svc/method/rundeck
svccfg import /opt/local/lib/svc/manifest/rundeck.xml
# Clean up
echo "* Cleaning up."
rm /root/customize
# Prepare image for provisioning
sm-prepare-image -y