I had the same issue, I found python-jinja2 in “Optional” repo.
Then I had some issues with public key of the package, which were solved (read ignored) by adding --nogpgcheck to yum install.
Entry from /etc/yum.repos.d/rhel.repo:
[Optional]
name=Red Hat Enterprise Linux $releasever $basearch - Optional
baseurl=http://mrepo.dev.sabre.com/$releasever-$basearch/RPMS.optional
enabled=0
gpgcheck=1
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Command that worked for me:
root@XXX# yum --enablerepo=Optional --nogpgcheck install python-jinja2.x86_64
could also be, which should resolve the dependency now:
root@XXX# yum --enablerepo=Optional --nogpgcheck install ansible
Alternately you could also:
- set enabled=1 in /etc/yum.repos.d/rhel.repo for this repo instead of --enablerepo=Optional on command line to yum
- set gpgcheck=0 in /etc/yum.repos.d/rhel.repo for this repo (OR install the key using rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release) instead of --nogpgcheck
Source: http://www.linuxquestions.org/questions/fedora-35/public-key-not-installed-468615/