-
Notifications
You must be signed in to change notification settings - Fork 0
/
slave_bootstrap.txt
26 lines (23 loc) · 1.83 KB
/
slave_bootstrap.txt
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
#!/bin/bash
aws s3 cp s3://ansible-test-kaiyuan/id_rsa_control.pub ~/.ssh
cat ~/.ssh/id_rsa_control.pub >> ~/.ssh/authorized_keys
ssh-keygen -f ~/.ssh/id_rsa_slave -t rsa -N ''
aws s3 cp ~/.ssh/id_rsa_slave.pub s3://ansible-test-kaiyuan
slave_ip=`curl http://169.254.169.254/latest/meta-data/local-ipv4`; echo ${slave_ip}" slave" > host_slave
aws s3 cp host_slave s3://ansible-test-kaiyuan
aws s3 cp s3://ansible-test-kaiyuan/host_control ~
cat ~/host_control >> /etc/hosts
awk '{print "Host "$1}' ~/host_control >> ~/.ssh/config; echo -e "User root\nIdentityFile ~/.ssh/id_rsa_slave" >> ~/.ssh/config
echo -e "Host control\nUser root\nIdentityFile ~/.ssh/id_rsa_slave" >> ~/.ssh/config
mkdir /var/lib/truecall
chmod 777 /var/lib/truecall
touch ~/init_done
# Install Base System Software
#yum groupinstall --downloadonly @core @debugging @development @hardware-monitoring @large-systems @performance @postgresql @security-tools @web-server @hardware-monitoring @large-systems @system-admin-tools @system-management @system-management-snmp \
--setopt=group_package_types=mandatory,default,optional --downloaddir=/root
yum groupinstall -y @core @debugging @development @hardware-monitoring @large-systems @performance @postgresql @security-tools @web-server @hardware-monitoring @large-systems @system-admin-tools @system-management @system-management-snmp \
--setopt=group_package_types=mandatory,default,optional
#yum install --downloadonly chrony python-psycopg2 httpd-tools libICE libSM libicu libyaml mailcap python-markupsafe perl-Archive-Zip protobuf libunwind sysfsutils lynx base install htop iftop --downloaddir=/root
yum install -y chrony python-psycopg2 httpd-tools libICE libSM libicu libyaml mailcap python-markupsafe perl-Archive-Zip protobuf libunwind sysfsutils lynx base install htop iftop \
ncurses-compat-libs postgresql postgresql-server
yum update -y