Open whitehat101 opened 3 years ago
Hi, you may have a look to @Texiwill' aac-lib, see https://github.com/Texiwill/aac-lib/blob/master/base/ansible/aac-base-tz.yaml. He solved some issues using dependency checks 'ansible_os_family == "VMware Photon OS"' and 'ansible_os_family != "VMware Photon OS"'.
I eventually just applied the patch manually in my Dockerfile:
FROM photon:4.0
RUN tdnf update
RUN tdnf install -y ansible openssh-clients sshpass
# Add the Ansible tdnf module
WORKDIR /usr/share/ansible/plugins/modules
RUN curl https://raw.githubusercontent.com/vmware/photon/master/SPECS/ansible/ansible-tdnf.patch | patch
WORKDIR /root
And that worked for me.
I still feel like I'm overlooking the intended way to use that patch.
I'm trying to learn Ansible to manage my Photon VMs on ESXi. I was expecting a playbook like this would work from inside a PhotonOS 4.0 Docker image:
But I get errors:
ERROR! couldn't resolve module/action 'tdnf'. This often indicates a misspelling, missing collection, or incorrect module path.
I see this patch: https://github.com/vmware/photon/blob/master/SPECS/ansible/ansible.spec & https://github.com/vmware/photon/blob/master/SPECS/ansible/ansible-tdnf.patch Which appears to add the
tdnf
module to Ansible, but I haven't been able to figure out how to get that patched version of Ansible. The version in the Docker image is:I started trying to learn
rpmbuild
to build that spec, but I've encountered various issues, most recently thatansible-2.11.1
doesn't actually seem to be released http://releases.ansible.com/ansible/ansible-2.11.1.tar.gz https://pypi.org/project/ansible/#historyIs there a supported way to get Ansible with
tfnd
, on any OS? Perhaps a YUM repo I need to add? Or a command in this repo that I should be running that will successfully build that spec?