While building an Ansible playbook to install Red Hat Ansible Automation Platform, I stumbled across an interesting issue. I was executing Ansible from the target system (this is not the norm). I am not 100% sure on the cause of the issue but believe it’s something to do with the check from the Red Hat Ansible Automation Platform (RHAAP for short) checking the local Ansible version. And it probably found my version, not its version. Hence the error. Running the RHAAP installer directly (not with Ansible) works.
The error I was getting is:
"stderr": "awk: fatal: cannot open file `group_vars/all' for reading (No such file or directory)\nTraceback (most recent call last):\n ...
So commenting out the following lines from the “setup.sh” installer file seems to bypass this check, and continues on as normal.
320 # # Check whether ansible was successfully installed 321 # if [ ${SKIP_ANSIBLE_CHECK} -ne 1 ]; then 322 # is_ansible_installed && is_ansible_new_enough 323 # if [ $? -ne 0 ]; then 324 # log_error "Unable to install the required version of ansible-core ($REQ_ANSIBLE_VER)." 325 # fatal_ansible_not_installed 326 # fi 327 # fi
The RHAAP installer works when you run “setup.sh” from the command line (not using Ansible), but as soon as the RHAAP installer is triggered from the Ansible playbook, the error occurs. It all makes sense.
This issue results from running Ansible from the wrong location. The solution is to “cd /the/path ; ansible-playbook ./myplaybook.yaml”.