From abf676210b4c7cb55f27071b5b81019f15f09867 Mon Sep 17 00:00:00 2001 From: Kaspars Skels Date: Mon, 18 Feb 2019 13:10:28 -0600 Subject: [PATCH] Add support for NTP in gate-multinode This allows configuring NTP pools/servers for nodes bootstrap-ed by gate-multinode. Change-Id: I0f29f16d3d7d2a44e0e01732b74032068b03e1a3 --- tools/multi_nodes_gate/airship_gate/lib/config.sh | 2 ++ tools/multi_nodes_gate/airship_gate/lib/virsh.sh | 2 ++ tools/multi_nodes_gate/airship_gate/templates/user-data.sub | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/tools/multi_nodes_gate/airship_gate/lib/config.sh b/tools/multi_nodes_gate/airship_gate/lib/config.sh index 98f6dcc1..ae7296ac 100644 --- a/tools/multi_nodes_gate/airship_gate/lib/config.sh +++ b/tools/multi_nodes_gate/airship_gate/lib/config.sh @@ -17,6 +17,8 @@ export VIRSH_POOL=${VIRSH_POOL:-airship} export VIRSH_POOL_PATH=${VIRSH_POOL_PATH:-/var/lib/libvirt/airship} export VIRSH_CPU_OPTS=${VIRSH_CPU_OPTS:-host} export UPSTREAM_DNS=${UPSTREAM_DNS:-"8.8.8.8 8.8.4.4"} +export NTP_POOLS=${NTP_POOLS:-"0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org"} +export NTP_SERVERS=${NTP_SERVERS:-""} export SHIPYARD_PASSWORD=${SHIPYARD_OS_PASSWORD:-'password18'} export AIRSHIP_KEYSTONE_URL=${AIRSHIP_KEYSTONE_URL:-'http://keystone.gate.local:80/v3'} diff --git a/tools/multi_nodes_gate/airship_gate/lib/virsh.sh b/tools/multi_nodes_gate/airship_gate/lib/virsh.sh index eec96b89..8a8d767a 100644 --- a/tools/multi_nodes_gate/airship_gate/lib/virsh.sh +++ b/tools/multi_nodes_gate/airship_gate/lib/virsh.sh @@ -42,6 +42,8 @@ iso_gen() { export BR_IP_NODE export NAME export SSH_PUBLIC_KEY + export NTP_POOLS=$(join_array ',' $NTP_POOLS) + export NTP_SERVERS=$(join_array ',' $NTP_SERVERS) envsubst < "${TEMPLATE_DIR}/user-data.sub" > user-data if [[ ! -z "${ADDL_USERDATA}" ]] diff --git a/tools/multi_nodes_gate/airship_gate/templates/user-data.sub b/tools/multi_nodes_gate/airship_gate/templates/user-data.sub index dd29de4e..97807847 100644 --- a/tools/multi_nodes_gate/airship_gate/templates/user-data.sub +++ b/tools/multi_nodes_gate/airship_gate/templates/user-data.sub @@ -14,3 +14,7 @@ chpasswd: list: | root:password expire: false + +ntp: + pools: [${NTP_POOLS}] + servers: [${NTP_SERVERS}]