Skip to content

Instantly share code, notes, and snippets.

@metal3d
Created February 1, 2016 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metal3d/2d78efdd9c6ce573a2cd to your computer and use it in GitHub Desktop.
Save metal3d/2d78efdd9c6ce573a2cd to your computer and use it in GitHub Desktop.
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