-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathmaster-boot.sh
More file actions
47 lines (36 loc) · 1.32 KB
/
master-boot.sh
File metadata and controls
47 lines (36 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#
# Prepare an OpenShift node VM for configuration by Ansible
#
# ENVVARS
# WC_NOTIFY - a curl URL from an OpenStack WaitCondition
# send status to OpenStack
#
# CONSTANTS
#
# The device to mount to store Docker images and containers
VOLUME_ID=$DOCKER_VOLUME_ID
# Exit on first fail or on reference to an undefined variable
set -eu
set -x
# Return the exit code of the last non-zero command in a pipe (or 0 on success)
set -o pipefail
source /usr/local/share/openshift-on-openstack/common_functions.sh
source /usr/local/share/openshift-on-openstack/common_openshift_functions.sh
# Setup eth1 only if it's present
grep eth1 /proc/net/dev && ifup eth1
sudo_set_secure_path "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin"
sudo_enable_from_ssh
docker_install_and_enable
docker_set_trusted_registry 0.0.0.0/0
if [ $(docker_version major) -lt 2 -a $(docker_version minor) -lt 10 ]
then
systemd_add_docker_socket
fi
docker_set_storage_device $VOLUME_ID
# lvmetad allows new volumes to be configured and made available as they appear
# This is good for dynamically created volumes in a cloud provider service
systemctl enable lvm2-lvmetad
systemctl start lvm2-lvmetad
/usr/bin/docker-storage-setup || notify_failure "Docker Storage setup failed"
notify_success "OpenShift node has been prepared for running docker."