Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving multiple images with podman_save #670

Closed
moneytoo opened this issue Nov 22, 2023 · 0 comments · Fixed by #672
Closed

Saving multiple images with podman_save #670

moneytoo opened this issue Nov 22, 2023 · 0 comments · Fixed by #672
Labels
bug Something isn't working

Comments

@moneytoo
Copy link

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

/kind bug

Description

I would like to replicate following command using podman_save module.

podman save --multi-image-archive --output /tmp/podman-images.tar docker.io/library/node:18.18.2-slim docker.io/library/python:3.11.6-slim

I've tried this but I'm not really sure if I'm specifying multiple images correctly (I'm new to Ansible).

  tasks:
   - name: Save images
     podman_save:
       image: 
         - docker.io/library/node:18.18.2-slim
         - docker.io/library/python:3.11.6-slim
       dest: /tmp/podman-images.tar
       multi_image_archive: true

BTW, the module example doesn't even contain the required image parameter.

Steps to reproduce the issue:

See above.

Describe the results you received:

Error: invalid reference format

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

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

containers.podman             1.11.0

Output of ansible --version:

ansible [core 2.15.6]
  config file = /opt/ansible/ansible.cfg
  configured module search path = ['/home/marcel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/marcel/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/marcel/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/marcel/.local/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Output of podman version:

Client:       Podman Engine
Version:      4.6.2
API Version:  4.6.2
Go Version:   go1.18.1
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Output of podman info --debug:

(paste your output here)

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

host:
  arch: amd64
  buildahVersion: 1.31.2
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon_2:2.1.8-0ubuntu22.04+obs16.27_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.8, commit: '
  cpuUtilization:
    idlePercent: 99.92
    systemPercent: 0.04
    userPercent: 0.04
  cpus: 16
  databaseBackend: boltdb
  distribution:
    codename: jammy
    distribution: ubuntu
    version: "22.04"
  eventLogger: journald
  freeLocks: 2048
  hostname: S5402Z
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.15.133.1-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 11950186496
  memTotal: 18662887424
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns_1.6.0-0ubuntu22.04+obs34.25_amd64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.6.0
    package: netavark_1.3.0-0ubuntu22.04+obs22.9_amd64
    path: /usr/libexec/podman/netavark
    version: netavark 1.3.0
  ociRuntime:
    name: crun
    package: crun_101:1.11.2-0ubuntu22.04+obs64.5_amd64
    path: /usr/bin/crun
    version: |-
      crun version 1.11.2
      commit: ab0edeef1c331840b025e8f1d38090cfb8a0509d
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  pasta:
    executable: ""
    package: ""
    version: ""
  remoteSocket:
    path: /run/user/1000/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,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns_1.2.2-0ubuntu22.04+obs12.15_amd64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 5368709120
  swapTotal: 5368709120
  uptime: 30h 14m 48.00s (Approximately 1.25 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/marcel/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/marcel/.local/share/containers/storage
  graphRootAllocated: 1081101176832
  graphRootUsed: 21684011008
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 30
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/marcel/.local/share/containers/storage/volumes
version:
  APIVersion: 4.6.2
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.18.1
  Os: linux
  OsArch: linux/amd64
  Version: 4.6.2

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

  tasks:
   - name: Save images
     podman_save:
       image: 
         - docker.io/library/node:18.18.2-slim
         - docker.io/library/python:3.11.6-slim
       dest: /tmp/podman-images.tar
       multi_image_archive: true

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 [core 2.15.6]
  config file = /opt/ansible/ansible.cfg
  configured module search path = ['/home/marcel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/marcel/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/marcel/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/marcel/.local/bin/ansible-playbook
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
Using /opt/ansible/ansible.cfg as config file
[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: deploy.yaml *******************************************************************************************
1 plays in deploy.yaml

PLAY [Podman deploy] ********************************************************************************************

TASK [Save images] **********************************************************************************************
task path: /opt/ansible/deploy.yaml:9
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error: Error: invalid reference format\n"}

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

Additional environment details (AWS, VirtualBox, physical, etc.):

sshnaidm added a commit to sshnaidm/ansible-podman-collections that referenced this issue Nov 26, 2023
Fix containers#670
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
@sshnaidm sshnaidm added the bug Something isn't working label Nov 26, 2023
sshnaidm added a commit to sshnaidm/ansible-podman-collections that referenced this issue Nov 26, 2023
Fix containers#670
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
sshnaidm added a commit that referenced this issue Nov 26, 2023
Fix #670
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants