Hi,
I am really new here (and also to Ansible Tower), but our project has been using Ansible Tower a while, and they are now/currently in the process of upgrading the Tower, as follows:
Was: "1.2 AAP"??
Help==>About shows: Tower 3.8.3
Ansible 2.9.20
ansible --version ==> ansible 2.9.20
To:
Now: "2.4 AAP"??
Help==>About shows" Ansible Automation Platform Controller 4.5.1
ansible --version ==> ansible [core 2.15.9]
The upgrade installation has been done and we have been testing the new Tower by running some of our existing Templates, etc. to check what is working (and what is not) and we have encountered a problem where when we run one of our roles (a template), it is failing with the following messages (FYI, Verbosity was set to “1”):
Identity added: /runner/artifacts/92609/ssh_key_data (/runner/artifacts/92609/ssh_key_data)
Using /etc/ansible/ansible.cfg as config file
Vault password:
ERROR! couldn't resolve module/action 'alternatives'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/runner/project/roles/common/java1_8_role/tasks/main.yml': line 104, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
## Set default java to new version ##
- name: Set default java to new version
^ here
That part of the main.yml looks like:
103 ## Set default java to new version ##
104 - name: Set default java to new version
105 alternatives:
106 link: /usr/bin/java
107 name: java
108 path: "{{ play_java_alternative }}"
109 priority: 1
110 when: play_install_java
Also, we tried running a YML that also uses at least part of the same Set default java to new version
and using ansible-playbook (command line), and it worked without error.
FYI:
- Tower is on an RHEL8 machine
- I think Tower is running under a user named “awx”
- When we did the test using ansible-playbook, that command was run as a different user named “svc”.
As I said, I’m kind of new to Ansible, but I was wondering how we might go about trying to determine why that alternatives
module is apparently not available when we use Tower, vs. being available when we run similar code using ansible-playbook as the “svc” user? Does Tower output any debug logging that would perhaps show up where it is looking for that module, etc.?
Thanks in advance, and if more detail is needed, please let me know and I will try to provide it!
Jim