From: Frank Brehm Date: Thu, 30 Jun 2022 12:36:33 +0000 (+0200) Subject: Updating snippets, adding snippets for EL9 X-Git-Tag: 2.6.2~1^2~8^2~19 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=dac8e5772149b0f68556c56f656469357045e9ed;p=pixelpark%2Fcreate-vmware-tpl.git Updating snippets, adding snippets for EL9 --- diff --git a/snippets/tpl.200.init-repos.sh b/snippets/tpl.200.init-repos.sh index 0d5ad76..b8346ae 100644 --- a/snippets/tpl.200.init-repos.sh +++ b/snippets/tpl.200.init-repos.sh @@ -10,8 +10,13 @@ init_yum_repos() { echo log "Cleaning YUM repos and making cache ..." - yum clean all - yum makecache + if [[ -x /bin/dnf ]] ; then + dnf clean all + dnf makecache + else + yum clean all + yum makecache + fi echo -e "\e[0Ksection_end:$( date +%s ):ks_init_yum_repos\r\e[0K" } diff --git a/snippets/tpl.210.bashrc-centos8.sh b/snippets/tpl.210.bashrc-centos8.sh deleted file mode 100644 index d2dd3a3..0000000 --- a/snippets/tpl.210.bashrc-centos8.sh +++ /dev/null @@ -1,40 +0,0 @@ -## !/bin/bash -#raw - -#----------------------------------------------------------- -set_bashrc_centos8() { - - echo -e "\e[0Ksection_start:$( date +%s ):ks_set_bashrc_centos8[collapsed=true]\r\e[0KRewriting /etc/bashrc ..." - echo - echo "${HASH_LINE}" - echo "Calling set_bashrc_centos8() ..." - echo - local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/bashrc-centos8" - - echo - log "Rewriting /etc/bashrc ..." - - local tmp_file=$( mktemp ) - wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true - if [[ -s "${tmp_file}" ]] ; then - cp -p /etc/bashrc /etc/bashrc.original - mv -v "${tmp_file}" /etc/bashrc - chmod -v 0644 /etc/bashrc - fi - rm -fv "${tmp_file}" - - echo - log "Installing bash-completion ..." - if yum install -y "bash-completion" ; then - : - else - echo "[$(date)]: Could not install bash-completion" | tee -a "${ERROR_POINTER}" - fi - - echo -e "\e[0Ksection_end:$( date +%s ):ks_set_bashrc_centos8\r\e[0K" -} - -set_bashrc_centos8 - -#end raw -## vim: ts=4 et list diff --git a/snippets/tpl.210.bashrc-el8.sh b/snippets/tpl.210.bashrc-el8.sh new file mode 100644 index 0000000..d2dd3a3 --- /dev/null +++ b/snippets/tpl.210.bashrc-el8.sh @@ -0,0 +1,40 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +set_bashrc_centos8() { + + echo -e "\e[0Ksection_start:$( date +%s ):ks_set_bashrc_centos8[collapsed=true]\r\e[0KRewriting /etc/bashrc ..." + echo + echo "${HASH_LINE}" + echo "Calling set_bashrc_centos8() ..." + echo + local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/bashrc-centos8" + + echo + log "Rewriting /etc/bashrc ..." + + local tmp_file=$( mktemp ) + wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true + if [[ -s "${tmp_file}" ]] ; then + cp -p /etc/bashrc /etc/bashrc.original + mv -v "${tmp_file}" /etc/bashrc + chmod -v 0644 /etc/bashrc + fi + rm -fv "${tmp_file}" + + echo + log "Installing bash-completion ..." + if yum install -y "bash-completion" ; then + : + else + echo "[$(date)]: Could not install bash-completion" | tee -a "${ERROR_POINTER}" + fi + + echo -e "\e[0Ksection_end:$( date +%s ):ks_set_bashrc_centos8\r\e[0K" +} + +set_bashrc_centos8 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.211.bashrc-el9.sh b/snippets/tpl.211.bashrc-el9.sh new file mode 100644 index 0000000..d2dd3a3 --- /dev/null +++ b/snippets/tpl.211.bashrc-el9.sh @@ -0,0 +1,40 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +set_bashrc_centos8() { + + echo -e "\e[0Ksection_start:$( date +%s ):ks_set_bashrc_centos8[collapsed=true]\r\e[0KRewriting /etc/bashrc ..." + echo + echo "${HASH_LINE}" + echo "Calling set_bashrc_centos8() ..." + echo + local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/bashrc-centos8" + + echo + log "Rewriting /etc/bashrc ..." + + local tmp_file=$( mktemp ) + wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true + if [[ -s "${tmp_file}" ]] ; then + cp -p /etc/bashrc /etc/bashrc.original + mv -v "${tmp_file}" /etc/bashrc + chmod -v 0644 /etc/bashrc + fi + rm -fv "${tmp_file}" + + echo + log "Installing bash-completion ..." + if yum install -y "bash-completion" ; then + : + else + echo "[$(date)]: Could not install bash-completion" | tee -a "${ERROR_POINTER}" + fi + + echo -e "\e[0Ksection_end:$( date +%s ):ks_set_bashrc_centos8\r\e[0K" +} + +set_bashrc_centos8 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.220.locales-centos8.sh b/snippets/tpl.220.locales-centos8.sh deleted file mode 100644 index 5b66d39..0000000 --- a/snippets/tpl.220.locales-centos8.sh +++ /dev/null @@ -1,26 +0,0 @@ -## !/bin/bash -#raw - -#----------------------------------------------------------- -set_locales_centos8() { - - echo -e "\e[0Ksection_start:$( date +%s ):ks_set_locales_centos8[collapsed=true]\r\e[0KInstalling german locales ..." - echo - echo "${HASH_LINE}" - echo "Calling set_locales_centos8() ..." - echo - - log "Installing german locales (langpacks-de) ..." - if yum install -y "langpacks-de" ; then - : - else - echo "[$(date)]: Could not install german locales (langpacks-de)" | tee -a "${ERROR_POINTER}" - fi - - echo -e "\e[0Ksection_end:$( date +%s ):ks_set_locales_centos8\r\e[0K" -} - -set_locales_centos8 - -#end raw -## vim: ts=4 et list diff --git a/snippets/tpl.220.locales-el8.sh b/snippets/tpl.220.locales-el8.sh new file mode 100644 index 0000000..5b66d39 --- /dev/null +++ b/snippets/tpl.220.locales-el8.sh @@ -0,0 +1,26 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +set_locales_centos8() { + + echo -e "\e[0Ksection_start:$( date +%s ):ks_set_locales_centos8[collapsed=true]\r\e[0KInstalling german locales ..." + echo + echo "${HASH_LINE}" + echo "Calling set_locales_centos8() ..." + echo + + log "Installing german locales (langpacks-de) ..." + if yum install -y "langpacks-de" ; then + : + else + echo "[$(date)]: Could not install german locales (langpacks-de)" | tee -a "${ERROR_POINTER}" + fi + + echo -e "\e[0Ksection_end:$( date +%s ):ks_set_locales_centos8\r\e[0K" +} + +set_locales_centos8 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.221.locales-el9.sh b/snippets/tpl.221.locales-el9.sh new file mode 100644 index 0000000..5b66d39 --- /dev/null +++ b/snippets/tpl.221.locales-el9.sh @@ -0,0 +1,26 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +set_locales_centos8() { + + echo -e "\e[0Ksection_start:$( date +%s ):ks_set_locales_centos8[collapsed=true]\r\e[0KInstalling german locales ..." + echo + echo "${HASH_LINE}" + echo "Calling set_locales_centos8() ..." + echo + + log "Installing german locales (langpacks-de) ..." + if yum install -y "langpacks-de" ; then + : + else + echo "[$(date)]: Could not install german locales (langpacks-de)" | tee -a "${ERROR_POINTER}" + fi + + echo -e "\e[0Ksection_end:$( date +%s ):ks_set_locales_centos8\r\e[0K" +} + +set_locales_centos8 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.230.vimrc-centos8.sh b/snippets/tpl.230.vimrc-centos8.sh deleted file mode 100644 index d85c3f7..0000000 --- a/snippets/tpl.230.vimrc-centos8.sh +++ /dev/null @@ -1,32 +0,0 @@ -## !/bin/bash -#raw - -#----------------------------------------------------------- -set_vimrc_centos8() { - - echo -e "\e[0Ksection_start:$( date +%s ):ks_set_vimrc_centos8[collapsed=true]\r\e[0KGet yum repository files ..." - echo - echo "${HASH_LINE}" - echo "Calling set_vimrc_centos8() ..." - echo - local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/vimrc-centos8" - - echo - log "Rewriting /etc/vimrc ..." - - local tmp_file=$( mktemp ) - wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true - if [[ -s "${tmp_file}" ]] ; then - cp -p /etc/vimrc /etc/vimrc.original - mv -v "${tmp_file}" /etc/vimrc - chmod -v 0644 /etc/vimrc - fi - rm -fv "${tmp_file}" - - echo -e "\e[0Ksection_end:$( date +%s ):ks_set_vimrc_centos8\r\e[0K" -} - -set_vimrc_centos8 - -#end raw -## vim: ts=4 et list diff --git a/snippets/tpl.230.vimrc-el8.sh b/snippets/tpl.230.vimrc-el8.sh new file mode 100644 index 0000000..d85c3f7 --- /dev/null +++ b/snippets/tpl.230.vimrc-el8.sh @@ -0,0 +1,32 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +set_vimrc_centos8() { + + echo -e "\e[0Ksection_start:$( date +%s ):ks_set_vimrc_centos8[collapsed=true]\r\e[0KGet yum repository files ..." + echo + echo "${HASH_LINE}" + echo "Calling set_vimrc_centos8() ..." + echo + local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/vimrc-centos8" + + echo + log "Rewriting /etc/vimrc ..." + + local tmp_file=$( mktemp ) + wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true + if [[ -s "${tmp_file}" ]] ; then + cp -p /etc/vimrc /etc/vimrc.original + mv -v "${tmp_file}" /etc/vimrc + chmod -v 0644 /etc/vimrc + fi + rm -fv "${tmp_file}" + + echo -e "\e[0Ksection_end:$( date +%s ):ks_set_vimrc_centos8\r\e[0K" +} + +set_vimrc_centos8 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.231.vimrc-el9.sh b/snippets/tpl.231.vimrc-el9.sh new file mode 100644 index 0000000..d85c3f7 --- /dev/null +++ b/snippets/tpl.231.vimrc-el9.sh @@ -0,0 +1,32 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +set_vimrc_centos8() { + + echo -e "\e[0Ksection_start:$( date +%s ):ks_set_vimrc_centos8[collapsed=true]\r\e[0KGet yum repository files ..." + echo + echo "${HASH_LINE}" + echo "Calling set_vimrc_centos8() ..." + echo + local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/vimrc-centos8" + + echo + log "Rewriting /etc/vimrc ..." + + local tmp_file=$( mktemp ) + wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true + if [[ -s "${tmp_file}" ]] ; then + cp -p /etc/vimrc /etc/vimrc.original + mv -v "${tmp_file}" /etc/vimrc + chmod -v 0644 /etc/vimrc + fi + rm -fv "${tmp_file}" + + echo -e "\e[0Ksection_end:$( date +%s ):ks_set_vimrc_centos8\r\e[0K" +} + +set_vimrc_centos8 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.250.pkgs-centos8.sh b/snippets/tpl.250.pkgs-centos8.sh deleted file mode 100644 index a7774d9..0000000 --- a/snippets/tpl.250.pkgs-centos8.sh +++ /dev/null @@ -1,39 +0,0 @@ -## !/bin/bash -#raw - -#----------------------------------------------------------- -install_pkgs_centos8() { - - echo -e "\e[0Ksection_start:$( date +%s ):ks_install_pkgs_centos8[collapsed=true]\r\e[0KInstalling additional packages ..." - echo - echo "${HASH_LINE}" - echo "Calling install_pkgs_centos8() ..." - echo - echo - log "Installing additional packages ..." - echo - - local -a pkgs_add=('colordiff' 'p7zip' 'screen' 'NetworkManager-config-server') - local -a pkgs_remove=('nfs*' 'rpcbind') - - echo "Installing packages: ${pkgs_add[*]}" - yum install -y "${pkgs_add[@]}" - - echo - echo "Removing packages: ${pkgs_remove[*]}" - yum remove -y "${pkgs_remove[@]}" - - echo - echo "Creating /etc/gitconfig ..." - cat <<-EOF >/etc/gitconfig - [color] - ui = true - EOF - - echo -e "\e[0Ksection_end:$( date +%s ):ks_install_pkgs_centos8\r\e[0K" -} - -install_pkgs_centos8 - -#end raw -## vim: ts=4 et list diff --git a/snippets/tpl.250.pkgs-el8.sh b/snippets/tpl.250.pkgs-el8.sh new file mode 100644 index 0000000..a7774d9 --- /dev/null +++ b/snippets/tpl.250.pkgs-el8.sh @@ -0,0 +1,39 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +install_pkgs_centos8() { + + echo -e "\e[0Ksection_start:$( date +%s ):ks_install_pkgs_centos8[collapsed=true]\r\e[0KInstalling additional packages ..." + echo + echo "${HASH_LINE}" + echo "Calling install_pkgs_centos8() ..." + echo + echo + log "Installing additional packages ..." + echo + + local -a pkgs_add=('colordiff' 'p7zip' 'screen' 'NetworkManager-config-server') + local -a pkgs_remove=('nfs*' 'rpcbind') + + echo "Installing packages: ${pkgs_add[*]}" + yum install -y "${pkgs_add[@]}" + + echo + echo "Removing packages: ${pkgs_remove[*]}" + yum remove -y "${pkgs_remove[@]}" + + echo + echo "Creating /etc/gitconfig ..." + cat <<-EOF >/etc/gitconfig + [color] + ui = true + EOF + + echo -e "\e[0Ksection_end:$( date +%s ):ks_install_pkgs_centos8\r\e[0K" +} + +install_pkgs_centos8 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.280.dist-upgrade.sh b/snippets/tpl.280.dist-upgrade.sh index 98840e0..9c2ad99 100644 --- a/snippets/tpl.280.dist-upgrade.sh +++ b/snippets/tpl.280.dist-upgrade.sh @@ -12,7 +12,13 @@ dist_upgrade() { log "Upgrading all packages ..." echo - if yum upgrade -y ; then + if [[ -x /bin/dnf ]] ; then + YUM=dnf + else + YUM=yum + fi + + if $YUM upgrade --assumeyes ; then : else echo "[$(date)]: Upgrading system not successful." | tee -a "${ERROR_POINTER}" diff --git a/snippets/tpl.450.puppet.sh b/snippets/tpl.450.puppet.sh index 8d1da60..06c1129 100644 --- a/snippets/tpl.450.puppet.sh +++ b/snippets/tpl.450.puppet.sh @@ -68,6 +68,7 @@ install_puppet() { cat <<-EOF >"${facter_conf_dir}/customer.yaml" --- customer: pixelpark + project: unknown EOF echo