containers / ansible-podman-collections

Repository for Ansible content that can include playbooks, roles, modules, and plugins for use with the Podman tool
GNU General Public License v3.0
263 stars 143 forks source link

podman_container fails with error "short-name resolution enforced but cannot prompt without a TTY" #567

Closed millerthegorilla closed 1 year ago

millerthegorilla commented 1 year ago

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Steps to reproduce the issue:

  1. create ansible playbook as follows:
---
- name: Provision 1 - transpile and install on sdcard
  hosts: localhost
  connection: local
  become: yes
  become_method: sudo
  tasks:
    - name: Pull install image
      containers.podman.podman_image:
        name: quay.io/coreos/coreos-installer:latest
        state: present
      register: image_output
    - debug: var=image_output
    - name: Get Image Infp
      containers.podman.podman_image_info:
        name: coreos-installer
      register: image_info
    - debug: var=image_info.images[0].Id
    - name: Use podman container to install to sd card
      containers.podman.podman_container:
        name: ignition_container
        image: "{{ image_info.images[0].Id }}"
        # image: registry.fedoraproject.org/coreos-installer:latest
        volume:
          - /dev:/dev
          - /run/udev:/run/udev
          - .:/data
        workdir: /data
        rm: true
        privileged: true
        cmd_args:
          - "install"
          - "/dev/sda"
          - "-i"
          - "./files/config.ign"
  1. Run the playbook
  2. error is produced in output
    fatal: [localhost]: FAILED! => {"changed": false, "msg": "Can't run container ignition_container", "stderr": "Error: short-name resolution enforced but cannot prompt without a TTY\n", "stderr_lines": ["Error: short-name resolution enforced but cannot prompt without a TTY"], "stdout": "", "stdout_lines": []}

Describe the results you received:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Can't run container ignition_container", "stderr": "Error: short-name resolution enforced but cannot prompt without a TTY\n", "stderr_lines": ["Error: short-name resolution enforced but cannot prompt without a TTY"], "stdout": "", "stdout_lines": []}

Describe the results you expected: I expected that a container would be created from the image, and for the container to process the cmd_args and then produce a correctly provisioned microsd-card

Additional information you deem important (e.g. issue happens only occasionally): Using become, the container is installed in the root account. But become is necessary for privileged flag to work so that the microsd card can be mounted inside container. When the command is run inside a terminal, it works without issue, and doesn't complain about short-name resolution. When the command is run using ansible.builtin.shell, the command runs fine.

Version of the containers.podman collection: Either git commit if installed from git: git show --summary Or version from ansible-galaxy if installed from galaxy: ansible-galaxy collection list | grep containers.podman

I don't have ansible-galaxy available.  I installed ansible using pip

pip show ansible
Name: ansible
Version: 7.4.0
Summary: Radically simple IT automation
Home-page: https://ansible.com/
Author: Ansible, Inc.
Author-email: info@ansible.com
License: GPLv3+
Location: /var/home/admin/src/motioncore/motioncore_venv/lib64/python3.11/site-packages
Requires: ansible-core
Required-by: 

Output of ansible --version:

ansible [core 2.14.4]
  config file = None
  configured module search path = ['/var/home/admin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /var/home/admin/src/motioncore/motioncore_venv/lib64/python3.11/site-packages/ansible
  ansible collection location = /var/home/admin/.ansible/collections:/usr/share/ansible/collections
  executable location = /var/home/admin/src/motioncore/motioncore_venv/bin/ansible
  python version = 3.11.2 (main, Feb  8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] (/var/home/admin/src/motioncore/motioncore_venv/bin/python)
  jinja version = 3.1.2
  libyaml = True

Output of podman version:

podman version 4.4.2

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.29.0
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.7-2.fc37.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.7, commit: '
  cpuUtilization:
    idlePercent: 97.23
    systemPercent: 0.61
    userPercent: 2.16
  cpus: 8
  distribution:
    distribution: fedora
    variant: silverblue
    version: "37"
  eventLogger: journald
  hostname: fedora
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1002
      size: 1
    - container_id: 1
      host_id: 231072
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1002
      size: 1
    - container_id: 1
      host_id: 231072
      size: 65536
  kernel: 6.2.7-200.fc37.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 9124687872
  memTotal: 20639293440
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.8.2-2.fc37.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.8.2
      commit: bf70c97995109417ac0c5ed0a758d82662456724
      rundir: /run/user/1002/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1002/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-8.fc37.x86_64
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 4h 18m 4.00s (Approximately 0.17 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /var/home/admin/.config/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 0
    stopped: 1
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/admin/.local/share/containers/storage
  graphRootAllocated: 351987040256
  graphRootUsed: 233727721472
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 2
  runRoot: /run/user/1002/containers
  transientStore: false
  volumePath: /var/home/admin/.local/share/containers/storage/volumes
version:
  APIVersion: 4.4.2
  Built: 1677669779
  BuiltTime: Wed Mar  1 11:22:59 2023
  GitCommit: ""
  GoVersion: go1.19.6
  Os: linux
  OsArch: linux/amd64
  Version: 4.4.2

Package info (e.g. output of rpm -q podman or apt list podman):

pip show ansible
Name: ansible
Version: 7.4.0
Summary: Radically simple IT automation
Home-page: https://ansible.com/
Author: Ansible, Inc.
Author-email: info@ansible.com
License: GPLv3+
Location: /var/home/admin/src/motioncore/motioncore_venv/lib64/python3.11/site-packages
Requires: ansible-core
Required-by: 

Playbok you run with ansible (e.g. content of playbook.yaml):

---
- name: Provision 1 - transpile and install on sdcard
  hosts: localhost
  connection: local
  become: yes
  become_method: sudo
  tasks:
    - name: Pull install image
      containers.podman.podman_image:
        name: quay.io/coreos/coreos-installer:latest
        state: present
      register: image_output
    - debug: var=image_output
    - name: Get Image Infp
      containers.podman.podman_image_info:
        name: coreos-installer
      register: image_info
    - debug: var=image_info.images[0].Id
    - name: Use podman container to install to sd card
      containers.podman.podman_container:
        name: ignition_container
        image: "{{ image_info.images[0].Id }}"
        # image: registry.fedoraproject.org/coreos-installer:latest
        volume:
          - /dev:/dev
          - /run/udev:/run/udev
          - .:/data
        workdir: /data
        rm: true
        privileged: true
        cmd_args:
          - "install"
          - "/dev/sda"
          - "-i"
          - "./files/config.ign"

Command line and output of ansible run with high verbosity

Please NOTE: if you submit a bug about idempotency, run the playbook with --diff option, like:

ansible-playbook -i inventory --diff -vv playbook.yml

ansible-playbook --diff -vvv ansible/coreos_config/provision/provision1-2.yaml --ask-become-pass
ansible-playbook [core 2.14.4]
  config file = None
  configured module search path = ['/var/home/admin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /var/home/admin/src/motioncore/motioncore_venv/lib64/python3.11/site-packages/ansible
  ansible collection location = /var/home/admin/.ansible/collections:/usr/share/ansible/collections
  executable location = /var/home/admin/src/motioncore/motioncore_venv/bin/ansible-playbook
  python version = 3.11.2 (main, Feb  8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] (/var/home/admin/src/motioncore/motioncore_venv/bin/python)
  jinja version = 3.1.2
  libyaml = True
No config file found; using defaults
BECOME password: 
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: provision1-2.yaml ****************************************************
1 plays in ansible/coreos_config/provision/provision1-2.yaml

PLAY [Provision 1 - transpile and install on sdcard] ***************************

TASK [Gathering Facts] *********************************************************
task path: /var/home/admin/src/motioncore/ansible/coreos_config/provision/provision1-2.yaml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: admin
<127.0.0.1> EXEC /bin/sh -c 'echo ~admin && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/home/admin/.ansible/tmp `"&& mkdir "` echo /var/home/admin/.ansible/tmp/ansible-tmp-1680275773.0952854-25820-270313346882183 `" && echo ansible-tmp-1680275773.0952854-25820-270313346882183="` echo /var/home/admin/.ansible/tmp/ansible-tmp-1680275773.0952854-25820-270313346882183 `" ) && sleep 0'
Using module file /var/home/admin/src/motioncore/motioncore_venv/lib64/python3.11/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /var/home/admin/.ansible/tmp/ansible-local-25816812c8op0/tmp_9_qy1ck TO /var/home/admin/.ansible/tmp/ansible-tmp-1680275773.0952854-25820-270313346882183/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/home/admin/.ansible/tmp/ansible-tmp-1680275773.0952854-25820-270313346882183/ /var/home/admin/.ansible/tmp/ansible-tmp-1680275773.0952854-25820-270313346882183/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=fdsgwvbatawnvrhkqffupgcervvguxzm] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-fdsgwvbatawnvrhkqffupgcervvguxzm ; /var/home/admin/src/motioncore/motioncore_venv/bin/python /var/home/admin/.ansible/tmp/ansible-tmp-1680275773.0952854-25820-270313346882183/AnsiballZ_setup.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/home/admin/.ansible/tmp/ansible-tmp-1680275773.0952854-25820-270313346882183/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]

TASK [Pull install image] ******************************************************
task path: /var/home/admin/src/motioncore/ansible/coreos_config/provision/provision1-2.yaml:11
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: admin
<127.0.0.1> EXEC /bin/sh -c 'echo ~admin && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/home/admin/.ansible/tmp `"&& mkdir "` echo /var/home/admin/.ansible/tmp/ansible-tmp-1680275774.1110606-25888-259680926384107 `" && echo ansible-tmp-1680275774.1110606-25888-259680926384107="` echo /var/home/admin/.ansible/tmp/ansible-tmp-1680275774.1110606-25888-259680926384107 `" ) && sleep 0'
Using module file /var/home/admin/src/motioncore/motioncore_venv/lib64/python3.11/site-packages/ansible_collections/containers/podman/plugins/modules/podman_image.py
<127.0.0.1> PUT /var/home/admin/.ansible/tmp/ansible-local-25816812c8op0/tmpco8t2zf2 TO /var/home/admin/.ansible/tmp/ansible-tmp-1680275774.1110606-25888-259680926384107/AnsiballZ_podman_image.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/home/admin/.ansible/tmp/ansible-tmp-1680275774.1110606-25888-259680926384107/ /var/home/admin/.ansible/tmp/ansible-tmp-1680275774.1110606-25888-259680926384107/AnsiballZ_podman_image.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=uqohuqjusgdfzgeiplhdiyzzqlkmygwt] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-uqohuqjusgdfzgeiplhdiyzzqlkmygwt ; /var/home/admin/src/motioncore/motioncore_venv/bin/python /var/home/admin/.ansible/tmp/ansible-tmp-1680275774.1110606-25888-259680926384107/AnsiballZ_podman_image.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/home/admin/.ansible/tmp/ansible-tmp-1680275774.1110606-25888-259680926384107/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => {
    "actions": [
        "Pulled image quay.io/coreos/coreos-installer:latest"
    ],
    "changed": true,
    "image": [
        {
            "Annotations": {},
            "Architecture": "amd64",
            "Author": "",
            "Comment": "Created by Image Factory",
            "Config": {
                "Entrypoint": [
                    "/usr/sbin/coreos-installer"
                ],
                "Env": [
                    "DISTTAG=f37container",
                    "FGC=f37",
                    "container=oci",
                    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                ],
                "Labels": {
                    "io.buildah.version": "1.23.1",
                    "license": "MIT",
                    "name": "fedora",
                    "vendor": "Fedora Project",
                    "version": "37"
                }
            },
            "Created": "2023-03-27T22:40:21.951784023Z",
            "Digest": "sha256:7b23746f5a793617bf96caf826c3ec864223cff8ee36bd55dc374dc2f586fc62",
            "GraphDriver": {
                "Data": {
                    "LowerDir": "/var/lib/containers/storage/overlay/2b131cfbf23be67355e940a5b842c6ef48c3f523e26ca218da910e9cfc2a58cf/diff:/var/lib/containers/storage/overlay/178c5a3203aea37107a1afcc9a965d6f9058cb12e31f6ecc900a48c310b27389/diff",
                    "UpperDir": "/var/lib/containers/storage/overlay/97a9b9b54c90c82a73df353b4bccc0fb486ed6ed0580b72f52dc1305a26e17a2/diff",
                    "WorkDir": "/var/lib/containers/storage/overlay/97a9b9b54c90c82a73df353b4bccc0fb486ed6ed0580b72f52dc1305a26e17a2/work"
                },
                "Name": "overlay"
            },
            "History": [
                {
                    "comment": "Created by Image Factory",
                    "created": "2023-03-11T05:51:16Z"
                },
                {
                    "comment": "FROM registry.fedoraproject.org/fedora:37",
                    "created": "2023-03-27T22:40:20.400850138Z",
                    "created_by": "/bin/sh -c dnf install -y /usr/bin/gpg /usr/sbin/kpartx /usr/bin/lsblk     /usr/sbin/udevadm &&     dnf clean all"
                },
                {
                    "created": "2023-03-27T22:40:21.726583179Z",
                    "created_by": "/bin/sh -c #(nop) COPY file:0dad3e9db35223253d30f2fedaf5df90d43d0857cce1d628f695418f9189389a in /usr/sbin "
                },
                {
                    "created": "2023-03-27T22:40:21.952020323Z",
                    "created_by": "/bin/sh -c #(nop) ENTRYPOINT [\"/usr/sbin/coreos-installer\"]",
                    "empty_layer": true
                }
            ],
            "Id": "8603c8a16e9aa6402ff3bf6b45fc405478fa5abe4c3882984b18fd434cd3c59c",
            "Labels": {
                "io.buildah.version": "1.23.1",
                "license": "MIT",
                "name": "fedora",
                "vendor": "Fedora Project",
                "version": "37"
            },
            "ManifestType": "application/vnd.oci.image.manifest.v1+json",
            "NamesHistory": [
                "quay.io/coreos/coreos-installer:latest"
            ],
            "Os": "linux",
            "Parent": "",
            "RepoDigests": [
                "quay.io/coreos/coreos-installer@sha256:1a8f3e79824463a957e5a74bda172684a5918cefac39e29e93069c6465da84be",
                "quay.io/coreos/coreos-installer@sha256:7b23746f5a793617bf96caf826c3ec864223cff8ee36bd55dc374dc2f586fc62"
            ],
            "RepoTags": [
                "quay.io/coreos/coreos-installer:latest"
            ],
            "RootFS": {
                "Layers": [
                    "sha256:178c5a3203aea37107a1afcc9a965d6f9058cb12e31f6ecc900a48c310b27389",
                    "sha256:66cd2b87175fd95ad5ba7f7c2fd09aa08b7fae9a9925c759016240ec081ec942",
                    "sha256:7d6ca00eb061ff665188a84f0c16c44420be62bdcfc78c58a0c8cba6014637ba"
                ],
                "Type": "layers"
            },
            "Size": 276751325,
            "User": "",
            "Version": "",
            "VirtualSize": 276751325
        }
    ],
    "invocation": {
        "module_args": {
            "auth_file": null,
            "build": {
                "annotation": null,
                "cache": true,
                "extra_args": null,
                "file": null,
                "force_rm": false,
                "format": "oci",
                "rm": true,
                "volume": null
            },
            "ca_cert_dir": null,
            "executable": "podman",
            "force": false,
            "name": "quay.io/coreos/coreos-installer:latest",
            "password": null,
            "path": null,
            "pull": true,
            "push": false,
            "push_args": {
                "compress": null,
                "dest": null,
                "format": null,
                "remove_signatures": null,
                "sign_by": null,
                "transport": null
            },
            "state": "present",
            "tag": "latest",
            "username": null,
            "validate_certs": null
        }
    },
    "podman_actions": [
        "/usr/bin/podman image ls quay.io/coreos/coreos-installer:latest --format json",
        "/usr/bin/podman pull quay.io/coreos/coreos-installer:latest -q",
        "/usr/bin/podman inspect 8603c8a16e9aa6402ff3bf6b45fc405478fa5abe4c3882984b18fd434cd3c59c --format json"
    ]
}

TASK [debug] *******************************************************************
task path: /var/home/admin/src/motioncore/ansible/coreos_config/provision/provision1-2.yaml:16
ok: [localhost] => {
    "image_output": {
        "actions": [
            "Pulled image quay.io/coreos/coreos-installer:latest"
        ],
        "changed": true,
        "failed": false,
        "image": [
            {
                "Annotations": {},
                "Architecture": "amd64",
                "Author": "",
                "Comment": "Created by Image Factory",
                "Config": {
                    "Entrypoint": [
                        "/usr/sbin/coreos-installer"
                    ],
                    "Env": [
                        "DISTTAG=f37container",
                        "FGC=f37",
                        "container=oci",
                        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                    ],
                    "Labels": {
                        "io.buildah.version": "1.23.1",
                        "license": "MIT",
                        "name": "fedora",
                        "vendor": "Fedora Project",
                        "version": "37"
                    }
                },
                "Created": "2023-03-27T22:40:21.951784023Z",
                "Digest": "sha256:7b23746f5a793617bf96caf826c3ec864223cff8ee36bd55dc374dc2f586fc62",
                "GraphDriver": {
                    "Data": {
                        "LowerDir": "/var/lib/containers/storage/overlay/2b131cfbf23be67355e940a5b842c6ef48c3f523e26ca218da910e9cfc2a58cf/diff:/var/lib/containers/storage/overlay/178c5a3203aea37107a1afcc9a965d6f9058cb12e31f6ecc900a48c310b27389/diff",
                        "UpperDir": "/var/lib/containers/storage/overlay/97a9b9b54c90c82a73df353b4bccc0fb486ed6ed0580b72f52dc1305a26e17a2/diff",
                        "WorkDir": "/var/lib/containers/storage/overlay/97a9b9b54c90c82a73df353b4bccc0fb486ed6ed0580b72f52dc1305a26e17a2/work"
                    },
                    "Name": "overlay"
                },
                "History": [
                    {
                        "comment": "Created by Image Factory",
                        "created": "2023-03-11T05:51:16Z"
                    },
                    {
                        "comment": "FROM registry.fedoraproject.org/fedora:37",
                        "created": "2023-03-27T22:40:20.400850138Z",
                        "created_by": "/bin/sh -c dnf install -y /usr/bin/gpg /usr/sbin/kpartx /usr/bin/lsblk     /usr/sbin/udevadm &&     dnf clean all"
                    },
                    {
                        "created": "2023-03-27T22:40:21.726583179Z",
                        "created_by": "/bin/sh -c #(nop) COPY file:0dad3e9db35223253d30f2fedaf5df90d43d0857cce1d628f695418f9189389a in /usr/sbin "
                    },
                    {
                        "created": "2023-03-27T22:40:21.952020323Z",
                        "created_by": "/bin/sh -c #(nop) ENTRYPOINT [\"/usr/sbin/coreos-installer\"]",
                        "empty_layer": true
                    }
                ],
                "Id": "8603c8a16e9aa6402ff3bf6b45fc405478fa5abe4c3882984b18fd434cd3c59c",
                "Labels": {
                    "io.buildah.version": "1.23.1",
                    "license": "MIT",
                    "name": "fedora",
                    "vendor": "Fedora Project",
                    "version": "37"
                },
                "ManifestType": "application/vnd.oci.image.manifest.v1+json",
                "NamesHistory": [
                    "quay.io/coreos/coreos-installer:latest"
                ],
                "Os": "linux",
                "Parent": "",
                "RepoDigests": [
                    "quay.io/coreos/coreos-installer@sha256:1a8f3e79824463a957e5a74bda172684a5918cefac39e29e93069c6465da84be",
                    "quay.io/coreos/coreos-installer@sha256:7b23746f5a793617bf96caf826c3ec864223cff8ee36bd55dc374dc2f586fc62"
                ],
                "RepoTags": [
                    "quay.io/coreos/coreos-installer:latest"
                ],
                "RootFS": {
                    "Layers": [
                        "sha256:178c5a3203aea37107a1afcc9a965d6f9058cb12e31f6ecc900a48c310b27389",
                        "sha256:66cd2b87175fd95ad5ba7f7c2fd09aa08b7fae9a9925c759016240ec081ec942",
                        "sha256:7d6ca00eb061ff665188a84f0c16c44420be62bdcfc78c58a0c8cba6014637ba"
                    ],
                    "Type": "layers"
                },
                "Size": 276751325,
                "User": "",
                "Version": "",
                "VirtualSize": 276751325
            }
        ],
        "podman_actions": [
            "/usr/bin/podman image ls quay.io/coreos/coreos-installer:latest --format json",
            "/usr/bin/podman pull quay.io/coreos/coreos-installer:latest -q",
            "/usr/bin/podman inspect 8603c8a16e9aa6402ff3bf6b45fc405478fa5abe4c3882984b18fd434cd3c59c --format json"
        ]
    }
}

TASK [Get Image Info] **********************************************************
task path: /var/home/admin/src/motioncore/ansible/coreos_config/provision/provision1-2.yaml:17
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: admin
<127.0.0.1> EXEC /bin/sh -c 'echo ~admin && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/home/admin/.ansible/tmp `"&& mkdir "` echo /var/home/admin/.ansible/tmp/ansible-tmp-1680275781.758753-25986-196825028911963 `" && echo ansible-tmp-1680275781.758753-25986-196825028911963="` echo /var/home/admin/.ansible/tmp/ansible-tmp-1680275781.758753-25986-196825028911963 `" ) && sleep 0'
Using module file /var/home/admin/src/motioncore/motioncore_venv/lib64/python3.11/site-packages/ansible_collections/containers/podman/plugins/modules/podman_image_info.py
<127.0.0.1> PUT /var/home/admin/.ansible/tmp/ansible-local-25816812c8op0/tmpxuuirp2e TO /var/home/admin/.ansible/tmp/ansible-tmp-1680275781.758753-25986-196825028911963/AnsiballZ_podman_image_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/home/admin/.ansible/tmp/ansible-tmp-1680275781.758753-25986-196825028911963/ /var/home/admin/.ansible/tmp/ansible-tmp-1680275781.758753-25986-196825028911963/AnsiballZ_podman_image_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=wcnndinqvuwjkkbccatqywddvqemefsu] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-wcnndinqvuwjkkbccatqywddvqemefsu ; /var/home/admin/src/motioncore/motioncore_venv/bin/python /var/home/admin/.ansible/tmp/ansible-tmp-1680275781.758753-25986-196825028911963/AnsiballZ_podman_image_info.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/home/admin/.ansible/tmp/ansible-tmp-1680275781.758753-25986-196825028911963/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "changed": false,
    "images": [
        {
            "Annotations": {},
            "Architecture": "amd64",
            "Author": "",
            "Comment": "Created by Image Factory",
            "Config": {
                "Entrypoint": [
                    "/usr/sbin/coreos-installer"
                ],
                "Env": [
                    "DISTTAG=f37container",
                    "FGC=f37",
                    "container=oci",
                    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                ],
                "Labels": {
                    "io.buildah.version": "1.23.1",
                    "license": "MIT",
                    "name": "fedora",
                    "vendor": "Fedora Project",
                    "version": "37"
                }
            },
            "Created": "2023-03-27T22:40:21.951784023Z",
            "Digest": "sha256:7b23746f5a793617bf96caf826c3ec864223cff8ee36bd55dc374dc2f586fc62",
            "GraphDriver": {
                "Data": {
                    "LowerDir": "/var/lib/containers/storage/overlay/2b131cfbf23be67355e940a5b842c6ef48c3f523e26ca218da910e9cfc2a58cf/diff:/var/lib/containers/storage/overlay/178c5a3203aea37107a1afcc9a965d6f9058cb12e31f6ecc900a48c310b27389/diff",
                    "UpperDir": "/var/lib/containers/storage/overlay/97a9b9b54c90c82a73df353b4bccc0fb486ed6ed0580b72f52dc1305a26e17a2/diff",
                    "WorkDir": "/var/lib/containers/storage/overlay/97a9b9b54c90c82a73df353b4bccc0fb486ed6ed0580b72f52dc1305a26e17a2/work"
                },
                "Name": "overlay"
            },
            "History": [
                {
                    "comment": "Created by Image Factory",
                    "created": "2023-03-11T05:51:16Z"
                },
                {
                    "comment": "FROM registry.fedoraproject.org/fedora:37",
                    "created": "2023-03-27T22:40:20.400850138Z",
                    "created_by": "/bin/sh -c dnf install -y /usr/bin/gpg /usr/sbin/kpartx /usr/bin/lsblk     /usr/sbin/udevadm &&     dnf clean all"
                },
                {
                    "created": "2023-03-27T22:40:21.726583179Z",
                    "created_by": "/bin/sh -c #(nop) COPY file:0dad3e9db35223253d30f2fedaf5df90d43d0857cce1d628f695418f9189389a in /usr/sbin "
                },
                {
                    "created": "2023-03-27T22:40:21.952020323Z",
                    "created_by": "/bin/sh -c #(nop) ENTRYPOINT [\"/usr/sbin/coreos-installer\"]",
                    "empty_layer": true
                }
            ],
            "Id": "8603c8a16e9aa6402ff3bf6b45fc405478fa5abe4c3882984b18fd434cd3c59c",
            "Labels": {
                "io.buildah.version": "1.23.1",
                "license": "MIT",
                "name": "fedora",
                "vendor": "Fedora Project",
                "version": "37"
            },
            "ManifestType": "application/vnd.oci.image.manifest.v1+json",
            "NamesHistory": [
                "quay.io/coreos/coreos-installer:latest"
            ],
            "Os": "linux",
            "Parent": "",
            "RepoDigests": [
                "quay.io/coreos/coreos-installer@sha256:1a8f3e79824463a957e5a74bda172684a5918cefac39e29e93069c6465da84be",
                "quay.io/coreos/coreos-installer@sha256:7b23746f5a793617bf96caf826c3ec864223cff8ee36bd55dc374dc2f586fc62"
            ],
            "RepoTags": [
                "quay.io/coreos/coreos-installer:latest"
            ],
            "RootFS": {
                "Layers": [
                    "sha256:178c5a3203aea37107a1afcc9a965d6f9058cb12e31f6ecc900a48c310b27389",
                    "sha256:66cd2b87175fd95ad5ba7f7c2fd09aa08b7fae9a9925c759016240ec081ec942",
                    "sha256:7d6ca00eb061ff665188a84f0c16c44420be62bdcfc78c58a0c8cba6014637ba"
                ],
                "Type": "layers"
            },
            "Size": 276751325,
            "User": "",
            "Version": "",
            "VirtualSize": 276751325
        }
    ],
    "invocation": {
        "module_args": {
            "executable": "podman",
            "name": [
                "coreos-installer"
            ]
        }
    }
}

TASK [debug] *******************************************************************
task path: /var/home/admin/src/motioncore/ansible/coreos_config/provision/provision1-2.yaml:21
ok: [localhost] => {
    "image_info.images[0].Id": "8603c8a16e9aa6402ff3bf6b45fc405478fa5abe4c3882984b18fd434cd3c59c"
}

TASK [Use podman container to install to sd card] ******************************
task path: /var/home/admin/src/motioncore/ansible/coreos_config/provision/provision1-2.yaml:22
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: admin
<127.0.0.1> EXEC /bin/sh -c 'echo ~admin && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/home/admin/.ansible/tmp `"&& mkdir "` echo /var/home/admin/.ansible/tmp/ansible-tmp-1680275782.0315228-26030-127424669188120 `" && echo ansible-tmp-1680275782.0315228-26030-127424669188120="` echo /var/home/admin/.ansible/tmp/ansible-tmp-1680275782.0315228-26030-127424669188120 `" ) && sleep 0'
Using module file /var/home/admin/src/motioncore/motioncore_venv/lib64/python3.11/site-packages/ansible_collections/containers/podman/plugins/modules/podman_container.py
<127.0.0.1> PUT /var/home/admin/.ansible/tmp/ansible-local-25816812c8op0/tmpy6krwi7g TO /var/home/admin/.ansible/tmp/ansible-tmp-1680275782.0315228-26030-127424669188120/AnsiballZ_podman_container.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/home/admin/.ansible/tmp/ansible-tmp-1680275782.0315228-26030-127424669188120/ /var/home/admin/.ansible/tmp/ansible-tmp-1680275782.0315228-26030-127424669188120/AnsiballZ_podman_container.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=sbmepoelkkdmjczunuelachpqalfxkrl] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-sbmepoelkkdmjczunuelachpqalfxkrl ; /var/home/admin/src/motioncore/motioncore_venv/bin/python /var/home/admin/.ansible/tmp/ansible-tmp-1680275782.0315228-26030-127424669188120/AnsiballZ_podman_container.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/home/admin/.ansible/tmp/ansible-tmp-1680275782.0315228-26030-127424669188120/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "annotation": null,
            "authfile": null,
            "blkio_weight": null,
            "blkio_weight_device": null,
            "cap_add": null,
            "cap_drop": null,
            "cgroup_parent": null,
            "cgroupns": null,
            "cgroups": null,
            "cidfile": null,
            "cmd_args": [
                "install",
                "/dev/sda",
                "-i",
                "./files/config.ign"
            ],
            "command": null,
            "conmon_pidfile": null,
            "cpu_period": null,
            "cpu_rt_period": null,
            "cpu_rt_runtime": null,
            "cpu_shares": null,
            "cpus": null,
            "cpuset_cpus": null,
            "cpuset_mems": null,
            "debug": false,
            "detach": true,
            "detach_keys": null,
            "device": null,
            "device_read_bps": null,
            "device_read_iops": null,
            "device_write_bps": null,
            "device_write_iops": null,
            "dns": null,
            "dns_option": null,
            "dns_search": null,
            "entrypoint": null,
            "env": null,
            "env_file": null,
            "env_host": null,
            "etc_hosts": null,
            "executable": "podman",
            "expose": null,
            "force_restart": false,
            "generate_systemd": {},
            "gidmap": null,
            "group_add": null,
            "healthcheck": null,
            "healthcheck_interval": null,
            "healthcheck_retries": null,
            "healthcheck_start_period": null,
            "healthcheck_timeout": null,
            "hostname": null,
            "http_proxy": null,
            "image": "coreos-installer:latest",
            "image_strict": false,
            "image_volume": null,
            "init": null,
            "init_path": null,
            "interactive": null,
            "ip": null,
            "ipc": null,
            "kernel_memory": null,
            "label": null,
            "label_file": null,
            "log_driver": null,
            "log_level": null,
            "log_opt": null,
            "mac_address": null,
            "memory": null,
            "memory_reservation": null,
            "memory_swap": null,
            "memory_swappiness": null,
            "mount": null,
            "name": "ignition_container",
            "network": null,
            "network_aliases": null,
            "no_hosts": null,
            "oom_kill_disable": null,
            "oom_score_adj": null,
            "pid": null,
            "pids_limit": null,
            "pod": null,
            "privileged": true,
            "publish": null,
            "publish_all": null,
            "read_only": null,
            "read_only_tmpfs": null,
            "recreate": false,
            "requires": null,
            "restart_policy": null,
            "rm": true,
            "rootfs": null,
            "sdnotify": null,
            "secrets": null,
            "security_opt": null,
            "shm_size": null,
            "sig_proxy": null,
            "state": "started",
            "stop_signal": null,
            "stop_timeout": null,
            "subgidname": null,
            "subuidname": null,
            "sysctl": null,
            "systemd": null,
            "timezone": null,
            "tmpfs": null,
            "tty": null,
            "uidmap": null,
            "ulimit": null,
            "user": null,
            "userns": null,
            "uts": null,
            "volume": [
                "/dev:/dev",
                "/run/udev:/run/udev",
                ".:/data"
            ],
            "volumes_from": null,
            "workdir": "/data"
        }
    },
    "msg": "Can't run container ignition_container",
    "stderr": "Error: short-name resolution enforced but cannot prompt without a TTY\n",
    "stderr_lines": [
        "Error: short-name resolution enforced but cannot prompt without a TTY"
    ],
    "stdout": "",
    "stdout_lines": []
}

PLAY RECAP *********************************************************************
localhost                  : ok=5    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Additional environment details (AWS, VirtualBox, physical, etc.): Running on fedora silverblue 37

sshnaidm commented 1 year ago

You should use command option, not cmd_args. I add more explanation in #568