3

So I have been trying to install Ansible for some server management however it seems that yum and pip both don't want to co-operate:

  1. I tried a yum install which refuses to work because it cant seem to find any more repo's for babel/jinja2.
  2. pip installation works, however it left me without any Ansible.cfg file, or any /etc/Ansible directory at all. It seems to have installed it to the python 2.7 directory which is showing python configuration files but not anything to do with the standard Ansible configuration files that I have been seeing in the documentation.

Questions:

  • Is there any work around for this, or is there any way to just use Ansible through python directly (meaning update inventory lists and create playbooks that would I guess be saved to pythons directory?).
  • Also is there a way to force yum to install Ansible regardless of the jinja2/babel dependencies so I can at least work on creating my first few playbooks and getting familiar with the basics?

I'm not sure if these packages are necessary to Ansible operations and if it would create a dependency loop issue when trying to later install/update. Please go easy as I am new and trying to learn more about the capabilities of Ansbile. Os is RHEL 7.5 btw, and no it doesn't have a subscription I've been using EPEL which doesn't seem to work!

2 Answers 2

7

Ansible works fine from any directory. You don't need to use /etc/ansible.

  • Install Ansible from pip
  • Create work directory with recommended structure
  • Use -i to point your current inventory (testing or production, for example).
  • Create ansible.cfg in the root of your directory if you need:

    [defaults]
    #inventory      = /etc/ansible/hosts
    inventory      = hosts
    
4
  • Hi Alexey, not sure if its mentioned above or not, but I did try to install using pip..It also left me with a few issues that I could probably open up an entire new thread about.. the end goal is try to get a reproducible and easy procedure so I can deploy multiple environments all configured and ready to go without running into any problems. Thanks so much for your help though Commented Sep 17, 2018 at 15:24
  • @RickwhoPrograms, did you try some receipts from access.redhat.com/discussions/3149311 or stackoverflow.com/a/36774500/5287257? Commented Sep 18, 2018 at 8:11
  • Hi again Alexey, I did look over some of the other posts in regards to this issue with no luck...I kind of figured I would just wait until they released a newer version or something got updated on either the Ansible or the Epel side Commented Sep 18, 2018 at 16:37
  • Update:: I just found a way to install Jinja2 using pip, however the Ansible dependency loop is still persisting..maybe I need to move some files around? why would yum not recognize the Jinja2 if it is installed on the system? Commented Sep 18, 2018 at 16:45
0

You might want to try with Centos 7. Take a look at Is CentOS exactly the same as RHEL? and reiew for example How to Install and Configure Ansible on CentOS 7.

1
  • Would CentOS be using Epel repositories in order to try to install it? I have tried using Epel Repo's but the dependency error's i'm getting seem to stem from Python-Jinja2. There are 2 other Python packages that rely on Python-Jinja2 and even if I serperately install them with pip, it shows a dependency error through yum for all packaged because of Jinja2.. I am writing about this in response because even through Epel repo's the issue seems to persist..I have read somewhere that there was an issue going on with Ansible /yum dvd repo/epel repo as sources. Thanks for your input! Commented Sep 17, 2018 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .