images/vino-builder/assets/entrypoint.sh
Crank, Daniel (dc6350) 183f26c048 Integrate vino-builder
This patchset integrates vino-builder into the vino manager daemonset.
See corresponding vino changes in [0].

[0] https://review.opendev.org/c/airship/vino/+/778209

Change-Id: I860ffef6275aca9d10a20abf79c1a25455ff3717
2021-03-24 13:34:57 -05:00

35 lines
1.2 KiB
Bash

#!/bin/bash
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
TIMEOUT=300
while [[ ! -e /var/run/libvirt/libvirt-sock ]]; do
if [[ ${TIMEOUT} -gt 0 ]]; then
let TIMEOUT-=1
echo "Waiting for libvirt socket at /var/run/libvirt/libvirt-sock"
sleep 1
else
echo "ERROR: libvirt did not start in time (socket missing) /var/run/libvirt/libvirt-sock"
exit 1
fi
done
ansible-playbook -v \
-e @/vino/spec \
-e @/var/lib/vino-builder/flavors/flavors.yaml \
-e @/var/lib/vino-builder/flavor-templates/flavor-templates.yaml \
-e @/var/lib/vino-builder/network-templates/network-templates.yaml \
-e @/var/lib/vino-builder/storage-templates/storage-templates.yaml \
/playbooks/vino-builder.yaml