From: Frank Brehm Date: Thu, 25 Jun 2020 13:15:53 +0000 (+0200) Subject: Adding some Snippets for EL7 X-Git-Tag: 2.1.2^2~7^2~5^2~5 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=e99033e6556f0f90f0a8220a35ca6df0e481dd27;p=pixelpark%2Fcreate-vmware-tpl.git Adding some Snippets for EL7 --- diff --git a/snippets/tpl.170.repos_centos7.sh b/snippets/tpl.170.repos_centos7.sh new file mode 100644 index 0000000..d62b0a1 --- /dev/null +++ b/snippets/tpl.170.repos_centos7.sh @@ -0,0 +1,33 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_centos7() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_centos7() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/centos7" + + local -a repos=('CentOS-Base' 'CentOS-CR' 'CentOS-fasttrack') + repos+=('epel' 'icinga' 'pixelpark' 'prometheus' 'puppet' 'wazuh') + + local repo= + local url= + local tmp_file= + for repo in "${repos[@]}" ; do + echo "Ensuring repo '${repo}.repo'..." + url="${base_url}/${repo}.repo" + tmp_file=$( mktemp ) + wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true + if [[ -s "${tmp_file}" ]] ; then + mv -v "${tmp_file}" "/etc/yum.repos.d/${repo}.repo" + fi + rm -fv "${tmp_file}" + done + +} +get_repos_centos7 + +#end raw diff --git a/snippets/tpl.180.repos_centos7.sh b/snippets/tpl.180.repos_centos7.sh deleted file mode 100644 index 9f8a110..0000000 --- a/snippets/tpl.180.repos_centos7.sh +++ /dev/null @@ -1,33 +0,0 @@ -## !/bin/bash -#raw - -#----------------------------------------------------------- -get_repos_centos7() { - - echo - echo "${HASH_LINE}" - echo "Calling get_repos_centos8() ..." - echo - local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/centos7" - - local -a repos=('CentOS-Base' 'CentOS-CR' 'CentOS-fasttrack') - repos+=('epel' 'icinga' 'pixelpark' 'prometheus' 'puppet' 'wazuh') - - local repo= - local url= - local tmp_file= - for repo in "${repos[@]}" ; do - echo "Ensuring repo '${repo}.repo'..." - url="${base_url}/${repo}.repo" - tmp_file=$( mktemp ) - wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true - if [[ -s "${tmp_file}" ]] ; then - mv -v "${tmp_file}" "/etc/yum.repos.d/${repo}.repo" - fi - rm -fv "${tmp_file}" - done - -} -get_repos_centos7 - -#end raw diff --git a/snippets/tpl.205.bashrc-el7.sh b/snippets/tpl.205.bashrc-el7.sh new file mode 100644 index 0000000..7ea934e --- /dev/null +++ b/snippets/tpl.205.bashrc-el7.sh @@ -0,0 +1,38 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +set_bashrc_el7() { + + echo + echo "${HASH_LINE}" + echo "Calling set_bashrc_el7() ..." + echo + local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/bashrc-el7" + + 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 + +} + +set_bashrc_el7 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.225.vimrc-el7.sh b/snippets/tpl.225.vimrc-el7.sh new file mode 100644 index 0000000..4cc15c0 --- /dev/null +++ b/snippets/tpl.225.vimrc-el7.sh @@ -0,0 +1,30 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +set_vimrc_el7() { + + echo + echo "${HASH_LINE}" + echo "Calling set_vimrc_el7() ..." + echo + local url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/vimrc-el7" + + 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}" + +} + +set_vimrc_el7 + +#end raw +## vim: ts=4 et list diff --git a/snippets/tpl.240.pkgs-el7.sh b/snippets/tpl.240.pkgs-el7.sh new file mode 100644 index 0000000..b1622b6 --- /dev/null +++ b/snippets/tpl.240.pkgs-el7.sh @@ -0,0 +1,36 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +install_pkgs_el7() { + + echo + echo "${HASH_LINE}" + echo "Calling install_pkgs_el7() ..." + echo + echo + log "Installing additional packages ..." + echo + + local -a pkgs_add=('colordiff' 'p7zip' 'screen') + 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 +} + +install_pkgs_el7 + +#end raw +## vim: ts=4 et list