Advertisement
Guest User

Untitled

a guest
Apr 20th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #!/bin/bash
  2. # Copyright (C) 2011-2013 OpenStack Foundation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  13. # implied.
  14. #
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17.  
  18. set -e
  19.  
  20. SUDO=${SUDO:-true}
  21. THIN=${THIN:-true}
  22. ALL_MYSQL_PRIVS=${ALL_MYSQL_PRIVS:-false}
  23.  
  24. if [ -n "$NODEPOOL_SSH_KEY" ] ; then
  25. puppet_install_users="install_users => false,
  26. ssh_key => '$NODEPOOL_SSH_KEY',"
  27. else
  28. puppet_install_users=""
  29. fi
  30.  
  31. #Disable using unbound because it causes our network connections to fail
  32. export FACTER_in_chroot=true
  33. cat >/tmp/local.pp <<EOF
  34. Service {
  35. start => '/bin/true',
  36. stop => '/bin/true',
  37. status => '/bin/true',
  38. restart => '/bin/true'
  39. }
  40. class {'openstack_project::single_use_slave':
  41. sudo => $SUDO,
  42. thin => $THIN,
  43. all_mysql_privs => $ALL_MYSQL_PRIVS,
  44. install_resolv_conf => false,
  45. enable_unbound => false,
  46. $puppet_install_users
  47. }
  48. EOF
  49.  
  50. # Puppet doesn't return nonzero if some things fail by default.
  51. # Use detailed exit codes to get that info and determine whether
  52. # the return code indicates failure.
  53. set +e
  54. puppet apply --detailed-exitcodes --color=false \
  55. --modulepath=/opt/build_git/openstack-infra/system-config/modules:/etc/puppet/modules \
  56. /tmp/local.pp
  57. PUPPET_RETURN=$?
  58. if [ "$PUPPET_RETURN" -eq 4 ] || [ "$PUPPET_RETURN" -eq 6 ] ; then
  59. exit $PUPPET_RETURN
  60. fi
  61. set -e
  62.  
  63. # We're not using unboud, so this isn't needed either
  64. # Make sure resolv.conf settings don't break dib
  65. # echo "nameserver $NODEPOOL_STATIC_NAMESERVER"> /etc/resolv.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement