-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansible-bootstrap.sh
31 lines (26 loc) · 1.2 KB
/
ansible-bootstrap.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
#!/usr/bin/env bash
#sudo apt-add-repository ppa:ansible/ansible-2.6
#sudo apt-get update
sudo apt-get install ansible -y
sudo apt-get install -y python-pip
sudo -H pip install --upgrade pip
cp /vagrant_data/id_e* /home/vagrant/.ssh/
#ssh-keyscan -H -t ecdsa-sha2-nistp256 mon1 >> ~/.ssh/known_hosts
#ssh-keyscan -H -t ecdsa-sha2-nistp256 mon2 >> ~/.ssh/known_hosts
#ssh-keyscan -H -t ecdsa-sha2-nistp256 mon3 >> ~/.ssh/known_hosts
#ssh-keyscan -H -t ecdsa-sha2-nistp256 osd1 >> ~/.ssh/known_hosts
#ssh-keyscan -H -t ecdsa-sha2-nistp256 osd2 >> ~/.ssh/known_hosts
#ssh-keyscan -H -t ecdsa-sha2-nistp256 osd3 >> ~/.ssh/known_hosts
sudo cp /vagrant_data/ansible-hosts /etc/ansible/hosts
git clone https://github.com/ceph/ceph-ansible.git
cd ceph-ansible
git checkout stable-3.2
sudo -H pip install -r /home/vagrant/ceph-ansible/requirements.txt
#sudo mkdir /etc/ansible/fetch
mkdir /home/vagrant/ceph-ansible/fetch
#sudo chown vagrant /etc/ansible/fetch
ln -s /vagrant_data/osds.yml /home/vagrant/ceph-ansible/group_vars
ln -s /vagrant_data/all.yml /home/vagrant/ceph-ansible/group_vars
mv /home/vagrant/ceph-ansible/site.yml.sample /home/vagrant/ceph-ansible/site.yml
cd /home/vagrant/ceph-ansible
ansible-playbook ./site.yml