Skip to content

Commit

Permalink
Add checks to make sure that the subscription manager is not already …
Browse files Browse the repository at this point in the history
…enabled.

Add ability to set monitor_interface and public_network values (as opposed
to using hard coded values)

This change should be squashed with the previous change before merging this
pull request

Signed-off-by: Warren Usui <[email protected]>
  • Loading branch information
Warren Usui committed Jul 29, 2016
1 parent 69c12e8 commit e061d8d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
8 changes: 8 additions & 0 deletions qa/qa_scripts/openstack/ceph_install_w_ansible/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

ceph_install.sh installs a ceph cluster using the cdn and ceph-ansible.

Right now, it takes 5 parameters -- an admin node, a ceph mon node, and
Expand All @@ -9,6 +10,13 @@ secrets, (~/secrets), that contains the following lines:
subscrname=Your-Redhat-Cdn-Id
subscrpassword=Your-Redhat-Cdn-Password

If you want to set the monitor_interface or the public_network values,
in your home directory create a file named ip_info (~/ip_info), that
contains the following lines:

mon_intf=your-monitor-interface (default is eno1)
pub_netw=public-network (default is 10.8.128.0/21)

This script first subscribes to the cdn, enables the rhel 7 repos, and does
a yum update. (multi_action.sh performs all the actions on all nodes at once,
staller.sh is used to make sure that all updates are complete before exiting,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ copy_file execs/ceph_ansible.sh $adminnode . 0777 ubuntu:ubuntu
copy_file execs/edit_ansible_hosts.sh $adminnode . 0777 ubuntu:ubuntu
copy_file execs/edit_groupvars_osds.sh $adminnode . 0777 ubuntu:ubuntu
copy_file ../execs/ceph-pool-create.sh $monnode . 0777 ubuntu:ubuntu
if [ -e ~/ip_info ]; then
copy_file ~/ip_info $adminnode . 0777 ubuntu:ubuntu
fi
ssh $adminnode ./ceph_ansible.sh $cephnodes
20 changes: 14 additions & 6 deletions qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
if [ -f ~/secrets ]; then
source ~/secrets
fi
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ 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: eno1/' 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: 10.8.128.0\/21/' 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
Expand Down

0 comments on commit e061d8d

Please sign in to comment.