ikke-t / podman-container-systemd

creates systemd files and creates containers using podman
118 stars 44 forks source link

AWX Podman Deployment Failing in RHEL 8 #31

Closed kymcharlesworth-srg closed 3 years ago

kymcharlesworth-srg commented 3 years ago

Tried another deployment in RHEL 8 on 12 Nov and got the following output:

_TASK [podman_containersystemd : ensure firewalld is installed] **** ok: [localhost]

_TASK [podman_containersystemd : ensure firewalld is installed (on fedora-iot)] *** skipping: [localhost]

_TASK [podman_container_systemd : reboot if new stuff was installed] **** fatal: [localhost]: FAILED! => {"msg": "The conditional check 'ostree.rc != 77' failed. The error was: error while evaluating conditional (ostree.rc != 77): 'dict object' has no attribute 'rc'\n\nThe error appears to be in '/home/ec2-user/.ansible/roles/podman_containersystemd/tasks/main.yml': line 190, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: reboot if new stuff was installed\n ^ here\n"}

On investigation, I was able to work around the issue by commenting out all the following lines from podman-container-systemd/tasks/main.yaml before running ansible-playbook -c local -i localhost, -b run-awx.yml

_- name: ensure firewalld is installed (on fedora-iot) tags: firewall command: >- rpm-ostree install --idempotent --unchanged-exit-77 --allow-inactive firewalld register: ostree failed_when: not ( ostree.rc == 77 or ostree.rc == 0 ) changed_when: ostree.rc != 77 when: ansible_pkg_mgr == "atomiccontainer"

Hope all that helps.

ikke-t commented 3 years ago

Can you please check what is the value of ansible_pkg_mgr in your target? It should not be atomic on rhel8, and thus should be skipped. This logic should be run only on rpm-ostree using targets.

If it fails on RHEL8 target, the when statement has some problem. On my rhel8 such when works, and this gets skipped. And on my Fedora-IoT it is run.

ikke-t commented 3 years ago

Found it, there was order problem in when clause. It checked the facts in wrong order. Fixed by https://github.com/ikke-t/podman-container-systemd/commit/c6e269435120d04450e4e0e1410019016c77791f