]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Updating snippets, adding snippets for EL9
authorFrank Brehm <frank@brehm-online.com>
Thu, 30 Jun 2022 12:36:33 +0000 (14:36 +0200)
committerFrank Brehm <frank@brehm-online.com>
Thu, 30 Jun 2022 12:36:33 +0000 (14:36 +0200)
14 files changed:
snippets/tpl.200.init-repos.sh
snippets/tpl.210.bashrc-centos8.sh [deleted file]
snippets/tpl.210.bashrc-el8.sh [new file with mode: 0644]
snippets/tpl.211.bashrc-el9.sh [new file with mode: 0644]
snippets/tpl.220.locales-centos8.sh [deleted file]
snippets/tpl.220.locales-el8.sh [new file with mode: 0644]
snippets/tpl.221.locales-el9.sh [new file with mode: 0644]
snippets/tpl.230.vimrc-centos8.sh [deleted file]
snippets/tpl.230.vimrc-el8.sh [new file with mode: 0644]
snippets/tpl.231.vimrc-el9.sh [new file with mode: 0644]
snippets/tpl.250.pkgs-centos8.sh [deleted file]
snippets/tpl.250.pkgs-el8.sh [new file with mode: 0644]
snippets/tpl.280.dist-upgrade.sh
snippets/tpl.450.puppet.sh

index 0d5ad7695da80423c1ff15d32936584edbb5fcb7..b8346aec004ceedd8bb04ec7ae1ab87f7de10459 100644 (file)
@@ -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 (file)
index d2dd3a3..0000000
+++ /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 (file)
index 0000000..d2dd3a3
--- /dev/null
@@ -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 (file)
index 0000000..d2dd3a3
--- /dev/null
@@ -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 (file)
index 5b66d39..0000000
+++ /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 (file)
index 0000000..5b66d39
--- /dev/null
@@ -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 (file)
index 0000000..5b66d39
--- /dev/null
@@ -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 (file)
index d85c3f7..0000000
+++ /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 (file)
index 0000000..d85c3f7
--- /dev/null
@@ -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 (file)
index 0000000..d85c3f7
--- /dev/null
@@ -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 (file)
index a7774d9..0000000
+++ /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 (file)
index 0000000..a7774d9
--- /dev/null
@@ -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
index 98840e047fbfec93c596b047fbe80e7128807716..9c2ad994a36df11164a5c6c11defd94653478c5b 100644 (file)
@@ -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}"
index 8d1da60a81725e6a3d2573b64eb8c26e214d468b..06c1129d0bf0b8a228aa43985f9ca1fbf6b735b1 100644 (file)
@@ -68,6 +68,7 @@ install_puppet() {
     cat <<-EOF >"${facter_conf_dir}/customer.yaml"
        ---
        customer: pixelpark
+       project: unknown
        EOF
 
     echo