tripleo-ipa/scripts/bindep-install
Grzegorz Grasza e3afdf14b6 Use system installed ansible-freeipa instead of collections
The RHEL suppplied ansible-freeipa RPM package installs the
modules at the default ansible module path and not as a
collection. This caused problems for the end user.

This also changes the linter job to run on CentOS, since
the ansible-freeipa package is not available on Ubuntu.

This also reverts commit 2cc09a2b68c5b64b35742de91d4e7c0cd73f188c.
Reason for revert: We get this error:
 error={"msg": "template error while templating string:
 cannot import name 'environmentfilter' from 'jinja2.filters'
 (/usr/lib/python3.9/site-packages/ansible/_vendor/jinja2/filters.py)\n
  line 0. String: {{ 'A' if record_value | ansible.utils.ipv4
  else 'AAAA' }}"}

Change-Id: I7df25fb945da1d98c68fe4113a09afdc2f2c5687
2022-08-18 17:28:51 +02:00

46 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
## Shell Opts ----------------------------------------------------------------
set -o pipefail
set -xeuo
## Vars ----------------------------------------------------------------------
export BINDEP_FILE="${BINDEP_FILE:-$(dirname $(readlink -f ${BASH_SOURCE[0]}))/../bindep.txt}"
## Main ----------------------------------------------------------------------
# Source distribution information
source /etc/os-release || source /usr/lib/os-release
RHT_PKG_MGR=$(command -v dnf || command -v yum)
# NOTE(cloudnull): Get a list of packages to install with bindep. If packages
# need to be installed, bindep exits with an exit code of 1.
BINDEP_PKGS=$(bindep -b -f "${BINDEP_FILE}" test || true)
if [[ ${#BINDEP_PKGS} > 0 ]]; then
case "${ID,,}" in
amzn|rhel|centos|fedora)
sudo "${RHT_PKG_MGR}" install -y ${BINDEP_PKGS}
;;
esac
fi