Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Fixed line break in multiple user data hosts entry. #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 55 additions & 24 deletions templates/splunk-enterprise.template
Original file line number Diff line number Diff line change
Expand Up @@ -741,18 +741,22 @@
"export SPLUNK_USER=splunk\n",
"export SPLUNK_BIN=/opt/splunk/bin/splunk\n",
"export SPLUNK_HOME=/opt/splunk\n",
"printf '%s\t%s\n' \"$LOCALIP\" 'splunksearch' >> /etc/hosts\n",
"printf '%s\t%s\\n' \"$LOCALIP\" 'splunksearch' >> /etc/hosts\n",
"hostname splunksearch\n",
"# Stop Splunk and reset password\n",
"service splunk stop\n",
"sed -i '/guid/d' $SPLUNK_HOME/etc/instance.cfg\n",
"touch $SPLUNK_HOME/etc/.ui_login\n",
"mv $SPLUNK_HOME/etc/passwd $SPLUNK_HOME/etc/passwd.bak\n",
"sed -i 's/force-change-pass true//' /etc/init.d/splunk\n",
"sed -i 's/ENFORCE_PWD_CHANGE=1//' /etc/init.d/splunk\n",
"# Force the Splunk startup script to run.\n",
"service splunk start\n",
"service splunk stop\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN edit user admin -password ",
{
"Ref": "SplunkAdminPassword"
},
" -role admin -auth admin:changeme\n",
" -role admin -auth admin:$INSTANCEID\n",
"# Increase splunkweb connection timeout with splunkd\n",
"mkdir -p $SPLUNK_HOME/etc/apps/base-autogenerated/local\n",
"cat >>$SPLUNK_HOME/etc/apps/base-autogenerated/local/web.conf <<end\n",
Expand All @@ -771,7 +775,6 @@
"indexAndForward = false\n",
"\n",
"[tcpout:indexer_cluster_peers]\n",
"autoLB = true\n",
"indexerDiscovery = cluster_master\n",
"\n",
"[indexer_discovery:cluster_master]\n",
Expand Down Expand Up @@ -858,6 +861,7 @@
""
]
},
"sudo -u $SPLUNK_USER $SPLUNK_BIN set servername splunksearch\n",
"service splunk restart\n",
"/opt/aws/bin/cfn-signal -e $? --stack ",
{
Expand Down Expand Up @@ -1032,18 +1036,22 @@
"export SPLUNK_USER=splunk\n",
"export SPLUNK_BIN=/opt/splunk/bin/splunk\n",
"export SPLUNK_HOME=/opt/splunk\n",
"printf '%s\t%s\n' \"$LOCALIP\" 'splunklicense' >> /etc/hosts\n",
"printf '%s\t%s\\n' \"$LOCALIP\" 'splunklicense' >> /etc/hosts\n",
"hostname splunklicense\n",
"# Stop Splunk and reset password\n",
"service splunk stop\n",
"sed -i '/guid/d' $SPLUNK_HOME/etc/instance.cfg\n",
"touch $SPLUNK_HOME/etc/.ui_login\n",
"mv $SPLUNK_HOME/etc/passwd $SPLUNK_HOME/etc/passwd.bak\n",
"sed -i 's/force-change-pass true//' /etc/init.d/splunk\n",
"sed -i 's/ENFORCE_PWD_CHANGE=1//' /etc/init.d/splunk\n",
"# Force the Splunk startup script to run.\n",
"service splunk start\n",
"service splunk stop\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN edit user admin -password ",
{
"Ref": "SplunkAdminPassword"
},
" -role admin -auth admin:changeme\n",
" -role admin -auth admin:$INSTANCEID\n",
"# Install files from the metadata\n",
"/opt/aws/bin/cfn-init -v ",
" --stack ",
Expand Down Expand Up @@ -1077,7 +1085,6 @@
"indexAndForward = false\n",
"\n",
"[tcpout:indexer_cluster_peers]\n",
"autoLB = true\n",
"indexerDiscovery = cluster_master\n",
"\n",
"[indexer_discovery:cluster_master]\n",
Expand Down Expand Up @@ -1181,6 +1188,7 @@
]
},
"chown -R $SPLUNK_USER:$SPLUNK_USER $SPLUNK_HOME/etc/master-apps\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN set servername splunklicence\n",
"service splunk restart\n",
"/opt/aws/bin/cfn-signal -e $? --stack ",
{
Expand Down Expand Up @@ -1309,18 +1317,22 @@
"export SPLUNK_USER=splunk\n",
"export SPLUNK_BIN=/opt/splunk/bin/splunk\n",
"export SPLUNK_HOME=/opt/splunk\n",
"printf '%s\t%s\n' \"$LOCALIP\" 'splunk-shc-deployer' >> /etc/hosts\n",
"printf '%s\t%s\\n' \"$LOCALIP\" 'splunk-shc-deployer' >> /etc/hosts\n",
"hostname splunk-shc-deployer\n",
"# Stop Splunk and reset password\n",
"service splunk stop\n",
"sed -i '/guid/d' $SPLUNK_HOME/etc/instance.cfg\n",
"touch $SPLUNK_HOME/etc/.ui_login\n",
"mv $SPLUNK_HOME/etc/passwd $SPLUNK_HOME/etc/passwd.bak\n",
"sed -i 's/force-change-pass true//' /etc/init.d/splunk\n",
"sed -i 's/ENFORCE_PWD_CHANGE=1//' /etc/init.d/splunk\n",
"# Force the Splunk startup script to run.\n",
"service splunk start\n",
"service splunk stop\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN edit user admin -password ",
{
"Ref": "SplunkAdminPassword"
},
" -role admin -auth admin:changeme\n",
" -role admin -auth admin:$INSTANCEID\n",
"# Increase splunkweb connection timeout with splunkd\n",
"mkdir -p $SPLUNK_HOME/etc/apps/base-autogenerated/local\n",
"cat >>$SPLUNK_HOME/etc/apps/base-autogenerated/local/web.conf <<end\n",
Expand Down Expand Up @@ -1350,7 +1362,6 @@
"indexAndForward = false\n",
"\n",
"[tcpout:indexer_cluster_peers]\n",
"autoLB = true\n",
"indexerDiscovery = cluster_master\n",
"\n",
"[indexer_discovery:cluster_master]\n",
Expand Down Expand Up @@ -1382,7 +1393,6 @@
"indexAndForward = false\n",
"\n",
"[tcpout:indexer_cluster_peers]\n",
"autoLB = true\n",
"indexerDiscovery = cluster_master\n",
"\n",
"[indexer_discovery:cluster_master]\n",
Expand Down Expand Up @@ -1439,6 +1449,7 @@
]
},
"chown -R $SPLUNK_USER:$SPLUNK_USER $SPLUNK_HOME/etc/shcluster/apps\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN set servername splunk-shc-deployer\n",
"service splunk start\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN edit licenser-localslave ",
"-master_uri https://",
Expand Down Expand Up @@ -1561,18 +1572,22 @@
"export SPLUNK_USER=splunk\n",
"export SPLUNK_BIN=/opt/splunk/bin/splunk\n",
"export SPLUNK_HOME=/opt/splunk\n",
"printf '%s\t%s\n' \"$LOCALIP\" 'splunksearch' >> /etc/hosts\n",
"printf '%s\t%s\\n' \"$LOCALIP\" 'splunksearch' >> /etc/hosts\n",
"hostname splunksearch\n",
"# Stop Splunk and reset password\n",
"service splunk stop\n",
"sed -i '/guid/d' $SPLUNK_HOME/etc/instance.cfg\n",
"touch $SPLUNK_HOME/etc/.ui_login\n",
"mv $SPLUNK_HOME/etc/passwd $SPLUNK_HOME/etc/passwd.bak\n",
"sed -i 's/force-change-pass true//' /etc/init.d/splunk\n",
"sed -i 's/ENFORCE_PWD_CHANGE=1//' /etc/init.d/splunk\n",
"# Force the Splunk startup script to run.\n",
"service splunk start\n",
"service splunk stop\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN edit user admin -password ",
{
"Ref": "SplunkAdminPassword"
},
" -role admin -auth admin:changeme\n",
" -role admin -auth admin:$INSTANCEID\n",
"# Increase splunkweb connection timeout with splunkd\n",
"cat >$SPLUNK_HOME/etc/system/local/web.conf <<end\n",
"[settings]\n",
Expand Down Expand Up @@ -1642,6 +1657,7 @@
"Ref": "SplunkClusterSecret"
},
"\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN set servername splunksearch\n",
"service splunk restart\n",
"/opt/aws/bin/cfn-signal -e $? --stack ",
{
Expand Down Expand Up @@ -1748,18 +1764,22 @@
"export SPLUNK_USER=splunk\n",
"export SPLUNK_BIN=/opt/splunk/bin/splunk\n",
"export SPLUNK_HOME=/opt/splunk\n",
"printf '%s\t%s\n' \"$LOCALIP\" 'splunksearch' >> /etc/hosts\n",
"printf '%s\t%s\\n' \"$LOCALIP\" 'splunksearch' >> /etc/hosts\n",
"hostname splunksearch\n",
"# Stop Splunk and reset password\n",
"service splunk stop\n",
"sed -i '/guid/d' $SPLUNK_HOME/etc/instance.cfg\n",
"touch $SPLUNK_HOME/etc/.ui_login\n",
"mv $SPLUNK_HOME/etc/passwd $SPLUNK_HOME/etc/passwd.bak\n",
"sed -i 's/force-change-pass true//' /etc/init.d/splunk\n",
"sed -i 's/ENFORCE_PWD_CHANGE=1//' /etc/init.d/splunk\n",
"# Force the Splunk startup script to run.\n",
"service splunk start\n",
"service splunk stop\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN edit user admin -password ",
{
"Ref": "SplunkAdminPassword"
},
" -role admin -auth admin:changeme\n",
" -role admin -auth admin:$INSTANCEID\n",
"# Increase splunkweb connection timeout with splunkd\n",
"cat >$SPLUNK_HOME/etc/system/local/web.conf <<end\n",
"[settings]\n",
Expand Down Expand Up @@ -1829,6 +1849,7 @@
"Ref": "SplunkClusterSecret"
},
"\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN set servername splunksearch\n",
"service splunk restart\n",
"/opt/aws/bin/cfn-signal -e $? --stack ",
{
Expand Down Expand Up @@ -1943,18 +1964,22 @@
"export SPLUNK_USER=splunk\n",
"export SPLUNK_BIN=/opt/splunk/bin/splunk\n",
"export SPLUNK_HOME=/opt/splunk\n",
"printf '%s\t%s\n' \"$LOCALIP\" 'splunksearch' >> /etc/hosts\n",
"printf '%s\t%s\\n' \"$LOCALIP\" 'splunksearch' >> /etc/hosts\n",
"hostname splunksearch\n",
"# Stop Splunk and reset password\n",
"service splunk stop\n",
"sed -i '/guid/d' $SPLUNK_HOME/etc/instance.cfg\n",
"touch $SPLUNK_HOME/etc/.ui_login\n",
"mv $SPLUNK_HOME/etc/passwd $SPLUNK_HOME/etc/passwd.bak\n",
"sed -i 's/force-change-pass true//' /etc/init.d/splunk\n",
"sed -i 's/ENFORCE_PWD_CHANGE=1//' /etc/init.d/splunk\n",
"# Force the Splunk startup script to run.\n",
"service splunk start\n",
"service splunk stop\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN edit user admin -password ",
{
"Ref": "SplunkAdminPassword"
},
" -role admin -auth admin:changeme\n",
" -role admin -auth admin:$INSTANCEID\n",
"# Increase splunkweb connection timeout with splunkd\n",
"cat >$SPLUNK_HOME/etc/system/local/web.conf <<end\n",
"[settings]\n",
Expand Down Expand Up @@ -2031,6 +2056,7 @@
"Ref": "SplunkClusterSecret"
},
"\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN set servername splunksearch\n",
"service splunk restart\n",
"# Bootstrap SHC captain\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN bootstrap shcluster-captain ",
Expand Down Expand Up @@ -2188,14 +2214,18 @@
"export SPLUNK_HOME=/opt/splunk\n",
"# Stop Splunk and reset password\n",
"service splunk stop\n",
"sed -i '/guid/d' $SPLUNK_HOME/etc/instance.cfg\n",
"touch $SPLUNK_HOME/etc/.ui_login\n",
"mv $SPLUNK_HOME/etc/passwd $SPLUNK_HOME/etc/passwd.bak\n",
"sed -i 's/force-change-pass true//' /etc/init.d/splunk\n",
"sed -i 's/ENFORCE_PWD_CHANGE=1//' /etc/init.d/splunk\n",
"# Force the Splunk startup script to run.\n",
"service splunk start\n",
"service splunk stop\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN edit user admin -password ",
{
"Ref": "SplunkAdminPassword"
},
" -role admin -auth admin:changeme\n",
" -role admin -auth admin:$INSTANCEID\n",
"# Increase splunkweb connection timeout with splunkd\n",
"mkdir -p $SPLUNK_HOME/etc/apps/base-autogenerated/local\n",
"cat >>$SPLUNK_HOME/etc/apps/base-autogenerated/local/web.conf <<end\n",
Expand Down Expand Up @@ -2265,6 +2295,7 @@
"Ref": "SplunkClusterSecret"
},
"\n",
"sudo -u $SPLUNK_USER $SPLUNK_BIN set servername indexer-$site\n",
"service splunk restart\n",
"/opt/aws/bin/cfn-signal -s true --stack ",
{
Expand Down