From cb9f5fdb23e7869f0e96c3d55c489ca020eb096c Mon Sep 17 00:00:00 2001 From: "Andreas B. Mundt" Date: Sat, 18 Feb 2023 10:00:23 +0100 Subject: [PATCH] Skip time consuming VM syncing during installation, cleanup. --- roles/lmn_sssd/templates/sssd.conf.j2 | 18 ++++++++---------- roles/lmn_vm/files/rebase-vm.sh | 10 +++++----- roles/lmn_vm/tasks/main.yml | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/roles/lmn_sssd/templates/sssd.conf.j2 b/roles/lmn_sssd/templates/sssd.conf.j2 index 24ab69a..cb7a301 100644 --- a/roles/lmn_sssd/templates/sssd.conf.j2 +++ b/roles/lmn_sssd/templates/sssd.conf.j2 @@ -3,17 +3,15 @@ domains = {{ domain }} config_file_version = 2 [domain/{{ domain }}] -default_shell = /bin/bash +krb5_realm = {{ domain | upper }} +ad_domain = {{ domain }} +id_provider = ad +access_provider = ad +use_fully_qualified_names = False cache_credentials = True krb5_store_password_if_offline = True -cache_credentials = True -krb5_realm = {{ domain | upper }} -id_provider = ad -#override_homedir = /home/%u -ad_domain = {{ domain }} -use_fully_qualified_names = False -ldap_id_mapping = True -access_provider = ad -ad_gpo_access_control = permissive +default_shell = /usr/bin/bash +# default: # ldap_id_mapping = True +ad_gpo_access_control = disabled ad_gpo_ignore_unreadable = True ad_maximum_machine_account_password_age = 0 diff --git a/roles/lmn_vm/files/rebase-vm.sh b/roles/lmn_vm/files/rebase-vm.sh index 5accc16..336c1c4 100755 --- a/roles/lmn_vm/files/rebase-vm.sh +++ b/roles/lmn_vm/files/rebase-vm.sh @@ -9,7 +9,7 @@ This script takes as input the name of the VM to rebase one level down -n new name of the rebased image EOF } - + while getopts ':n:' OPTION; do case "$OPTION" in n) @@ -21,10 +21,10 @@ while getopts ':n:' OPTION; do ;; esac done - + shift "$((OPTIND -1))" -# if less or more than one arguments supplied, display usage +# if less or more than one arguments supplied, display usage if [[ $# -ne 1 ]]; then show_help exit 1 @@ -51,7 +51,7 @@ NUMBASES=$(qemu-img info --backing-chain "${VM_NAME}.qcow2" | grep -c image) NEWBASE=$(qemu-img info --backing-chain "${VM_NAME}.qcow2" | grep image | head -n 3 | tail -n 1 | cut -d' ' -f2) CURRENTBASE=$(qemu-img info --backing-chain "${VM_NAME}.qcow2" | grep image | head -n 2 | tail -n 1 | cut -d' ' -f2) -if [[ ! "${NUMBASES}" -ge 3 ]]; then +if [[ ! "${NUMBASES}" -ge 3 ]]; then echo "Image must have at least 2 backing-files" exit 1 fi @@ -64,7 +64,7 @@ fi # rebasing disk image qemu-img rebase -f qcow2 -b "${NEWBASE}" -F qcow2 "${VM_NAME}.qcow2" -if [[ -v NEWNAME ]]; then +if [[ -v NEWNAME ]]; then # copy and adapt machine definition file CURRENTNAME="${CURRENTBASE/.qcow2/}" cp "xml/${CURRENTNAME}.xml" "xml/${NEWNAME}.xml" diff --git a/roles/lmn_vm/tasks/main.yml b/roles/lmn_vm/tasks/main.yml index dc659eb..2adf629 100644 --- a/roles/lmn_vm/tasks/main.yml +++ b/roles/lmn_vm/tasks/main.yml @@ -111,4 +111,4 @@ command: rsync -a -i --files-from=/var/lib/libvirt/images/images.list rsync://server:/vmimages-download/ /var/lib/libvirt/images/ register: result changed_when: result.stdout | length > 0 - when: (ansible_mounts | selectattr("mount", "equalto", "/") | list)[0].size_available > 80000000000 + when: not run_in_installer | default(false) | bool and (ansible_mounts | selectattr("mount", "equalto", "/") | list)[0].size_available > 80000000000