diff options
Diffstat (limited to 'qa/qa_scripts/openstack/ceph_install_w_ansible/execs')
4 files changed, 86 insertions, 0 deletions
diff --git a/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh new file mode 100755 index 000000000..0c87039db --- /dev/null +++ b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh @@ -0,0 +1,20 @@ +#! /usr/bin/env bash +if [ -f ~/secrets ]; then + source ~/secrets +fi +subm=`which subscription-manager` +if [ ${#subm} -eq 0 ]; then + sudo yum -y update + exit +fi +subst=`sudo subscription-manager status | grep "^Overall" | awk '{print $NF}'` +if [ $subst == 'Unknown' ]; then + mynameis=${subscrname:-'inigomontoya'} + mypassis=${subscrpassword:-'youkeelmyfatherpreparetodie'} + sudo subscription-manager register --username=$mynameis --password=$mypassis --force + sudo subscription-manager refresh + if [ $? -eq 1 ]; then exit 1; fi + sudo subscription-manager attach --pool=8a85f9823e3d5e43013e3ddd4e2a0977 +fi +sudo subscription-manager repos --enable=rhel-7-server-rpms +sudo yum -y update diff --git a/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/ceph_ansible.sh b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/ceph_ansible.sh new file mode 100755 index 000000000..8581de601 --- /dev/null +++ b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/ceph_ansible.sh @@ -0,0 +1,36 @@ +#! /usr/bin/env bash +cephnodes=$* +monnode=$1 +sudo yum -y install ceph-ansible +cd +sudo ./edit_ansible_hosts.sh $cephnodes +mkdir ceph-ansible-keys +cd /usr/share/ceph-ansible/group_vars/ +if [ -f ~/ip_info ]; then + source ~/ip_info +fi +mon_intf=${mon_intf:-'eno1'} +pub_netw=${pub_netw:-'10.8.128.0\/21'} +sudo cp all.sample all +sudo sed -i 's/#ceph_origin:.*/ceph_origin: distro/' all +sudo sed -i 's/#fetch_directory:.*/fetch_directory: ~\/ceph-ansible-keys/' all +sudo sed -i 's/#ceph_stable:.*/ceph_stable: true/' all +sudo sed -i 's/#ceph_stable_rh_storage:.*/ceph_stable_rh_storage: false/' all +sudo sed -i 's/#ceph_stable_rh_storage_cdn_install:.*/ceph_stable_rh_storage_cdn_install: true/' all +sudo sed -i 's/#cephx:.*/cephx: true/' all +sudo sed -i "s/#monitor_interface:.*/monitor_interface: ${mon_intf}/" all +sudo sed -i 's/#journal_size:.*/journal_size: 1024/' all +sudo sed -i "s/#public_network:.*/public_network: ${pub_netw}/" all +sudo cp osds.sample osds +sudo sed -i 's/#fetch_directory:.*/fetch_directory: ~\/ceph-ansible-keys/' osds +sudo sed -i 's/#crush_location:/crush_location:/' osds +sudo sed -i 's/#osd_crush_location:/osd_crush_location:/' osds +sudo sed -i 's/#cephx:/cephx:/' osds +sudo sed -i 's/#devices:/devices:/' osds +sudo sed -i 's/#journal_collocation:.*/journal_collocation: true/' osds +cd +sudo ./edit_groupvars_osds.sh +cd /usr/share/ceph-ansible +sudo cp site.yml.sample site.yml +ansible-playbook site.yml +ssh $monnode ~/ceph-pool-create.sh diff --git a/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/edit_ansible_hosts.sh b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/edit_ansible_hosts.sh new file mode 100755 index 000000000..7eb0b7011 --- /dev/null +++ b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/edit_ansible_hosts.sh @@ -0,0 +1,17 @@ +#! /usr/bin/env bash +ed /etc/ansible/hosts << EOF +$ +a + +[mons] +${1} + +[osds] +${2} +${3} +${4} + +. +w +q +EOF diff --git a/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/edit_groupvars_osds.sh b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/edit_groupvars_osds.sh new file mode 100755 index 000000000..751658b09 --- /dev/null +++ b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/edit_groupvars_osds.sh @@ -0,0 +1,13 @@ +#! /usr/bin/env bash +ed /usr/share/ceph-ansible/group_vars/osds << EOF +$ +/^devices: +.+1 +i + - /dev/sdb + - /dev/sdc + - /dev/sdd +. +w +q +EOF |