Fuel plugin for bare metal configuration and provisioning ready to deploy VMs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

post_install.sh 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2016 AT&T Inc.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  6. # not use this file except in compliance with the License. You may obtain
  7. # a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. # License for the specific language governing permissions and limitations
  15. # under the License.
  16. DEBUG=true
  17. REL_NAME='Ubuntu 14.04'
  18. FUEL='/usr/bin/fuel'
  19. REL=`$FUEL rel | grep -i "${REL_NAME}.* available " | awk '{print $1}'`
  20. FUEL_REL=`$FUEL rel | grep -i "${REL_NAME}.* available " | awk '{print $NF}'`
  21. function debug {
  22. if $DEBUG; then
  23. echo $@
  24. fi
  25. }
  26. function set_min_controller_count {
  27. count=$1
  28. workdir=$(mktemp -d /tmp/modifyenv.XXXX)
  29. local os_roles=(ceph-osd cinder compute controller cinder-block-device ironic mongo)
  30. for role in ${os_roles[@]}; do
  31. $FUEL role --rel $REL --role $role --file $workdir/${role}.yaml
  32. sed -i "s/ min: ./ min: ${count}/" $workdir/${role}.yaml
  33. $FUEL role --rel $REL --update --file $workdir/${role}.yaml
  34. done
  35. rm -rf $workdir
  36. }
  37. set_min_controller_count 0
  38. $FUEL rel --sync-deployment-tasks --dir /etc/puppet/$FUEL_REL