-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·60 lines (40 loc) · 999 Bytes
/
deploy.sh
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
56
57
#!/bin/bash
yum install epel-release -y
yum install ansible -y
yum install -y https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
yum install -y pdsh
cat > /etc/ansible/hosts <<EOF
[mons]
ceph-mon[1:3]
[osds]
ceph-osd[1:3]
[mdss]
ceph-mds[1:2]
EOF
cat >> /etc/hosts <<EOF
10.0.15.11 ceph-mon1
10.0.15.12 ceph-mon2
10.0.15.13 ceph-mon3
10.0.15.21 ceph-osd1
10.0.15.22 ceph-osd2
10.0.15.23 ceph-osd3
10.0.15.31 ceph-mds1
10.0.15.32 ceph-mds2
EOF
cat > /etc/profile.d/pdsh.sh <<EOF
export PDSH_RCMD_TYPE='ssh'
export WCOLL='/etc/pdsh/machines'
EOF
mkdir -p /etc/pdsh
grep 10.0. /etc/hosts | awk '{print $2}' > /etc/pdsh/machines
ssh-keygen -t rsa
for i in `grep 10.0.15 /etc/hosts | awk '{print $2}'`; do
ssh-keyscan $i;
done > ~/.ssh/known_hosts
ansible-playbook ssh_key.yml --ask-pass
./edit_ceph-ansible-master.sh
#cd ceph-ansible-master
#cp site.yml.sample site.yml
#ansible-playbook site.yml
#ansible-playbook site.yml
## expect to run site.yml mulltiple times