ikke-t / podman-container-systemd

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

Failed to remove pod #1

Closed celebdor closed 4 years ago

celebdor commented 4 years ago

I was writing a playbook that cleans up some pods set up with this role and encountered the following issue:

TASK [ikke_t.podman_container_systemd : clean up pod configuration file] ******************************************************************************************************************************************
task path: /root/.ansible/roles/ikke_t.podman_container_systemd/tasks/main.yml:164
fatal: [127.0.0.1]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'container_pod_yaml' is undefined\n\nThe error appears to be in '/root/.ansible/roles/ikke_t.podman_container_systemd/tasks/main.yml': line 164, 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: clean up pod configuration file\n    ^ here\n"
}

I was trying to delete the pod like this:


- name: Delete CoreDNS container
  become: yes
  vars:
    container_name: "{{ coredns_container_name }}"
    container_state: absent
  import_role:
    name: ikke_t.podman_container_systemd
``