diff --git a/scripts/ansible b/scripts/ansible index 1d60fbdf5..52a27a25d 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -31,13 +31,14 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant pip install --upgrade pip setuptools wheel #EOL just do it pip install ansible==$GOOD_VER --disable-pip-version-check # Parens are optional, but greatly clarify :) - elif (grep -qi ubuntu /etc/lsb-release) || (grep -qi ubuntu /etc/os-release); then + elif (grep -qi ubuntu /etc/lsb-release 2> /dev/null) || (grep -qi ubuntu /etc/os-release); then apt -y install python-pip python-setuptools python-wheel patch apt-add-repository -y ppa:ansible/ansible #apt-add-repository -y ppa:ansible/ansible-2.4 # elif UBUNTU MUST REMAIN ABOVE (as Ubuntu ALSO contains /etc/debian_version, which would trigger the line just below) elif [ -f /etc/debian_version ] || (grep -qi raspbian /etc/*elease) ; then if ( ! grep -qi ansible /etc/apt/sources.list) && [ ! -f /etc/apt/sources.list.d/ansible ]; then + apt update apt -y install dirmngr python-pip python-setuptools python-wheel patch echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ >> /etc/apt/sources.list.d/iiab-ansible.list diff --git a/scripts/ansible-2.4.x b/scripts/ansible-2.4.x index 4e8e74595..bebfd3f5b 100755 --- a/scripts/ansible-2.4.x +++ b/scripts/ansible-2.4.x @@ -32,13 +32,14 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant pip install --upgrade pip setuptools wheel #EOL just do it pip install ansible==$GOOD_VER --disable-pip-version-check # Parens are optional, but greatly clarify :) - elif (grep -qi ubuntu /etc/lsb-release) || (grep -qi ubuntu /etc/os-release); then + elif (grep -qi ubuntu /etc/lsb-release 2> /dev/null) || (grep -qi ubuntu /etc/os-release); then apt -y install python-pip python-setuptools python-wheel patch #apt-add-repository -y ppa:ansible/ansible apt-add-repository -y ppa:ansible/ansible-2.4 # elif UBUNTU MUST REMAIN ABOVE (as Ubuntu ALSO contains /etc/debian_version, which would trigger the line just below) elif [ -f /etc/debian_version ] || (grep -qi raspbian /etc/*elease) ; then if ( ! grep -qi ansible /etc/apt/sources.list) && [ ! -f /etc/apt/sources.list.d/ansible ]; then + apt update apt -y install dirmngr python-pip python-setuptools python-wheel patch #echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ # >> /etc/apt/sources.list.d/iiab-ansible.list diff --git a/scripts/ansible-2.5.x b/scripts/ansible-2.5.x index 38c31b64a..08a0741bb 100755 --- a/scripts/ansible-2.5.x +++ b/scripts/ansible-2.5.x @@ -31,13 +31,14 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant pip install --upgrade pip setuptools wheel #EOL just do it pip install ansible==$GOOD_VER --disable-pip-version-check # Parens are optional, but greatly clarify :) - elif (grep -qi ubuntu /etc/lsb-release) || (grep -qi ubuntu /etc/os-release); then + elif (grep -qi ubuntu /etc/lsb-release 2> /dev/null) || (grep -qi ubuntu /etc/os-release); then apt -y install python-pip python-setuptools python-wheel patch #apt-add-repository -y ppa:ansible/ansible apt-add-repository -y ppa:ansible/ansible-2.5 # elif UBUNTU MUST REMAIN ABOVE (as Ubuntu ALSO contains /etc/debian_version, which would trigger the line just below) elif [ -f /etc/debian_version ] || (grep -qi raspbian /etc/*elease) ; then if ( ! grep -qi ansible /etc/apt/sources.list) && [ ! -f /etc/apt/sources.list.d/ansible ]; then + apt update apt -y install dirmngr python-pip python-setuptools python-wheel patch #echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ # >> /etc/apt/sources.list.d/iiab-ansible.list