remove whitespace for stream redirection
This commit is contained in:
parent
6d757f971e
commit
b8c5ac3097
|
@ -497,7 +497,7 @@ Python36SclIsAvailable() {
|
||||||
|
|
||||||
# Try to enable rh-python36 from SCL if it is necessary and possible.
|
# Try to enable rh-python36 from SCL if it is necessary and possible.
|
||||||
EnablePython36SCL() {
|
EnablePython36SCL() {
|
||||||
if "$EXISTS" python3.6 > /dev/null 2> /dev/null; then
|
if "$EXISTS" python3.6 > /dev/null 2>/dev/null; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
if [ ! -f /opt/rh/rh-python36/enable ]; then
|
if [ ! -f /opt/rh/rh-python36/enable ]; then
|
||||||
|
@ -815,7 +815,7 @@ elif [ -f /etc/redhat-release ]; then
|
||||||
unset LE_PYTHON
|
unset LE_PYTHON
|
||||||
DeterminePythonVersion "NOCRASH"
|
DeterminePythonVersion "NOCRASH"
|
||||||
|
|
||||||
RPM_DIST_NAME=`(. /etc/os-release 2> /dev/null && echo $ID) || echo "unknown"`
|
RPM_DIST_NAME=`(. /etc/os-release 2>/dev/null && echo $ID) || echo "unknown"`
|
||||||
|
|
||||||
if [ "$PYVER" -eq 26 -a $(uname -m) != 'x86_64' ]; then
|
if [ "$PYVER" -eq 26 -a $(uname -m) != 'x86_64' ]; then
|
||||||
# 32 bits CentOS 6 and affiliates are not supported anymore by certbot-auto.
|
# 32 bits CentOS 6 and affiliates are not supported anymore by certbot-auto.
|
||||||
|
@ -825,7 +825,7 @@ elif [ -f /etc/redhat-release ]; then
|
||||||
# Set RPM_DIST_VERSION to VERSION_ID from /etc/os-release after splitting on
|
# Set RPM_DIST_VERSION to VERSION_ID from /etc/os-release after splitting on
|
||||||
# '.' characters (e.g. "8.0" becomes "8"). If the command exits with an
|
# '.' characters (e.g. "8.0" becomes "8"). If the command exits with an
|
||||||
# error, RPM_DIST_VERSION is set to "unknown".
|
# error, RPM_DIST_VERSION is set to "unknown".
|
||||||
RPM_DIST_VERSION=$( (. /etc/os-release 2> /dev/null && echo "$VERSION_ID") | cut -d '.' -f1 || echo "unknown")
|
RPM_DIST_VERSION=$( (. /etc/os-release 2>/dev/null && echo "$VERSION_ID") | cut -d '.' -f1 || echo "unknown")
|
||||||
|
|
||||||
# If RPM_DIST_VERSION is an empty string or it contains any nonnumeric
|
# If RPM_DIST_VERSION is an empty string or it contains any nonnumeric
|
||||||
# characters, the value is unexpected so we set RPM_DIST_VERSION to 0.
|
# characters, the value is unexpected so we set RPM_DIST_VERSION to 0.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Check if cron is installed
|
- name: Check if cron is installed
|
||||||
shell: "set -o pipefail && dpkg -l cron 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
check_mode: no
|
check_mode: no
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
- ansible_distribution_major_version is version('10', '>=')
|
- ansible_distribution_major_version is version('10', '>=')
|
||||||
|
|
||||||
- name: Check if cron is installed
|
- name: Check if cron is installed
|
||||||
shell: "set -o pipefail && dpkg -l cron 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
failed_when: False
|
failed_when: False
|
||||||
|
|
|
@ -112,9 +112,9 @@ openssl_selfsigned() {
|
||||||
[ -r "${key}" ] || error "File ${key} is not readable"
|
[ -r "${key}" ] || error "File ${key} is not readable"
|
||||||
[ -w "${crt_dir}" ] || error "Directory ${crt_dir} is not writable"
|
[ -w "${crt_dir}" ] || error "Directory ${crt_dir} is not writable"
|
||||||
if grep -q SAN "${cfg}"; then
|
if grep -q SAN "${cfg}"; then
|
||||||
"${OPENSSL_BIN}" x509 -req -sha256 -days 365 -in "${csr}" -extensions SAN -extfile "${cfg}" -signkey "${key}" -out "${crt}" 2> /dev/null
|
"${OPENSSL_BIN}" x509 -req -sha256 -days 365 -in "${csr}" -extensions SAN -extfile "${cfg}" -signkey "${key}" -out "${crt}" 2>/dev/null
|
||||||
else
|
else
|
||||||
"${OPENSSL_BIN}" x509 -req -sha256 -days 365 -in "${csr}" -signkey "${key}" -out "${crt}" 2> /dev/null
|
"${OPENSSL_BIN}" x509 -req -sha256 -days 365 -in "${csr}" -signkey "${key}" -out "${crt}" 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -r "${crt}" ] || error "Something went wrong, ${crt} has not been generated"
|
[ -r "${crt}" ] || error "Something went wrong, ${crt} has not been generated"
|
||||||
|
@ -126,7 +126,7 @@ openssl_key(){
|
||||||
|
|
||||||
[ -w "${key_dir}" ] || error "Directory ${key_dir} is not writable"
|
[ -w "${key_dir}" ] || error "Directory ${key_dir} is not writable"
|
||||||
|
|
||||||
"${OPENSSL_BIN}" genrsa -out "${key}" "${size}" 2> /dev/null
|
"${OPENSSL_BIN}" genrsa -out "${key}" "${size}" 2>/dev/null
|
||||||
|
|
||||||
[ -r "${key}" ] || error "Something went wrong, ${key} has not been generated"
|
[ -r "${key}" ] || error "Something went wrong, ${key} has not been generated"
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ pick_server() {
|
||||||
if [ -e "${PIDFILE}" ]; then
|
if [ -e "${PIDFILE}" ]; then
|
||||||
pid=$(cat "${PIDFILE}")
|
pid=$(cat "${PIDFILE}")
|
||||||
# Does process still exist ?
|
# Does process still exist ?
|
||||||
if kill -0 "${pid}" 2> /dev/null; then
|
if kill -0 "${pid}" 2>/dev/null; then
|
||||||
# Killing the childs of evobackup.
|
# Killing the childs of evobackup.
|
||||||
for ppid in $(pgrep -P "${pid}"); do
|
for ppid in $(pgrep -P "${pid}"); do
|
||||||
kill -9 "${ppid}";
|
kill -9 "${ppid}";
|
||||||
|
|
|
@ -109,7 +109,7 @@ is_pack_samba(){
|
||||||
}
|
}
|
||||||
is_installed(){
|
is_installed(){
|
||||||
for pkg in "$@"; do
|
for pkg in "$@"; do
|
||||||
dpkg -l "$pkg" 2> /dev/null | grep -q -E '^(i|h)i' || return 1
|
dpkg -l "$pkg" 2>/dev/null | grep -q -E '^(i|h)i' || return 1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
minifirewall_file() {
|
minifirewall_file() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Check if cron is installed
|
- name: Check if cron is installed
|
||||||
shell: "set -o pipefail && dpkg -l cron 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
failed_when: False
|
failed_when: False
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
#- name: Customizing /etc/fstab
|
#- name: Customizing /etc/fstab
|
||||||
|
|
||||||
- name: Check if cron is installed
|
- name: Check if cron is installed
|
||||||
shell: "set -o pipefail && dpkg -l cron 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
check_mode: no
|
check_mode: no
|
||||||
|
|
|
@ -65,13 +65,13 @@ do
|
||||||
|
|
||||||
# mem
|
# mem
|
||||||
# libvirt stores memory in KiB, POW must be lowered by 1
|
# libvirt stores memory in KiB, POW must be lowered by 1
|
||||||
virsh dommemstat "$VM" 2> /dev/null | awk 'BEGIN{ret=1}$1~/^actual$/{print $2 / '$((POW / 1024))';ret=0}END{exit ret}' ||
|
virsh dommemstat "$VM" 2>/dev/null | awk 'BEGIN{ret=1}$1~/^actual$/{print $2 / '$((POW / 1024))';ret=0}END{exit ret}' ||
|
||||||
virsh dumpxml "$VM" | awk -F'[<>]' '$2~/^memory unit/{print $3/'$((POW / 1024))'}'
|
virsh dumpxml "$VM" | awk -F'[<>]' '$2~/^memory unit/{print $3/'$((POW / 1024))'}'
|
||||||
|
|
||||||
# disk
|
# disk
|
||||||
for BLK in $(virsh domblklist "$VM" | sed '1,2d;/-$/d;/^$/d' | awk '{print $1}')
|
for BLK in $(virsh domblklist "$VM" | sed '1,2d;/-$/d;/^$/d' | awk '{print $1}')
|
||||||
do
|
do
|
||||||
virsh domblkinfo "$VM" "$BLK" 2> /dev/null
|
virsh domblkinfo "$VM" "$BLK" 2>/dev/null
|
||||||
done | awk '/Physical:/ { size += $2 } END { print int(size / '${POW}') }'
|
done | awk '/Physical:/ { size += $2 } END { print int(size / '${POW}') }'
|
||||||
|
|
||||||
# state
|
# state
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Check if cron is installed
|
- name: Check if cron is installed
|
||||||
shell: "set -o pipefail && dpkg -l cron 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
check_mode: no
|
check_mode: no
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: Check if percona-release is installed
|
- name: Check if percona-release is installed
|
||||||
shell: "set -o pipefail && dpkg -l percona-release 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l percona-release 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
check_mode: no
|
check_mode: no
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
- postfix
|
- postfix
|
||||||
|
|
||||||
- name: Check if cron is installed
|
- name: Check if cron is installed
|
||||||
shell: "set -o pipefail && dpkg -l cron 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
check_mode: no
|
check_mode: no
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
- spamassassin
|
- spamassassin
|
||||||
|
|
||||||
- name: Check if cron is installed
|
- name: Check if cron is installed
|
||||||
shell: "set -o pipefail && dpkg -l cron 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
check_mode: no
|
check_mode: no
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
- ssl
|
- ssl
|
||||||
|
|
||||||
- name: Check if Haproxy is installed
|
- name: Check if Haproxy is installed
|
||||||
shell: "set -o pipefail && dpkg -l haproxy 2> /dev/null | grep -q -E '^(i|h)i'"
|
shell: "set -o pipefail && dpkg -l haproxy 2>/dev/null | grep -q -E '^(i|h)i'"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
register: haproxy_check
|
register: haproxy_check
|
||||||
|
|
Loading…
Reference in New Issue