Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patch to change SELinux context of CoreOS libvirt deployment script
diff -up ./deploy_coreos_libvirt.sh.friend ./deploy_coreos_libvirt.sh
diff -up ./deploy_coreos_libvirt.sh.friend ./deploy_coreos_libvirt.sh
--- ./deploy_coreos_libvirt.sh.friend 2016-01-25 14:18:15.431503583 +0100
+++ ./deploy_coreos_libvirt.sh 2016-01-25 14:24:35.942741966 +0100
@@ -51,6 +51,12 @@ for SEQ in $(seq 1 $1); do
sed "s#%HOSTNAME%#$COREOS_HOSTNAME#g;s#%DISCOVERY%#$ETCD_DISCOVERY#g" $USER_DATA_TEMPLATE > $LIBVIRT_PATH/$COREOS_HOSTNAME/openstack/latest/user_data
+
+ if [[ selinuxenabled ]] ;then
+ echo "Making SELinux configuration"
+ semanage fcontext -a -t virt_content_t "$LIBVIRT_PATH/$COREOS_HOSTNAME(/.*)"
+ restorecon -R "$LIBVIRT_PATH"
+ fi
virt-install --connect qemu:///system \
--import \
--name $COREOS_HOSTNAME \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment