summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-06-16 10:20:36 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2015-06-17 10:43:56 +0000
commita0cdc9afae9e481710997d5522670324201004c9 (patch)
tree82b9aafbe590290563e805d310d8b296ddae9ec0
parentc6d7c8e3f965d79c0c59cfc4644a16ecf3b4b1c0 (diff)
downloaddefinitions-a0cdc9afae9e481710997d5522670324201004c9.tar.gz
OpenStack: request time from the Controller
Configure the Networking and Compute machines to ntpd from the Controller machine instead of other lower strata NTP servers. This is the recommended by the OpenStack install guide. Change-Id: I6911a50ee4bcebd2626859626b7236935994de9b
-rw-r--r--clusters/openstack-three-node-installer.morph3
-rw-r--r--clusters/openstack-two-node-installer.morph2
-rw-r--r--extensions/openstack-time.configure61
-rw-r--r--systems/openstack-system-x86_64.morph1
4 files changed, 67 insertions, 0 deletions
diff --git a/clusters/openstack-three-node-installer.morph b/clusters/openstack-three-node-installer.morph
index a316a56c..b9c72364 100644
--- a/clusters/openstack-three-node-installer.morph
+++ b/clusters/openstack-three-node-installer.morph
@@ -154,6 +154,7 @@ systems:
EXTERNAL_INTERFACE: enp3s0
NETWORK_CONFIG: enp3s0:dhcp;enp2s0:static,address=10.0.0.1,netmask=255.255.255.0
+ SYNC_TIME_WITH_CONTROLLER: True
subsystems:
- morph: systems/initramfs-x86_64.morph
deploy:
@@ -197,6 +198,7 @@ systems:
HOSTS_SELF: 10.0.0.2 threenode-controller
EXTERNAL_INTERFACE: enp2s0
NETWORK_CONFIG: enp2s0:dhcp;enp0s26u1u2:static,address=10.0.0.2,netmask=255.255.255.0
+ SYNC_TIME_WITH_CONTROLLER: False
subsystems:
- morph: systems/initramfs-x86_64.morph
deploy:
@@ -233,6 +235,7 @@ systems:
HOSTS_SELF: 10.0.0.3 threenode-compute
EXTERNAL_INTERFACE: eno1
NETWORK_CONFIG: eno1:dhcp;enp0s29u1u3:static,address=10.0.0.3,netmask=255.255.255.0
+ SYNC_TIME_WITH_CONTROLLER: True
subsystems:
- morph: systems/initramfs-x86_64.morph
deploy:
diff --git a/clusters/openstack-two-node-installer.morph b/clusters/openstack-two-node-installer.morph
index d4f94cfb..29c028dc 100644
--- a/clusters/openstack-two-node-installer.morph
+++ b/clusters/openstack-two-node-installer.morph
@@ -151,6 +151,7 @@ systems:
HOSTS_COMPUTE: 10.0.0.3 twonode-compute.os-mgmt
EXTERNAL_INTERFACE: enp3s0
NETWORK_CONFIG: enp3s0:dhcp;enp2s0:static,address=10.0.0.1,netmask=255.255.255.0
+ SYNC_TIME_WITH_CONTROLLER: False
subsystems:
- morph: systems/initramfs-x86_64.morph
deploy:
@@ -194,6 +195,7 @@ systems:
HOSTS_SELF: 10.0.0.3 twonode-compute
EXTERNAL_INTERFACE: eno1
NETWORK_CONFIG: eno1:dhcp;enp0s29u1u3:static,address=10.0.0.3,netmask=255.255.255.0
+ SYNC_TIME_WITH_CONTROLLER: True
subsystems:
- morph: systems/initramfs-x86_64.morph
deploy:
diff --git a/extensions/openstack-time.configure b/extensions/openstack-time.configure
new file mode 100644
index 00000000..4f5c8fbd
--- /dev/null
+++ b/extensions/openstack-time.configure
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# Copyright (C) 2015 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+ROOT="$1"
+
+unnaceptable(){
+ eval echo Unexpected value \$$1 for $1 >&2
+ exit 1
+}
+
+check_bool(){
+ case "$(eval echo \"\$$1\")" in
+ True)
+ eval "$1=true"
+ ;;
+ False|'')
+ eval "$1=false"
+ ;;
+ *)
+ unnaceptable "$1"
+ ;;
+ esac
+}
+check_bool SYNC_TIME_WITH_CONTROLLER
+
+if "$SYNC_TIME_WITH_CONTROLLER"; then
+
+ cat << EOF > "$ROOT"/etc/ntpd.conf
+# We use iburst here to reduce the potential initial delay to set the clock
+server $CONTROLLER_HOST_ADDRESS iburst
+
+# kod - notify client when packets are denied service,
+# rather than just dropping the packets
+#
+# nomodify - deny queries which attempt to modify the state of the server
+#
+# notrap - decline to provide mode 6 control message trap service to
+# matching hosts
+#
+# see ntp.conf(5) for more details
+restrict -4 default limited limited nomodify
+restrict -6 default limited limited notrap nomodify
+EOF
+
+fi
diff --git a/systems/openstack-system-x86_64.morph b/systems/openstack-system-x86_64.morph
index 2f700e68..af3ade19 100644
--- a/systems/openstack-system-x86_64.morph
+++ b/systems/openstack-system-x86_64.morph
@@ -80,6 +80,7 @@ configuration-extensions:
- extensions/openstack-network
- extensions/openstack-neutron
- extensions/openstack-ceilometer
+- extensions/openstack-time
- extensions/fstab
- extensions/openstack-ironic
- extensions/install-essential-files