sbunciak

OpenShift Origin

May 14th, 2013
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 53.98 KB | None | 0 0
  1. # Synchronize the system clock to the NTP servers and then synchronize
  2. # hardware clock with that.
  3. synchronize_clock()
  4. {
  5.   # Synchronize the system clock using NTP.
  6.   ntpdate clock.redhat.com
  7.  
  8.   # Synchronize the hardware clock to the system clock.
  9.   hwclock --systohc
  10. }
  11.  
  12.  
  13. # Install SSH keys. We hardcode a key used for internal OpenShift
  14. # development, but the hardcoded key can be replaced with another or
  15. # with a wget command to download a key from elsewhere.
  16. install_ssh_keys()
  17. {
  18.   mkdir -p /root/.ssh
  19.   chmod 700 /root/.ssh
  20.   cat >> /root/.ssh/authorized_keys << KEYS
  21. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkMc2jArUbWICi0071HXrt5uofQam11duqo5KEDWUZGtHuMTzuoZ0XEtzpqoRSidya9HjbJ5A4qUJBrvLZ07l0OIjENQ0Kvz83alVGFrEzVVUSZyiy6+yM9Ksaa/XAYUwCibfaFFqS9aVpVdY0qwaKrxX1ycTuYgNAw3WUvkHagdG54/79M8BUkat4uNiot0bKg6VLSI1QzNYV6cMJeOzz7WzHrJhbPrgXNKmgnAwIKQOkbATYB+YmDyHpA4m/O020dWDk9vWFmlxHLZqddCVGAXFyQnXoFTszFP4wTVOu1q2MSjtPexujYjTbBBxraKw9vrkE25YZJHvbZKMsNm2b libra_onprem
  22. KEYS
  23. }
  24.  
  25.  
  26. configure_rhel_repo()
  27. {
  28.   # In order for the %post section to succeed, it must have a way of
  29.   # installing from RHEL. The post section cannot access the method that
  30.   # was used in the base install. This configures a RHEL yum repo which
  31.   # you must supply.
  32. #  cat > /etc/yum.repos.d/rhel.repo <<YUM
  33. #[rhel6]
  34. #name=RHEL 6 base OS
  35. #baseurl=${CONF_RHEL_REPO}
  36. #enabled=1
  37. #gpgcheck=0
  38. #priority=2
  39. #sslverify=false
  40. #exclude=tomcat6*
  41. #
  42. #YUM
  43. }
  44.  
  45. configure_optional_repo()
  46. {
  47. #  cat > /etc/yum.repos.d/rheloptional.repo <<YUM
  48. #[rhel6_optional]
  49. #name=RHEL 6 Optional
  50. #baseurl=${CONF_RHEL_OPTIONAL_REPO}
  51. #enabled=1
  52. #gpgcheck=0
  53. #priority=2
  54. #sslverify=false
  55. #
  56. #YUM
  57. }
  58.  
  59. configure_client_tools_repo()
  60. {
  61.   # Enable repo with the puddle for broker packages.
  62. #  cat > /etc/yum.repos.d/openshift-client.repo <<YUM
  63. #[openshift_client]
  64. #name=OpenShift Client
  65. #baseurl=${CONF_REPOS_BASE}/Client/x86_64/os/
  66. #enabled=1
  67. #gpgcheck=0
  68. #priority=1
  69. #sslverify=false
  70. #
  71. #YUM
  72. }
  73.  
  74. configure_broker_repo()
  75. {
  76.   # Enable repo with the puddle for broker packages.
  77. #  cat > /etc/yum.repos.d/openshift-infrastructure.repo <<YUM
  78. #[openshift_infrastructure]
  79. #name=OpenShift Infrastructure
  80. #baseurl=${CONF_REPOS_BASE}/Infrastructure/x86_64/os/
  81. #enabled=1
  82. #gpgcheck=0
  83. #priority=1
  84. #sslverify=false
  85. #
  86. #YUM
  87. }
  88.  
  89. configure_node_repo()
  90. {
  91.   # Enable repo with the puddle for node packages.
  92. #  cat > /etc/yum.repos.d/openshift-node.repo <<YUM
  93. #[openshift_node]
  94. #name=OpenShift Node
  95. #baseurl=${CONF_REPOS_BASE}/Node/x86_64/os/
  96. #enabled=1
  97. #gpgcheck=0
  98. #priority=1
  99. #sslverify=false
  100. #
  101. #YUM
  102. }
  103.  
  104. configure_jbosseap_cartridge_repo()
  105. {
  106.   # Enable repo with the puddle for the JBossEAP cartridge package.
  107. #  cat > /etc/yum.repos.d/openshift-jboss.repo <<YUM
  108. #[openshift_jbosseap]
  109. #name=OpenShift JBossEAP
  110. #baseurl=${CONF_REPOS_BASE}/JBoss_EAP6_Cartridge/x86_64/os/
  111. #enabled=1
  112. #gpgcheck=0
  113. #priority=1
  114. #sslverify=false
  115. #
  116. #YUM
  117. }
  118.  
  119. configure_jbosseap_repo()
  120. {
  121.   # The JBossEAP cartridge depends on Red Hat's JBoss packages.
  122. #
  123. #  if [ "x${CONF_JBOSS_REPO_BASE}" != "x" ]
  124. #  then
  125.   ## configure JBossEAP repo
  126. #    cat <<YUM > /etc/yum.repos.d/jbosseap.repo
  127. #[jbosseap]
  128. #name=jbosseap
  129. #baseurl=${CONF_JBOSS_REPO_BASE}/jbeap/6/os
  130. #enabled=1
  131. #priority=3
  132. #gpgcheck=0
  133. #
  134. #YUM
  135. #
  136. #  fi
  137. }
  138.  
  139. configure_jbossews_repo()
  140. {
  141.   # The JBossEWS cartridge depends on Red Hat's JBoss packages.
  142. #  if [ "x${CONF_JBOSS_REPO_BASE}" != "x" ]
  143. #  then
  144.   ## configure JBossEWS repo
  145. #    cat <<YUM > /etc/yum.repos.d/jbossews.repo
  146. #[jbossews]
  147. #name=jbossews
  148. #baseurl=${CONF_JBOSS_REPO_BASE}/jbews/2/os
  149. #enabled=1
  150. #priority=3
  151. #gpgcheck=0
  152. #
  153. #YUM
  154. #
  155. #  fi
  156. }
  157.  
  158. yum_install_or_exit()
  159. {
  160.   yum install $*
  161.   if [ $? -ne 0 ]
  162.   then
  163. echo "yum install failed; aborting installation. Please ensure you have configured the relevant repos/subscriptions."
  164.     exit 1
  165.   fi
  166. }
  167.  
  168. # Install the client tools.
  169. install_rhc_pkg()
  170. {
  171.   yum install -y rhc
  172.   # set up the system express.conf so this broker will be used by default
  173.   echo -e "\nlibra_server = '${broker_hostname}'" >> /etc/openshift/express.conf
  174. }
  175.  
  176. # Install broker-specific packages.
  177. install_broker_pkgs()
  178. {
  179.   pkgs="openshift-origin-broker"
  180.   pkgs="$pkgs openshift-origin-broker-util"
  181.   pkgs="$pkgs rubygem-openshift-origin-msg-broker-mcollective"
  182.   pkgs="$pkgs rubygem-openshift-origin-auth-remote-user"
  183.   pkgs="$pkgs rubygem-openshift-origin-dns-nsupdate"
  184.   pkgs="$pkgs openshift-origin-console"
  185.  
  186.   yum_install_or_exit -y $pkgs
  187. }
  188.  
  189. # Currently, ruby193-rubygem-passenger-native creates
  190. # /usr/var/log/passenger-analytics as its log directory, but our
  191. # software expects it to be at /var/log/passenger-analytics, and the
  192. # broker doesn't work if this folder isn't present and
  193. # accessible. This function fixes that.
  194. fix_passenger()
  195. {
  196.   mkdir /var/log/passenger-analytics
  197.   chmod 750 /var/log/passenger-analytics
  198.   chown apache:apache /var/log/passenger-analytics
  199. }
  200.  
  201. # Install node-specific packages.
  202. install_node_pkgs()
  203. {
  204.   pkgs="rubygem-openshift-origin-node ruby193-rubygem-passenger-native"
  205.   pkgs="$pkgs openshift-origin-port-proxy"
  206.   pkgs="$pkgs openshift-origin-node-util"
  207.   # We use semanage in this script, so we need to install
  208.   # policycoreutils-python.
  209.   pkgs="$pkgs policycoreutils-python"
  210.  
  211.   yum_install_or_exit -y $pkgs
  212. }
  213.  
  214. # Install any cartridges developers may want.
  215. install_cartridges()
  216. {
  217.   # Following are cartridge rpms that one may want to install here:
  218.   if is_true "$node_v2_enable"
  219.   then
  220.     # Embedded cron support. This is required on node hosts.
  221.     carts="openshift-origin-cartridge-cron"
  222.  
  223.     # diy app.
  224.     carts="$carts openshift-origin-cartridge-diy"
  225.  
  226.     # haproxy support.
  227.     carts="$carts openshift-origin-cartridge-haproxy"
  228.  
  229.     # JBossEWS support.
  230.     # Note: Be sure to subscribe to the JBossEWS entitlements during the
  231.     # base install or in configure_jbossews_repo.
  232.     carts="$carts openshift-origin-cartridge-jbossews"
  233.  
  234.     # JBossEAP support.
  235.     # Note: Be sure to subscribe to the JBossEAP entitlements during the
  236.     # base install or in configure_jbosseap_repo.
  237.     carts="$carts openshift-origin-cartridge-jbosseap"
  238.  
  239.     # Jenkins server for continuous integration.
  240.     carts="$carts openshift-origin-cartridge-jenkins"
  241.  
  242.     # Embedded jenkins client.
  243.     carts="$carts openshift-origin-cartridge-jenkins-client"
  244.  
  245.     # Embedded MySQL.
  246.     carts="$carts openshift-origin-cartridge-mysql"
  247.  
  248.     # mod_perl support.
  249.     carts="$carts openshift-origin-cartridge-perl"
  250.  
  251.     # PHP support.
  252.     carts="$carts openshift-origin-cartridge-php"
  253.  
  254.     # Embedded PostgreSQL.
  255.     carts="$carts openshift-origin-cartridge-postgresql"
  256.  
  257.     # Python support.
  258.     carts="$carts openshift-origin-cartridge-python"
  259.  
  260.     # Ruby Rack support running on Phusion Passenger
  261.     carts="$carts openshift-origin-cartridge-ruby"
  262.   else
  263.     # Embedded cron support. This is required on node hosts.
  264.     carts="openshift-origin-cartridge-cron-1.4"
  265.  
  266.     # diy app.
  267.     carts="$carts openshift-origin-cartridge-diy-0.1"
  268.  
  269.     # haproxy-1.4 support.
  270.     carts="$carts openshift-origin-cartridge-haproxy-1.4"
  271.  
  272.     # JBossEWS1.0 support.
  273.     # Note: Be sure to subscribe to the JBossEWS entitlements during the
  274.     # base install or in configure_jbossews_repo.
  275.     carts="$carts openshift-origin-cartridge-jbossews-1.0"
  276.  
  277.     # JBossEAP6.0 support.
  278.     # Note: Be sure to subscribe to the JBossEAP entitlements during the
  279.     # base install or in configure_jbosseap_repo.
  280.     carts="$carts openshift-origin-cartridge-jbosseap-6.0"
  281.  
  282.     # Jenkins server for continuous integration.
  283.     carts="$carts openshift-origin-cartridge-jenkins-1.4"
  284.  
  285.     # Embedded jenkins client.
  286.     carts="$carts openshift-origin-cartridge-jenkins-client-1.4"
  287.  
  288.     # Embedded MySQL.
  289.     carts="$carts openshift-origin-cartridge-mysql-5.1"
  290.  
  291.     # mod_perl support.
  292.     carts="$carts openshift-origin-cartridge-perl-5.10"
  293.  
  294.     # PHP 5.3 support.
  295.     carts="$carts openshift-origin-cartridge-php-5.3"
  296.  
  297.     # Embedded PostgreSQL.
  298.     carts="$carts openshift-origin-cartridge-postgresql-8.4"
  299.  
  300.     # Python 2.6 support.
  301.     carts="$carts openshift-origin-cartridge-python-2.6"
  302.  
  303.     # Ruby Rack support running on Phusion Passenger (Ruby 1.8).
  304.     carts="$carts openshift-origin-cartridge-ruby-1.8"
  305.  
  306.     # Ruby Rack support running on Phusion Passenger (Ruby 1.9).
  307.     carts="$carts openshift-origin-cartridge-ruby-1.9-scl"
  308.   fi
  309.  
  310.   # When dependencies are missing, e.g. JBoss subscriptions,
  311.   # still install as much as possible.
  312.   carts="$carts --skip-broken"
  313.  
  314.   yum install -y $carts
  315. }
  316.  
  317. # Fix up SELinux policy on the broker.
  318. configure_selinux_policy_on_broker()
  319. {
  320.   # We combine these setsebool commands into a single semanage command
  321.   # because separate commands take a long time to run.
  322.   (
  323.     # Allow console application to access executable and writable memory
  324.     echo boolean -m --on httpd_execmem
  325.  
  326.     # Allow the broker to write files in the http file context.
  327.     echo boolean -m --on httpd_unified
  328.  
  329.     # Allow the broker to access the network.
  330.     echo boolean -m --on httpd_can_network_connect
  331.     echo boolean -m --on httpd_can_network_relay
  332.  
  333.     # Enable some passenger-related permissions.
  334.     #
  335.     # The name may change at some future point, at which point we will
  336.     # need to delete the httpd_run_stickshift line below and enable the
  337.     # httpd_run_openshift line.
  338.     echo boolean -m --on httpd_run_stickshift
  339.     #echo boolean -m --on httpd_run_openshift
  340.  
  341.     # Allow the broker to communicate with the named service.
  342.     echo boolean -m --on allow_ypbind
  343.   ) | semanage -i -
  344.  
  345.   fixfiles -R ruby193-rubygem-passenger restore
  346.   fixfiles -R ruby193-mod_passenger restore
  347.  
  348.   restorecon -rv /var/run
  349.   # This should cover everything in the SCL, including passenger
  350.   restorecon -rv /opt
  351. }
  352.  
  353. # Fix up SELinux policy on the node.
  354. configure_selinux_policy_on_node()
  355. {
  356.   # We combine these setsebool commands into a single semanage command
  357.   # because separate commands take a long time to run.
  358.   (
  359.     # Allow the node to write files in the http file context.
  360.     echo boolean -m --on httpd_unified
  361.  
  362.     # Allow the node to access the network.
  363.     echo boolean -m --on httpd_can_network_connect
  364.     echo boolean -m --on httpd_can_network_relay
  365.  
  366.     # Allow httpd on the node to read gear data.
  367.     #
  368.     # The name may change at some future point, at which point we will
  369.     # need to delete the httpd_run_stickshift line below and enable the
  370.     # httpd_run_openshift line.
  371.     echo boolean -m --on httpd_run_stickshift
  372.     #echo boolean -m --on httpd_run_openshift
  373.     echo boolean -m --on httpd_read_user_content
  374.     echo boolean -m --on httpd_enable_homedirs
  375.  
  376.     # Enable polyinstantiation for gear data.
  377.     echo boolean -m --on allow_polyinstantiation
  378.   ) | semanage -i -
  379.  
  380.  
  381.   restorecon -rv /var/run
  382.   restorecon -rv /usr/sbin/mcollectived /var/log/mcollective.log /var/run/mcollectived.pid
  383.   restorecon -rv /var/lib/openshift /etc/openshift/node.conf /etc/httpd/conf.d/openshift
  384. }
  385.  
  386. configure_pam_on_node()
  387. {
  388.   sed -i -e 's|pam_selinux|pam_openshift|g' /etc/pam.d/sshd
  389.  
  390.   for f in "runuser" "runuser-l" "sshd" "su" "system-auth-ac"
  391.   do
  392. t="/etc/pam.d/$f"
  393.     if ! grep -q "pam_namespace.so" "$t"
  394.     then
  395. echo -e "session\t\trequired\tpam_namespace.so no_unmount_on_close" >> "$t"
  396.     fi
  397. done
  398.  
  399.   # if the user does not exist on the system an error will show up in
  400.   # /var/log/secure.
  401.   user_list="root,adm,apache"
  402.   for user in gdm activemq mongodb; do
  403. id -u "$user" >/dev/null 2>&1
  404.       if [ X"$?" == X"0" ]; then
  405. user_list="${user_list},${user}"
  406.       fi
  407. done
  408. echo "/tmp \$HOME/.tmp/ user:iscript=/usr/sbin/oo-namespace-init ${user_list}" > /etc/security/namespace.d/tmp.conf
  409.   echo "/dev/shm tmpfs tmpfs:mntopts=size=5M:iscript=/usr/sbin/oo-namespace-init ${user_list}" > /etc/security/namespace.d/shm.conf
  410. }
  411.  
  412. configure_cgroups_on_node()
  413. {
  414.   cp -vf /opt/rh/ruby193/root/usr/share/gems/doc/openshift-origin-node-*/cgconfig.conf /etc/cgconfig.conf
  415.   restorecon -rv /etc/cgconfig.conf
  416.   mkdir -p /cgroup
  417.   restorecon -rv /cgroup
  418.   chkconfig cgconfig on
  419.   chkconfig cgred on
  420.   chkconfig openshift-cgroups on
  421. }
  422.  
  423. configure_quotas_on_node()
  424. {
  425.   # Get the mountpoint for /var/lib/openshift (should be /).
  426.   geardata_mnt=$(df -P /var/lib/openshift 2>/dev/null | tail -n 1 | awk '{ print $6 }')
  427.  
  428.   if ! [ x"$geardata_mnt" != x ]
  429.   then
  430. echo 'Could not enable quotas for gear data: unable to determine mountpoint.'
  431.   else
  432.     # Enable user quotas for the device housing /var/lib/openshift.
  433.     sed -i -e "/^[^[:blank:]]\\+[[:blank:]]\\+${geardata_mnt////\/\\+[[:blank:]]}/{/usrquota/! s/[[:blank:]]\\+/,usrquota&/4;}" /etc/fstab
  434.  
  435.     # Remount to get quotas enabled immediately.
  436.     mount -o remount "${geardata_mnt}"
  437.  
  438.     # Generate user quota info for the mount point.
  439.     quotacheck -cmug "${geardata_mnt}"
  440.  
  441.     # fix up selinux perms
  442.     restorecon "${geardata_mnt}"aquota.user
  443.  
  444.     # (re)enable quotas
  445.     quotaon "${geardata_mnt}"
  446.   fi
  447. }
  448.  
  449. # Turn some sysctl knobs.
  450. configure_sysctl_on_node()
  451. {
  452.   # Increase kernel semaphores to accomodate many httpds.
  453.   echo "kernel.sem = 250 32000 32 4096" >> /etc/sysctl.conf
  454.  
  455.   # Move ephemeral port range to accommodate app proxies.
  456.   echo "net.ipv4.ip_local_port_range = 15000 35530" >> /etc/sysctl.conf
  457.  
  458.   # Increase the connection tracking table size.
  459.   echo "net.netfilter.nf_conntrack_max = 1048576" >> /etc/sysctl.conf
  460.  
  461.   # Reload sysctl.conf to get the new settings.
  462.   #
  463.   # Note: We could add -e here to ignore errors that are caused by
  464.   # options appearing in sysctl.conf that correspond to kernel modules
  465.   # that are not yet loaded. On the other hand, adding -e might cause
  466.   # us to miss some important error messages.
  467.   sysctl -p /etc/sysctl.conf
  468. }
  469.  
  470.  
  471. configure_sshd_on_node()
  472. {
  473.   # Configure sshd to pass the GIT_SSH environment variable through.
  474.   echo 'AcceptEnv GIT_SSH' >> /etc/ssh/sshd_config
  475.  
  476.   # Up the limits on the number of connections to a given node.
  477.   perl -p -i -e "s/^#MaxSessions .*$/MaxSessions 40/" /etc/ssh/sshd_config
  478.   perl -p -i -e "s/^#MaxStartups .*$/MaxStartups 40/" /etc/ssh/sshd_config
  479. }
  480.  
  481. # Configure MongoDB datastore.
  482. configure_datastore()
  483. {
  484.   # Install MongoDB.
  485.   yum_install_or_exit -y mongodb-server
  486.  
  487.   # Require authentication.
  488.   perl -p -i -e "s/^#auth = .*$/auth = true/" /etc/mongodb.conf
  489.  
  490.   # Use a smaller default size for databases.
  491.   if [ "x`fgrep smallfiles=true /etc/mongodb.conf`x" != "xsmallfiles=truex" ]
  492.   then
  493. echo 'smallfiles=true' >> /etc/mongodb.conf
  494.   fi
  495.  
  496.   # Iff mongod is running on a separate host from the broker, open up
  497.   # the firewall to allow the broker host to connect.
  498.   if broker
  499.   then
  500. echo 'The broker and data store are on the same host.'
  501.     echo 'Skipping firewall and mongod configuration;'
  502.     echo 'mongod will only be accessible over localhost).'
  503.   else
  504. echo 'The broker and data store are on separate hosts.'
  505.  
  506.     echo 'Configuring the firewall to allow connections to mongod...'
  507.     lokkit --nostart --port=27017:tcp
  508.  
  509.     echo 'Configuring mongod to listen on external interfaces...'
  510.     perl -p -i -e "s/^bind_ip = .*$/bind_ip = 0.0.0.0/" /etc/mongodb.conf
  511.   fi
  512.  
  513.   # Configure mongod to start on boot.
  514.   chkconfig mongod on
  515.  
  516.   # Start mongod so we can perform some administration now.
  517.   service mongod start
  518.  
  519.   # The init script lies to us as of version 2.0.2-1.el6_3: The start
  520.   # and restart actions return before the daemon is ready to accept
  521.   # connections (appears to take time to initialize the journal). Thus
  522.   # we need the following to wait until the daemon is really ready.
  523.   echo "Waiting for MongoDB to start ($(date +%H:%M:%S))..."
  524.   while :
  525.   do
  526. echo exit | mongo && break
  527. sleep 5
  528.   done
  529. echo "MongoDB is ready! ($(date +%H:%M:%S))"
  530.  
  531.   if is_false "$CONF_NO_DATASTORE_AUTH_FOR_LOCALHOST"
  532.   then
  533.     # Add an administrative user and a user that the broker will use.
  534.     mongo <<EOF
  535. use admin
  536. db.addUser("${mongodb_admin_user}", "${mongodb_admin_password}")
  537.  
  538. db.auth("${mongodb_admin_user}", "${mongodb_admin_password}")
  539.  
  540. use ${mongodb_name}
  541. db.addUser("${mongodb_broker_user}", "${mongodb_broker_password}")
  542. EOF
  543.   else
  544.     # Add a user that the broker will use.
  545.     mongo <<EOF
  546. use ${mongodb_name}
  547. db.addUser("${mongodb_broker_user}", "${mongodb_broker_password}")
  548. EOF
  549.   fi
  550. }
  551.  
  552.  
  553. # Open up services required on the node for apps and developers.
  554. configure_port_proxy()
  555. {
  556.   lokkit --nostart --port=35531-65535:tcp
  557.  
  558.   chkconfig openshift-port-proxy on
  559. }
  560.  
  561. configure_gears()
  562. {
  563.   # Make sure that gears are restarted on reboot.
  564.   chkconfig openshift-gears on
  565. }
  566.  
  567.  
  568. # Enable services to start on boot for the node.
  569. enable_services_on_node()
  570. {
  571.   # We use --nostart below because activating the configuration here
  572.   # will produce errors. Anyway, we only need the configuration
  573.   # activated Anaconda reboots, so --nostart makes sense in any case.
  574.  
  575.   lokkit --nostart --service=ssh
  576.   lokkit --nostart --service=https
  577.   lokkit --nostart --service=http
  578.  
  579.   # Allow connections to openshift-node-web-proxy
  580.   lokkit --nostart --port=8000:tcp
  581.   lokkit --nostart --port=8443:tcp
  582.  
  583.   chkconfig httpd on
  584.   chkconfig network on
  585.   is_false "$CONF_NO_NTP" && chkconfig ntpd on
  586.   chkconfig sshd on
  587.   chkconfig oddjobd on
  588.   chkconfig openshift-node-web-proxy on
  589. }
  590.  
  591.  
  592. # Enable services to start on boot for the broker and fix up some issues.
  593. enable_services_on_broker()
  594. {
  595.   # We use --nostart below because activating the configuration here
  596.   # will produce errors. Anyway, we only need the configuration
  597.   # activated after Anaconda reboots, so --nostart makes sense.
  598.  
  599.   lokkit --nostart --service=ssh
  600.   lokkit --nostart --service=https
  601.   lokkit --nostart --service=http
  602.  
  603.   chkconfig httpd on
  604.   chkconfig network on
  605.   is_false "$CONF_NO_NTP" && chkconfig ntpd on
  606.   chkconfig sshd on
  607.  
  608.   # Remove VirtualHost from the default ssl.conf to prevent a warning
  609.    sed -i '/VirtualHost/,/VirtualHost/ d' /etc/httpd/conf.d/ssl.conf
  610.  
  611.   # make sure mcollective client log is created with proper ownership.
  612.   # if root owns it, the broker (apache user) can't log to it.
  613.   touch /var/log/mcollective-client.log
  614.   chown apache:root /var/log/mcollective-client.log
  615. }
  616.  
  617.  
  618. # Configure mcollective on the broker to use qpid.
  619. configure_mcollective_for_qpid_on_broker()
  620. {
  621.   yum_install_or_exit -y mcollective-client
  622.  
  623.   cat <<EOF > /etc/mcollective/client.cfg
  624. topicprefix = /topic/
  625. main_collective = mcollective
  626. collectives = mcollective
  627. libdir = /opt/rh/ruby193/root/usr/libexec/mcollective
  628. loglevel = debug
  629. logfile = /var/log/mcollective-client.log
  630.  
  631. # Plugins
  632. securityprovider = psk
  633. plugin.psk = unset
  634. connector = qpid
  635. plugin.qpid.host = ${broker_hostname}
  636. plugin.qpid.secure = false
  637. plugin.qpid.timeout = 5
  638.  
  639. # Facts
  640. factsource = yaml
  641. plugin.yaml = /etc/mcollective/facts.yaml
  642. EOF
  643.  
  644. }
  645.  
  646.  
  647. # Configure mcollective on the broker to use qpid.
  648. configure_mcollective_for_qpid_on_node()
  649. {
  650.   yum_install_or_exit -y mcollective openshift-origin-msg-node-mcollective
  651.  
  652.   cat <<EOF > /etc/mcollective/server.cfg
  653. topicprefix = /topic/
  654. main_collective = mcollective
  655. collectives = mcollective
  656. libdir = /opt/rh/ruby193/root/usr/libexec/mcollective
  657. logfile = /var/log/mcollective.log
  658. loglevel = debug
  659. daemonize = 1
  660. direct_addressing = n
  661.  
  662. # Plugins
  663. securityprovider = psk
  664. plugin.psk = unset
  665. connector = qpid
  666. plugin.qpid.host = ${broker_hostname}
  667. plugin.qpid.secure = false
  668. plugin.qpid.timeout = 5
  669.  
  670. # Facts
  671. factsource = yaml
  672. plugin.yaml = /etc/mcollective/facts.yaml
  673. EOF
  674.  
  675.   chkconfig mcollective on
  676. }
  677.  
  678.  
  679. # Configure mcollective on the broker to use ActiveMQ.
  680. configure_mcollective_for_activemq_on_broker()
  681. {
  682.   yum_install_or_exit -y mcollective-client
  683.  
  684.   cat <<EOF > /etc/mcollective/client.cfg
  685. topicprefix = /topic/
  686. main_collective = mcollective
  687. collectives = mcollective
  688. libdir = /opt/rh/ruby193/root/usr/libexec/mcollective
  689. logfile = /var/log/mcollective-client.log
  690. loglevel = debug
  691.  
  692. # Plugins
  693. securityprovider=psk
  694. plugin.psk=unset
  695.  
  696. connector = stomp
  697. plugin.stomp.host = ${activemq_hostname}
  698. plugin.stomp.port = 61613
  699. plugin.stomp.user = ${mcollective_user}
  700. plugin.stomp.password = ${mcollective_password}
  701. EOF
  702. }
  703.  
  704.  
  705. # Configure mcollective on the node to use ActiveMQ.
  706. configure_mcollective_for_activemq_on_node()
  707. {
  708.   yum_install_or_exit -y mcollective openshift-origin-msg-node-mcollective
  709.  
  710.   cat <<EOF > /etc/mcollective/server.cfg
  711. topicprefix = /topic/
  712. main_collective = mcollective
  713. collectives = mcollective
  714. libdir = /opt/rh/ruby193/root/usr/libexec/mcollective
  715. logfile = /var/log/mcollective.log
  716. loglevel = debug
  717. daemonize = 1
  718. direct_addressing = n
  719. registerinterval = 30
  720.  
  721. # Plugins
  722. securityprovider = psk
  723. plugin.psk = unset
  724.  
  725. connector = stomp
  726. plugin.stomp.host = ${activemq_hostname}
  727. plugin.stomp.port = 61613
  728. plugin.stomp.user = ${mcollective_user}
  729. plugin.stomp.password = ${mcollective_password}
  730.  
  731. # Facts
  732. factsource = yaml
  733. plugin.yaml = /etc/mcollective/facts.yaml
  734. EOF
  735.  
  736.   chkconfig mcollective on
  737. }
  738.  
  739.  
  740. # Configure ActiveMQ.
  741. configure_activemq()
  742. {
  743.   # Install the service.
  744.   yum_install_or_exit -y activemq
  745.  
  746.   cat <<EOF > /etc/activemq/activemq.xml
  747. <!--
  748. Licensed to the Apache Software Foundation (ASF) under one or more
  749. contributor license agreements. See the NOTICE file distributed with
  750. this work for additional information regarding copyright ownership.
  751. The ASF licenses this file to You under the Apache License, Version 2.0
  752. (the "License"); you may not use this file except in compliance with
  753. the License. You may obtain a copy of the License at
  754.  
  755. http://www.apache.org/licenses/LICENSE-2.0
  756.  
  757. Unless required by applicable law or agreed to in writing, software
  758. distributed under the License is distributed on an "AS IS" BASIS,
  759. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  760. See the License for the specific language governing permissions and
  761. limitations under the License.
  762. -->
  763. <beans
  764. xmlns="http://www.springframework.org/schema/beans"
  765. xmlns:amq="http://activemq.apache.org/schema/core"
  766. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  767. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  768. http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
  769.  
  770. <!-- Allows us to use system properties as variables in this configuration file -->
  771. <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  772. <property name="locations">
  773. <value>file:\${activemq.conf}/credentials.properties</value>
  774. </property>
  775. </bean>
  776.  
  777. <!--
  778. The <broker> element is used to configure the ActiveMQ broker.
  779. -->
  780. <broker xmlns="http://activemq.apache.org/schema/core" brokerName="${activemq_hostname}" dataDirectory="\${activemq.data}">
  781.  
  782. <!--
  783. For better performances use VM cursor and small memory limit.
  784. For more information, see:
  785.  
  786. http://activemq.apache.org/message-cursors.html
  787.  
  788. Also, if your producer is "hanging", it's probably due to producer flow control.
  789. For more information, see:
  790. http://activemq.apache.org/producer-flow-control.html
  791. -->
  792.  
  793. <destinationPolicy>
  794. <policyMap>
  795. <policyEntries>
  796. <policyEntry topic=">" producerFlowControl="true" memoryLimit="1mb">
  797. <pendingSubscriberPolicy>
  798. <vmCursor />
  799. </pendingSubscriberPolicy>
  800. </policyEntry>
  801. <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
  802. <!-- Use VM cursor for better latency
  803. For more information, see:
  804.  
  805. http://activemq.apache.org/message-cursors.html
  806.  
  807. <pendingQueuePolicy>
  808. <vmQueueCursor/>
  809. </pendingQueuePolicy>
  810. -->
  811. </policyEntry>
  812. </policyEntries>
  813. </policyMap>
  814. </destinationPolicy>
  815.  
  816.  
  817. <!--
  818. The managementContext is used to configure how ActiveMQ is exposed in
  819. JMX. By default, ActiveMQ uses the MBean server that is started by
  820. the JVM. For more information, see:
  821.  
  822. http://activemq.apache.org/jmx.html
  823. -->
  824. <managementContext>
  825. <managementContext createConnector="false"/>
  826. </managementContext>
  827.  
  828. <!--
  829. Configure message persistence for the broker. The default persistence
  830. mechanism is the KahaDB store (identified by the kahaDB tag).
  831. For more information, see:
  832.  
  833. http://activemq.apache.org/persistence.html
  834. -->
  835. <persistenceAdapter>
  836. <kahaDB directory="\${activemq.data}/kahadb"/>
  837. </persistenceAdapter>
  838.  
  839. <!-- add users for mcollective -->
  840.  
  841. <plugins>
  842. <statisticsBrokerPlugin/>
  843. <simpleAuthenticationPlugin>
  844. <users>
  845. <authenticationUser username="${mcollective_user}" password="${mcollective_password}" groups="mcollective,everyone"/>
  846. <authenticationUser username="admin" password="${activemq_admin_password}" groups="mcollective,admin,everyone"/>
  847. </users>
  848. </simpleAuthenticationPlugin>
  849. <authorizationPlugin>
  850. <map>
  851. <authorizationMap>
  852. <authorizationEntries>
  853. <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
  854. <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
  855. <authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
  856. <authorizationEntry queue="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
  857. <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
  858. </authorizationEntries>
  859. </authorizationMap>
  860. </map>
  861. </authorizationPlugin>
  862. </plugins>
  863.  
  864. <!--
  865. The systemUsage controls the maximum amount of space the broker will
  866. use before slowing down producers. For more information, see:
  867. http://activemq.apache.org/producer-flow-control.html
  868. If using ActiveMQ embedded - the following limits could safely be used:
  869.  
  870. <systemUsage>
  871. <systemUsage>
  872. <memoryUsage>
  873. <memoryUsage limit="20 mb"/>
  874. </memoryUsage>
  875. <storeUsage>
  876. <storeUsage limit="1 gb"/>
  877. </storeUsage>
  878. <tempUsage>
  879. <tempUsage limit="100 mb"/>
  880. </tempUsage>
  881. </systemUsage>
  882. </systemUsage>
  883. -->
  884. <systemUsage>
  885. <systemUsage>
  886. <memoryUsage>
  887. <memoryUsage limit="64 mb"/>
  888. </memoryUsage>
  889. <storeUsage>
  890. <storeUsage limit="100 gb"/>
  891. </storeUsage>
  892. <tempUsage>
  893. <tempUsage limit="50 gb"/>
  894. </tempUsage>
  895. </systemUsage>
  896. </systemUsage>
  897.  
  898. <!--
  899. The transport connectors expose ActiveMQ over a given protocol to
  900. clients and other brokers. For more information, see:
  901.  
  902. http://activemq.apache.org/configuring-transports.html
  903. -->
  904. <transportConnectors>
  905. <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
  906. <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
  907. </transportConnectors>
  908.  
  909. </broker>
  910.  
  911. <!--
  912. Enable web consoles, REST and Ajax APIs and demos
  913.  
  914. Take a look at \${ACTIVEMQ_HOME}/conf/jetty.xml for more details
  915. -->
  916. <import resource="jetty.xml"/>
  917.  
  918. </beans>
  919. <!-- END SNIPPET: example -->
  920. EOF
  921.  
  922.  # secure the ActiveMQ console
  923.  sed -i -e '/name="authenticate"/s/false/true/' /etc/activemq/jetty.xml
  924.  
  925.  # only add the host property if it's not already there
  926.   # (so you can run the script multiple times)
  927.   grep '<property name="host" value="127.0.0.1" />' /etc/activemq/jetty.xml > /dev/null
  928.   if [ $? -ne 0 ]; then
  929. sed -i -e '/name="port"/a<property name="host" value="127.0.0.1" />' /etc/activemq/jetty.xml
  930.   fi
  931.  
  932. sed -i -e "/admin:/s/admin,/${activemq_admin_password},/" /etc/activemq/jetty-realm.properties
  933.  
  934.  
  935.   # Allow connections to ActiveMQ.
  936.   lokkit --nostart --port=61613:tcp
  937.  
  938.   # Configure ActiveMQ to start on boot.
  939.   chkconfig activemq on
  940. }
  941.  
  942.  
  943. # Configure qpid. Deprecated for ActiveMQ.
  944. configure_qpid()
  945. {
  946.   if [[ "x`fgrep auth= /etc/qpidd.conf`" == xauth* ]]
  947.   then
  948. sed -i -e 's/auth=yes/auth=no/' /etc/qpidd.conf
  949.   else
  950. echo "auth=no" >> /etc/qpidd.conf
  951.   fi
  952.  
  953.   # Allow connections to qpidd.
  954.   lokkit --nostart --port=5672:tcp
  955.  
  956.   # Configure qpidd to start on boot.
  957.   chkconfig qpidd on
  958. }
  959.  
  960.  
  961. # Configure BIND.
  962. configure_named()
  963. {
  964.   yum_install_or_exit -y bind bind-utils
  965.  
  966.   # $keyfile will contain a new DNSSEC key for our domain.
  967.   keyfile=/var/named/${domain}.key
  968.  
  969.   if [ "x$bind_key" = x ]
  970.   then
  971.     # Generate the new key for the domain.
  972.     pushd /var/named
  973.     rm -f /var/named/K${domain}*
  974.     dnssec-keygen -a HMAC-MD5 -b 512 -n USER -r /dev/urandom ${domain}
  975.     bind_key="$(grep Key: K${domain}*.private | cut -d ' ' -f 2)"
  976.     popd
  977. fi
  978.  
  979.   # Ensure we have a key for service named status to communicate with BIND.
  980.   rndc-confgen -a -r /dev/urandom
  981.   restorecon /etc/rndc.* /etc/named.*
  982.   chown root:named /etc/rndc.key
  983.   chmod 640 /etc/rndc.key
  984.  
  985.   # Set up DNS forwarding.
  986.   cat <<EOF > /var/named/forwarders.conf
  987. forwarders { ${nameservers} } ;
  988. EOF
  989.   restorecon /var/named/forwarders.conf
  990.   chmod 644 /var/named/forwarders.conf
  991.  
  992.   # Install the configuration file for the OpenShift Enterprise domain
  993.   # name.
  994.   rm -rf /var/named/dynamic
  995.   mkdir -p /var/named/dynamic
  996.  
  997.  
  998.   # Create the initial BIND database.
  999.   nsdb=/var/named/dynamic/${domain}.db
  1000.   cat <<EOF > $nsdb
  1001. \$ORIGIN .
  1002. \$TTL 1 ; 1 seconds (for testing only)
  1003. ${domain} IN SOA ${named_hostname}. hostmaster.${domain}. (
  1004. 2011112904 ; serial
  1005. 60 ; refresh (1 minute)
  1006. 15 ; retry (15 seconds)
  1007. 1800 ; expire (30 minutes)
  1008. 10 ; minimum (10 seconds)
  1009. )
  1010. NS ${named_hostname}.
  1011. MX 10 mail.${domain}.
  1012. \$ORIGIN ${domain}.
  1013. ${named_hostname%.${domain}} A ${named_ip_addr}
  1014. EOF
  1015.  
  1016.   # Add A records any other components that are being installed locally.
  1017.   broker && echo "${broker_hostname%.${domain}} A ${broker_ip_addr}" >> $nsdb
  1018.   node && echo "${node_hostname%.${domain}} A ${node_ip_addr}${nl}" >> $nsdb
  1019.   activemq && echo "${activemq_hostname%.${domain}} A ${cur_ip_addr}${nl}" >> $nsdb
  1020.   datastore && echo "${datastore_hostname%.${domain}} A ${cur_ip_addr}${nl}" >> $nsdb
  1021.   echo >> $nsdb
  1022.  
  1023.   # Install the key for the OpenShift Enterprise domain.
  1024.   cat <<EOF > /var/named/${domain}.key
  1025. key ${domain} {
  1026. algorithm HMAC-MD5;
  1027. secret "${bind_key}";
  1028. };
  1029. EOF
  1030.  
  1031.   chown named:named -R /var/named
  1032.   restorecon -rv /var/named
  1033.  
  1034.   # Replace named.conf.
  1035.   cat <<EOF > /etc/named.conf
  1036. // named.conf
  1037. //
  1038. // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
  1039. // server as a caching only nameserver (as a localhost DNS resolver only).
  1040. //
  1041. // See /usr/share/doc/bind*/sample/ for example named configuration files.
  1042. //
  1043.  
  1044. options {
  1045. listen-on port 53 { any; };
  1046. directory "/var/named";
  1047. dump-file "/var/named/data/cache_dump.db";
  1048. statistics-file "/var/named/data/named_stats.txt";
  1049. memstatistics-file "/var/named/data/named_mem_stats.txt";
  1050. allow-query { any; };
  1051. recursion yes;
  1052.  
  1053. /* Path to ISC DLV key */
  1054. bindkeys-file "/etc/named.iscdlv.key";
  1055.  
  1056. // set forwarding to the next nearest server (from DHCP response
  1057. forward only;
  1058. include "forwarders.conf";
  1059. };
  1060.  
  1061. logging {
  1062. channel default_debug {
  1063. file "data/named.run";
  1064. severity dynamic;
  1065. };
  1066. };
  1067.  
  1068. // use the default rndc key
  1069. include "/etc/rndc.key";
  1070. controls {
  1071. inet 127.0.0.1 port 953
  1072. allow { 127.0.0.1; } keys { "rndc-key"; };
  1073. };
  1074.  
  1075. include "/etc/named.rfc1912.zones";
  1076.  
  1077. include "${domain}.key";
  1078.  
  1079. zone "${domain}" IN {
  1080. type master;
  1081. file "dynamic/${domain}.db";
  1082. allow-update { key ${domain} ; } ;
  1083. };
  1084. EOF
  1085.   chown root:named /etc/named.conf
  1086.   chcon system_u:object_r:named_conf_t:s0 -v /etc/named.conf
  1087.  
  1088.   # Configure named to start on boot.
  1089.   lokkit --nostart --service=dns
  1090.   chkconfig named on
  1091.  
  1092.   # Start named so we can perform some updates immediately.
  1093.   service named start
  1094. }
  1095.  
  1096.  
  1097. # Make resolv.conf point to our named service, which will resolve the
  1098. # host names used in this installation of OpenShift. Our named service
  1099. # will forward other requests to some other DNS servers.
  1100. update_resolv_conf()
  1101. {
  1102.   # Update resolv.conf to use our named.
  1103.   #
  1104.   # We will keep any existing entries so that we have fallbacks that
  1105.   # will resolve public addresses even when our private named is
  1106.   # nonfunctional. However, our private named must appear first in
  1107.   # order for hostnames private to our OpenShift PaaS to resolve.
  1108.   sed -i -e "1i# The named we install for our OpenShift PaaS must appear first.\\nnameserver ${named_ip_addr}\\n" /etc/resolv.conf
  1109. }
  1110.  
  1111.  
  1112. # Update the controller configuration.
  1113. configure_controller()
  1114. {
  1115.   if [ "x$broker_auth_salt" = "x" ]
  1116.   then
  1117. echo "Warning: broker authentication salt is empty!"
  1118.   fi
  1119.  
  1120.   # Configure the console with the correct domain
  1121.   sed -i -e "s/^DOMAIN_SUFFIX=.*$/DOMAIN_SUFFIX=${domain}/" \
  1122.       /etc/openshift/console.conf
  1123.  
  1124.   # Configure the broker with the correct hostname, and use random salt
  1125.   # to the data store (the host running MongoDB).
  1126.   sed -i -e "s/^CLOUD_DOMAIN=.*$/CLOUD_DOMAIN=${domain}/" \
  1127.       /etc/openshift/broker.conf
  1128.   echo AUTH_SALT=${broker_auth_salt} >> /etc/openshift/broker.conf
  1129.  
  1130.   if ! datastore
  1131.   then
  1132.     #mongo not installed locally, so point to given hostname
  1133.     sed -i -e "s/^MONGO_HOST_PORT=.*$/MONGO_HOST_PORT=\"${datastore_hostname}:27017\"/" /etc/openshift/broker.conf
  1134.   fi
  1135.  
  1136.   # configure MongoDB access
  1137.   sed -i -e "s/MONGO_PASSWORD=.*$/MONGO_PASSWORD=\"${mongodb_broker_password}\"/
  1138. s/MONGO_USER=.*$/MONGO_USER=\"${mongodb_broker_user}\"/
  1139. s/MONGO_DB=.*$/MONGO_DB=\"${mongodb_name}\"/" \
  1140.       /etc/openshift/broker.conf
  1141.  
  1142.   # Configure the broker service to start on boot.
  1143.   chkconfig openshift-broker on
  1144.   chkconfig openshift-console on
  1145. }
  1146.  
  1147. # Configure the broker to use the remote-user authentication plugin.
  1148. configure_remote_user_auth_plugin()
  1149. {
  1150.   cp /etc/openshift/plugins.d/openshift-origin-auth-remote-user.conf{.example,}
  1151. }
  1152.  
  1153. # Configure the broker to use the MongoDB-based authentication plugin.
  1154. #
  1155. # NB: It is assumed that configure_datastore has previously been run on
  1156. # this host to install and configure MongoDB.
  1157. configure_mongo_auth_plugin()
  1158. {
  1159.   cp /etc/openshift/plugins.d/openshift-origin-auth-mongo.conf{.example,}
  1160.  
  1161.   if ! datastore
  1162.   then
  1163.     # MongoDB is running on a remote host, so we must modify the
  1164.     # plug-in configuration to point it to that host.
  1165.     sed -i -e "s/^MONGO_HOST_PORT=.*$/MONGO_HOST_PORT=\"${datastore_hostname}:27017\"/" /etc/openshift/plugins.d/openshift-origin-auth-mongo.conf
  1166.   fi
  1167.  
  1168.   # We must specify the --host, --username, and --password options iff the
  1169.   # datastore is being installed on the current host.
  1170.   if datastore
  1171.   then
  1172. mongo_opts=""
  1173.   else
  1174. mongo_opts="--host ${datastore_hostname} --username openshift --password mooo"
  1175.   fi
  1176.  
  1177.   # The init script is broken as of version 2.0.2-1.el6_3: The start
  1178.   # and restart actions return before the daemon is ready to accept
  1179.   # connections (it appears to take time to initialize the journal).
  1180.   # Thus we need the following hack to wait until the daemon is ready.
  1181.   echo "Waiting for MongoDB to start ($(date +%H:%M:%S))..."
  1182.   while :
  1183.   do
  1184. echo exit | mongo $mongo_opts && break
  1185. sleep 5
  1186.   done
  1187. echo "MongoDB is ready! ($(date +%H:%M:%S))"
  1188.  
  1189.   hashed_password="$(printf 'admin' | md5sum -b | cut -d' ' -f1)"
  1190.   hashed_salted_password="$(printf '%s' "$hashed_password$broker_auth_salt" | md5sum | cut -d' ' -f1)"
  1191.  
  1192.   # Add user "admin" with password "admin" for oo-register-user.
  1193.   mongo $mongodb_name $mongo_opts --eval 'db.auth_user.update({"_id":"admin"}, {"_id":"admin","user":"admin","password":"'"$hashed_salted_password"'"}, true)'
  1194. }
  1195.  
  1196. configure_messaging_plugin()
  1197. {
  1198.   cp /etc/openshift/plugins.d/openshift-origin-msg-broker-mcollective.conf{.example,}
  1199. }
  1200.  
  1201. # Configure the broker to use the BIND DNS plug-in.
  1202. configure_dns_plugin()
  1203. {
  1204.   if [ "x$bind_key" = x ]
  1205.   then
  1206. echo 'WARNING: No key has been set for communication with BIND.'
  1207.     echo 'You will need to modify the value of BIND_KEYVALUE in'
  1208.     echo '/etc/openshift/plugins.d/openshift-origin-dns-nsupdate.conf'
  1209.     echo 'after installation.'
  1210.   fi
  1211.  
  1212. mkdir -p /etc/openshift/plugins.d
  1213.   cat <<EOF > /etc/openshift/plugins.d/openshift-origin-dns-nsupdate.conf
  1214. BIND_SERVER="${named_ip_addr}"
  1215. BIND_PORT=53
  1216. BIND_KEYNAME="${domain}"
  1217. BIND_KEYVALUE="${bind_key}"
  1218. BIND_ZONE="${domain}"
  1219. EOF
  1220. }
  1221.  
  1222. # Configure httpd for authentication.
  1223. configure_httpd_auth()
  1224. {
  1225.   # Install the Apache configuration file.
  1226.   cp /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user-basic.conf.sample \
  1227.      /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf
  1228.  
  1229.   cp /var/www/openshift/console/httpd/conf.d/openshift-origin-auth-remote-user-basic.conf.sample \
  1230.      /var/www/openshift/console/httpd/conf.d/openshift-origin-auth-remote-user.conf
  1231.  
  1232.   # The above configuration file configures Apache to use
  1233.   # /etc/openshift/htpasswd for its password file.
  1234.   #
  1235.   # Here we create a test user:
  1236.   htpasswd -bc /etc/openshift/htpasswd "$openshift_user1" "$openshift_password1"
  1237.   #
  1238.   # Use the following command to add more users:
  1239.   #
  1240.   # htpasswd /etc/openshift/htpasswd username
  1241.  
  1242.   # TODO: In the future, we will want to edit
  1243.   # /etc/openshift/plugins.d/openshift-origin-auth-remote-user.conf to
  1244.   # put in a random salt.
  1245. }
  1246.  
  1247. # if the broker and node are on the same machine we need to manually update the
  1248. # nodes.db
  1249. fix_broker_routing()
  1250. {
  1251.   cat <<EOF >> /var/lib/openshift/.httpd.d/nodes.txt
  1252. __default__ REDIRECT:/console
  1253. __default__/console TOHTTPS:127.0.0.1:8118/console
  1254. __default__/broker TOHTTPS:127.0.0.1:8080/broker
  1255. EOF
  1256.  
  1257.   httxt2dbm -f DB -i /etc/httpd/conf.d/openshift/nodes.txt -o /etc/httpd/conf.d/openshift/nodes.db
  1258.   chown root:apache /etc/httpd/conf.d/openshift/nodes.txt /etc/httpd/conf.d/openshift/nodes.db
  1259.   chmod 750 /etc/httpd/conf.d/openshift/nodes.txt /etc/httpd/conf.d/openshift/nodes.db
  1260. }
  1261.  
  1262. configure_access_keys_on_broker()
  1263. {
  1264.   # Generate a broker access key for remote apps (Jenkins) to access
  1265.   # the broker.
  1266.   openssl genrsa -out /etc/openshift/server_priv.pem 2048
  1267.   openssl rsa -in /etc/openshift/server_priv.pem -pubout > /etc/openshift/server_pub.pem
  1268.  
  1269.   # If a key pair already exists, delete it so that the ssh-keygen
  1270.   # command will not have to ask the user what to do.
  1271.   rm -f /root/.ssh/rsync_id_rsa /root/.ssh/rsync_id_rsa.pub
  1272.  
  1273.   # Generate a key pair for moving gears between nodes from the broker
  1274.   ssh-keygen -t rsa -b 2048 -P "" -f /root/.ssh/rsync_id_rsa
  1275.   cp ~/.ssh/rsync_id_rsa* /etc/openshift/
  1276.   # the .pub key needs to go on nodes, but there is no good way
  1277.   # to script that generically. Nodes should not have password-less
  1278.   # access to brokers to copy the .pub key, but this can be performed
  1279.   # manually:
  1280.   # # scp root@broker:/etc/openshift/rsync_id_rsa.pub /root/.ssh/
  1281.   # the above step will ask for the root password of the broker machine
  1282.   # # cat /root/.ssh/rsync_id_rsa.pub >> /root/.ssh/authorized_keys
  1283.   # # rm /root/.ssh/rsync_id_rsa.pub
  1284. }
  1285.  
  1286. configure_wildcard_ssl_cert_on_node()
  1287. {
  1288.   # Generate a 2048 bit key and self-signed cert
  1289.   cat << EOF | openssl req -new -rand /dev/urandom \
  1290. -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/localhost.key \
  1291. -x509 -days 3650 -extensions v3_req \
  1292. -out /etc/pki/tls/certs/localhost.crt 2> /dev/null
  1293. XX
  1294. SomeState
  1295. SomeCity
  1296. SomeOrganization
  1297. SomeOrganizationalUnit
  1298. *.${domain}
  1299. root@${domain}
  1300. EOF
  1301.  
  1302.   # Generate a cert signing request (example)
  1303.   #openssl req -new -in /etc/pki/tls/private/localhost.key -out /etc/pki/tls/certs/localhost.csr
  1304. }
  1305.  
  1306. configure_broker_ssl_cert()
  1307. {
  1308.   # Generate a 2048 bit key and self-signed cert
  1309.   cat << EOF | openssl req -new -rand /dev/urandom \
  1310. -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/localhost.key \
  1311. -x509 -days 3650 -extensions v3_req \
  1312. -out /etc/pki/tls/certs/localhost.crt 2> /dev/null
  1313. XX
  1314. SomeState
  1315. SomeCity
  1316. SomeOrganization
  1317. SomeOrganizationalUnit
  1318. ${broker_hostname}
  1319. root@${domain}
  1320. EOF
  1321. }
  1322.  
  1323. # Configure IP address and hostname.
  1324. configure_network()
  1325. {
  1326.   # Append some stuff to the DHCP configuration.
  1327.   cat <<EOF >> /etc/dhcp/dhclient-eth0.conf
  1328.  
  1329. prepend domain-name-servers ${named_ip_addr};
  1330. supersede host-name "${hostname%.${domain}}";
  1331. supersede domain-name "${domain}";
  1332. prepend domain-search "${domain}";
  1333. EOF
  1334. }
  1335.  
  1336. # Set the hostname
  1337. configure_hostname()
  1338. {
  1339.   sed -i -e "s/HOSTNAME=.*/HOSTNAME=${hostname}/" /etc/sysconfig/network
  1340.   hostname "${hostname}"
  1341. }
  1342.  
  1343. # Set some parameters in the OpenShift node configuration file.
  1344. configure_node()
  1345. {
  1346.   sed -i -e "s/^PUBLIC_IP=.*$/PUBLIC_IP=${node_ip_addr}/;
  1347. s/^CLOUD_DOMAIN=.*$/CLOUD_DOMAIN=${domain}/;
  1348. s/^PUBLIC_HOSTNAME=.*$/PUBLIC_HOSTNAME=${hostname}/;
  1349. s/^BROKER_HOST=.*$/BROKER_HOST=${broker_hostname}/" \
  1350.       /etc/openshift/node.conf
  1351.  
  1352.   echo $broker_hostname > /etc/openshift/env/OPENSHIFT_BROKER_HOST
  1353.   echo $domain > /etc/openshift/env/OPENSHIFT_CLOUD_DOMAIN
  1354.  
  1355.   if is_true "$node_v2_enable"
  1356.   then
  1357. mkdir -p /var/lib/openshift/.settings
  1358.     touch /var/lib/openshift/.settings/v2_cartridge_format
  1359.   fi
  1360. }
  1361.  
  1362. # Run the cronjob installed by openshift-origin-msg-node-mcollective immediately
  1363. # to regenerate facts.yaml.
  1364. update_openshift_facts_on_node()
  1365. {
  1366.   /etc/cron.minutely/openshift-facts
  1367. }
  1368.  
  1369. echo_installation_intentions()
  1370. {
  1371.   echo "The following components should be installed:"
  1372.   for component in $components
  1373.   do
  1374. if eval $component
  1375.     then
  1376. printf '\t%s.\n' $component
  1377.     fi
  1378. done
  1379.  
  1380. echo "Configuring with broker with hostname ${broker_hostname}."
  1381.   node && echo "Configuring node with hostname ${node_hostname}."
  1382.   echo "Configuring with named with IP address ${named_ip_addr}."
  1383.   broker && echo "Configuring with datastore with hostname ${datastore_hostname}."
  1384.   echo "Configuring with activemq with hostname ${activemq_hostname}."
  1385. }
  1386.  
  1387. # Modify console message to show install info
  1388. configure_console_msg()
  1389. {
  1390.   # add the IP to /etc/issue for convenience
  1391.   echo "Install-time IP address: ${cur_ip_addr}" >> /etc/issue
  1392.   echo_installation_intentions >> /etc/issue
  1393.   echo "Check /root/anaconda-post.log to see the %post output." >> /etc/issue
  1394.   echo >> /etc/issue
  1395. }
  1396.  
  1397.  
  1398.  
  1399. ########################################################################
  1400.  
  1401. #
  1402. # Parse the kernel command-line, define variables with the parameters
  1403. # specified on it, and define functions broker() and node(), which
  1404. # return true or false as appropriate based on whether we are
  1405. # configuring the host as a broker or as a node.
  1406. #
  1407.  
  1408. # Parse /proc/cmdline so that from, e.g., "foo=bar baz" we get
  1409. # CONF_FOO=bar and CONF_BAZ=true in the environment.
  1410. parse_cmdline()
  1411. {
  1412.   for word in $(cat /proc/cmdline)
  1413.   do
  1414. key="${word%%\=*}"
  1415.     case "$word" in
  1416.       (*=*) val="${word#*\=}" ;;
  1417.       (*) val=true ;;
  1418.     esac
  1419. eval "CONF_${key^^}"'="$val"'
  1420.   done
  1421. }
  1422.  
  1423. is_true()
  1424. {
  1425.   for arg
  1426.   do
  1427.     [[ x$arg =~ x(1|true) ]] || return 1
  1428.   done
  1429.  
  1430. return 0
  1431. }
  1432.  
  1433. is_false()
  1434. {
  1435.   for arg
  1436.   do
  1437.     [[ x$arg =~ x(1|true) ]] || return 0
  1438.   done
  1439.  
  1440. return 1
  1441. }
  1442.  
  1443. # For each component, this function defines a constant function that
  1444. # returns either true or false. For example, there will be a named
  1445. # function indicating whether we are currently installing the named
  1446. # service. We can use 'if named; then ...; fi' or just 'named && ...'
  1447. # to run the given commands if, and only if, named is being installed
  1448. # on this host.
  1449. #
  1450. # The following functions will be defined:
  1451. #
  1452. # activemq
  1453. # broker
  1454. # datastore
  1455. # named
  1456. # node
  1457. #
  1458. # For each component foo, we also set a $foo_hostname variable with the
  1459. # hostname for that logical host. We use hostnames in configuration
  1460. # files wherever possible. The only places where this is not possible
  1461. # is where we are referencing the named service; in such places, we use
  1462. # $named_ip_addr, which is also set by this function. It is possible
  1463. # that one host runs multiple services, in which case more than one
  1464. # hostname will resolve to the same IP address.
  1465. #
  1466. # We also set the $domain variable, which is the domain that will be
  1467. # used when configuring BIND and assigning hostnames for the various
  1468. # hosts in the OpenShift PaaS.
  1469. #
  1470. # We also set the $repos_base variable with the base URL for the yum
  1471. # repositories that will be used to download OpenShift RPMs. The value
  1472. # of this variable can be changed to use a custom repository or puddle.
  1473. #
  1474. # We also set the $cur_ip_addr variable to the IP address of the host
  1475. # running this script, based on the output of the `ip addr show` command
  1476. #
  1477. # In addition, the $nameservers variable will be set to
  1478. # a semicolon-delimited list of nameservers, suitable for use in
  1479. # named.conf, based on the existing contents of /etc/resolv.conf, and
  1480. # the $bind_key variable will be set to the value of CONF_BIND_KEY.
  1481. #
  1482. # The following variables will be defined:
  1483. #
  1484. # activemq_hostname
  1485. # bind_key
  1486. # broker_hostname
  1487. # cur_ip_addr
  1488. # domain
  1489. # datastore_hostname
  1490. # named_hostname
  1491. # named_ip_addr
  1492. # nameservers
  1493. # node_hostname
  1494. # repos_base
  1495. #
  1496. # This function makes use of variables that may be set by parse_cmdline
  1497. # based on the content of /proc/cmdline or may be hardcoded by modifying
  1498. # this file. All of these variables are optional; best attempts are
  1499. # made at determining reasonable defaults.
  1500. #
  1501. # The following variables are used:
  1502. #
  1503. # CONF_ACTIVEMQ_HOSTNAME
  1504. # CONF_BIND_KEY
  1505. # CONF_BROKER_HOSTNAME
  1506. # CONF_BROKER_IP_ADDR
  1507. # CONF_DATASTORE_HOSTNAME
  1508. # CONF_DOMAIN
  1509. # CONF_INSTALL_COMPONENTS
  1510. # CONF_NAMED_HOSTNAME
  1511. # CONF_NAMED_IP_ADDR
  1512. # CONF_NODE_HOSTNAME
  1513. # CONF_NODE_IP_ADDR
  1514. # CONF_NODE_V2_ENABLE
  1515. # CONF_REPOS_BASE
  1516. set_defaults()
  1517. {
  1518.   # Following are the different components that can be installed:
  1519.   components='broker node named activemq datastore'
  1520.  
  1521.   # By default, each component is _not_ installed.
  1522.   for component in $components
  1523.   do
  1524. eval "$component() { false; }"
  1525.   done
  1526.  
  1527.   # But any or all components may be explicity enabled.
  1528.   for component in ${CONF_INSTALL_COMPONENTS//,/ }
  1529.   do
  1530. eval "$component() { :; }"
  1531.   done
  1532.  
  1533.   # If nothing is explicitly enabled, enable everything.
  1534.   installing_something=0
  1535.   for component in $components
  1536.   do
  1537. if eval $component
  1538.     then
  1539. installing_something=1
  1540.       break
  1541. fi
  1542. done
  1543. if [ $installing_something = 0 ]
  1544.   then
  1545. for component in $components
  1546.     do
  1547. eval "$component() { :; }"
  1548.     done
  1549. fi
  1550.  
  1551.   # Following are some settings used in subsequent steps.
  1552.  
  1553.   # Where to find the OpenShift repositories; just the base part before
  1554.   # splitting out into Infrastructure/Node/etc.
  1555.   repos_base_default='https://mirror.openshift.com/pub/origin-server/nightly/enterprise/2012-11-15'
  1556.   repos_base="${CONF_REPOS_BASE:-${repos_base_default}}"
  1557.  
  1558.   # There a no defaults for these. Customers should be using
  1559.   # subscriptions via RHN. Internally we use private systems.
  1560.   rhel_repo="$CONF_RHEL_REPO"
  1561.   jboss_repo_base="$CONF_JBOSS_REPO_BASE"
  1562.   rhel_optional_repo="$CONF_RHEL_OPTIONAL_REPO"
  1563.  
  1564.   # The domain name for the OpenShift Enterprise installation.
  1565.   domain="${CONF_DOMAIN:-example.com}"
  1566.  
  1567.   # hostnames to use for the components (could all resolve to same host)
  1568.   broker_hostname="${CONF_BROKER_HOSTNAME:-broker.${domain}}"
  1569.   node_hostname="${CONF_NODE_HOSTNAME:-node.${domain}}"
  1570.   named_hostname="${CONF_NAMED_HOSTNAME:-ns1.${domain}}"
  1571.   activemq_hostname="${CONF_ACTIVEMQ_HOSTNAME:-activemq.${domain}}"
  1572.   datastore_hostname="${CONF_DATASTORE_HOSTNAME:-datastore.${domain}}"
  1573.  
  1574.   # The hostname name for this host.
  1575.   # Note: If this host is, e.g., both a broker and a datastore, we want
  1576.   # to go with the broker hostname and not the datastore hostname.
  1577.   if broker
  1578.   then hostname="$broker_hostname"
  1579.   elif node
  1580.   then hostname="$node_hostname"
  1581.   elif named
  1582.   then hostname="$named_hostname"
  1583.   elif activemq
  1584.   then hostname="$activemq_hostname"
  1585.   elif datastore
  1586.   then hostname="$datastore_hostname"
  1587.   fi
  1588.  
  1589.   # Grab the IP address set during installation.
  1590.   cur_ip_addr="$(/sbin/ip addr show dev eth0 | awk '/inet / { split($2,a,"/"); print a[1]; }')"
  1591.  
  1592.   # Unless otherwise specified, the broker is assumed to be the current
  1593.   # host.
  1594.   broker_ip_addr="${CONF_BROKER_IP_ADDR:-$cur_ip_addr}"
  1595.  
  1596.   # Unless otherwise specified, the node is assumed to be the current
  1597.   # host.
  1598.   node_ip_addr="${CONF_NODE_IP_ADDR:-$cur_ip_addr}"
  1599.  
  1600.   node_v2_enable="${CONF_NODE_V2_ENABLE:-false}"
  1601.  
  1602.   # Unless otherwise specified, the named service, data store, and
  1603.   # ActiveMQ service are assumed to be the current host if we are
  1604.   # installing the component now or the broker host otherwise.
  1605.   if named
  1606.   then
  1607. named_ip_addr="${CONF_NAMED_IP_ADDR:-$cur_ip_addr}"
  1608.   else
  1609. named_ip_addr="${CONF_NAMED_IP_ADDR:-$broker_ip_addr}"
  1610.   fi
  1611.  
  1612.   # The nameservers to which named on the broker will forward requests.
  1613.   # This should be a list of IP addresses with a semicolon after each.
  1614.   nameservers="$(awk '/nameserver/ { printf "%s; ", $2 }' /etc/resolv.conf)"
  1615.  
  1616.   # Set $bind_key to the value of $CONF_BIND_KEY if the latter is
  1617.   # non-empty.
  1618.   [ "x$CONF_BIND_KEY" != x ] && bind_key="$CONF_BIND_KEY"
  1619.  
  1620.   # Generate a random salt for the broker authentication.
  1621.   randomized=$(openssl rand -base64 20)
  1622.   broker && broker_auth_salt="${CONF_BROKER_AUTH_SALT:-${randomized}}"
  1623.  
  1624.   # Set default passwords
  1625.   #
  1626.   # This is the admin password for the ActiveMQ admin console, which
  1627.   # is not needed by OpenShift but might be useful in troubleshooting.
  1628.   activemq && activemq_admin_password="${CONF_ACTIVEMQ_ADMIN_PASSWORD:-${randomized//[![:alnum:]]}}"
  1629.  
  1630.   # This is the user and password shared between broker and node for
  1631.   # communicating over the mcollective topic channels in ActiveMQ.
  1632.   # Must be the same on all broker and node hosts.
  1633.   mcollective_user="${CONF_MCOLLECTIVE_USER:-mcollective}"
  1634.   mcollective_password="${CONF_MCOLLECTIVE_PASSWORD:-marionette}"
  1635.  
  1636.   # These are the username and password of the administrative user
  1637.   # that will be created in the MongoDB datastore. These credentials
  1638.   # are not used by in this script or by OpenShift, but an
  1639.   # administrative user must be added to MongoDB in order for it to
  1640.   # enforce authentication.
  1641.   mongodb_admin_user="${CONF_MONGODB_ADMIN_USER:-admin}"
  1642.   mongodb_admin_password="${CONF_MONGODB_ADMIN_PASSWORD:-${CONF_MONGODB_PASSWORD:-mongopass}}"
  1643.  
  1644.   # These are the username and password of the normal user that will
  1645.   # be created for the broker to connect to the MongoDB datastore. The
  1646.   # broker application's MongoDB plugin is also configured with these
  1647.   # values.
  1648.   mongodb_broker_user="${CONF_MONGODB_BROKER_USER:-openshift}"
  1649.   mongodb_broker_password="${CONF_MONGODB_BROKER_PASSWORD:-${CONF_MONGODB_PASSWORD:-mongopass}}"
  1650.  
  1651.   # This is the name of the database in MongoDB in which the broker
  1652.   # will store data.
  1653.   mongodb_name="${CONF_MONGODB_NAME:-openshift_broker}"
  1654.  
  1655.   # This user and password are entered in the /etc/openshift/htpasswd
  1656.   # file as a demo/test user. You will likely want to remove it after
  1657.   # installation (or just use a different auth method).
  1658.   broker && openshift_user1="${CONF_OPENSHIFT_USER1:-demo}"
  1659.   broker && openshift_password1="${CONF_OPENSHIFT_PASSWORD1:-changeme}"
  1660. }
  1661.  
  1662.  
  1663. ########################################################################
  1664.  
  1665. # Note: parse_cmdline is only needed for kickstart and not if this %post
  1666. # section is extracted and executed on a running system.
  1667. parse_cmdline
  1668.  
  1669. set_defaults
  1670.  
  1671. echo_installation_intentions
  1672. #configure_console_msg
  1673.  
  1674. is_false "$CONF_NO_NTP" && synchronize_clock
  1675. is_false "$CONF_NO_SSH_KEYS" && install_ssh_keys
  1676.  
  1677.  
  1678. # enable subscriptions / repositories according to requested method
  1679. case "$CONF_INSTALL_METHOD" in
  1680.   (yum)
  1681.     configure_rhel_repo
  1682.     if is_true "$CONF_OPTIONAL_REPO"
  1683.     then
  1684. configure_optional_repo
  1685.     fi
  1686.  
  1687. if activemq || broker || datastore
  1688.     then
  1689. configure_broker_repo
  1690.     fi
  1691. node && configure_node_repo
  1692.     node && configure_jbosseap_cartridge_repo
  1693.     node && configure_jbosseap_repo
  1694.     node && configure_jbossews_repo
  1695.     broker && configure_client_tools_repo
  1696.     ;;
  1697.   (rhn)
  1698.      echo "Register with RHN using an activation key"
  1699.      rhnreg_ks --activationkey=${CONF_RHN_REG_ACTKEY} --profilename=${hostname}
  1700.      yum-config-manager --setopt=rhel-x86_64-server-6.priority=2 rhel-x86_64-server-6 --save
  1701.      yum-config-manager --setopt="rhel-x86_64-server-6.exclude=tomcat6*" rhel-x86_64-server-6 --save
  1702.  
  1703.      for channel in rhel-x86_64-server-6-osop-1-rhc rhel-x86_64-server-6-osop-1-infrastructure
  1704.      do
  1705. broker && rhn-channel --add --channel ${channel} --user ${CONF_RHN_REG_NAME} --password ${CONF_RHN_REG_PASS}
  1706.        yum-config-manager --setopt=${channel}.priority=1 ${channel} --save
  1707.      done
  1708. for channel in rhel-x86_64-server-6-osop-1-node rhel-x86_64-server-6-osop-1-jbosseap
  1709.      do
  1710. node && rhn-channel --add --channel ${channel} --user ${CONF_RHN_REG_NAME} --password ${CONF_RHN_REG_PASS}
  1711.        yum-config-manager --setopt=${channel}.priority=1 ${channel} --save
  1712.      done
  1713. for channel in jbappplatform-6-x86_64-server-6-rpm jb-ews-1-x86_64-server-6-rpm
  1714.      do
  1715. node && rhn-channel --add --channel ${channel} --user ${CONF_RHN_REG_NAME} --password ${CONF_RHN_REG_PASS}
  1716.        yum-config-manager --setopt=${channel}.priority=3 ${channel} --save
  1717.      done
  1718.  
  1719. if is_true "$CONF_OPTIONAL_REPO"
  1720.      then
  1721. rhn-channel --add --channel rhel-x86_64-server-optional-6 --user ${CONF_RHN_REG_NAME} --password ${CONF_RHN_REG_PASS}
  1722.      fi
  1723.      ;;
  1724.   (sm)
  1725.      #sm_reg_name / CONF_SM_REG_NAME
  1726.      #sm_reg_pass / CONF_SM_REG_PASS
  1727.      #sm_reg_pool / CONF_SM_REG_POOL
  1728.      echo "sam"
  1729.      ;;
  1730. esac
  1731.  
  1732. # Install yum-plugin-priorities
  1733. yum clean all; yum install -y yum-plugin-priorities
  1734.  
  1735. yum update -y
  1736.  
  1737. # Note: configure_named must run before configure_controller if we are
  1738. # installing both named and broker on the same host.
  1739. named && configure_named
  1740.  
  1741. update_resolv_conf
  1742.  
  1743. configure_network
  1744. configure_hostname
  1745.  
  1746. datastore && configure_datastore
  1747.  
  1748. #broker && configure_qpid
  1749. activemq && configure_activemq
  1750.  
  1751. #broker && configure_mcollective_for_qpid_on_broker
  1752. broker && configure_mcollective_for_activemq_on_broker
  1753.  
  1754. #node && configure_mcollective_for_qpid_on_node
  1755. node && configure_mcollective_for_activemq_on_node
  1756.  
  1757. broker && install_broker_pkgs
  1758. broker && fix_passenger
  1759. node && install_node_pkgs
  1760. node && install_cartridges
  1761. broker && install_rhc_pkg
  1762.  
  1763. broker && enable_services_on_broker
  1764. node && enable_services_on_node
  1765.  
  1766. node && configure_pam_on_node
  1767. node && configure_cgroups_on_node
  1768. node && configure_quotas_on_node
  1769.  
  1770. broker && configure_selinux_policy_on_broker
  1771. node && configure_selinux_policy_on_node
  1772.  
  1773. node && configure_sysctl_on_node
  1774. node && configure_sshd_on_node
  1775.  
  1776. broker && configure_controller
  1777. broker && configure_remote_user_auth_plugin
  1778. broker && configure_access_keys_on_broker
  1779. #broker && configure_mongo_auth_plugin
  1780. broker && configure_messaging_plugin
  1781. broker && configure_dns_plugin
  1782. broker && configure_httpd_auth
  1783. broker && configure_broker_ssl_cert
  1784.  
  1785. node && configure_port_proxy
  1786. node && configure_gears
  1787. node && configure_node
  1788. node && configure_wildcard_ssl_cert_on_node
  1789. node && update_openshift_facts_on_node
  1790.  
  1791. node && broker && fix_broker_routing
  1792.  
  1793. echo "Installation and configuration is complete;"
  1794. echo "please reboot to start all services properly."
Add Comment
Please, Sign In to add comment