diff --git a/.github/workflows/collection-continuous-integration.yml b/.github/workflows/collection-continuous-integration.yml index 5d3c7056..c76b3e8c 100644 --- a/.github/workflows/collection-continuous-integration.yml +++ b/.github/workflows/collection-continuous-integration.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: runner-os: - - ubuntu-16.04 + - ubuntu-latest ansible-version: - git+https://github.com/ansible/ansible.git@stable-2.10 runner-python-version: @@ -65,6 +65,16 @@ jobs: python-version: - 2.7 - 3.7 + exclude: + - runner-os: ubuntu-latest + runner-python-version: 3.7 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 + include: + - runner-os: ubuntu-20.04 + runner-python-version: 3.7 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Set up Python ${{ matrix.runner-python-version }} diff --git a/.github/workflows/connections_tests.yml b/.github/workflows/connections_tests.yml index da2765e3..14ab30b4 100644 --- a/.github/workflows/connections_tests.yml +++ b/.github/workflows/connections_tests.yml @@ -65,10 +65,10 @@ jobs: path: .cache/collection-tarballs test-podman-connection: - name: Podman connection VM ${{ matrix.os.vm || 'ubuntu-latest' }}-${{ matrix.ansible-version }} + name: Podman connection VM ${{ matrix.os || 'ubuntu-latest' }}-${{ matrix.ansible-version }} needs: - build-collection-artifact-connection-tests - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -77,17 +77,22 @@ jobs: matrix: ansible-version: - ansible<2.10 - - git+https://github.com/ansible/ansible.git@devel + - git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest - #- vm: ubuntu-16.04 - #- vm: macos-latest + - ubuntu-latest + #- ubuntu-20.04 + #- ubuntu-16.04 + #- macos-latest python-version: #- 3.8 - 3.7 #- 3.6 #- 3.5 #- 2.7 + include: + - os: ubuntu-20.04 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Check out repository @@ -153,10 +158,10 @@ jobs: shell: bash test-buildah-connection: - name: Buildah connection VM ${{ matrix.os.vm || 'ubuntu-latest' }}-${{ matrix.ansible-version }} + name: Buildah connection VM ${{ matrix.os || 'ubuntu-latest' }}-${{ matrix.ansible-version }} needs: - build-collection-artifact-connection-tests - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -165,17 +170,22 @@ jobs: matrix: ansible-version: - ansible<2.10 - - git+https://github.com/ansible/ansible.git@devel + - git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest - #- vm: ubuntu-16.04 - #- vm: macos-latest + - ubuntu-latest + #- ubuntu-20.04 + #- ubuntu-16.04 + #- macos-latest python-version: #- 3.8 - 3.7 #- 3.6 #- 3.5 #- 2.7 + include: + - os: ubuntu-20.04 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Check out repository diff --git a/.github/workflows/podman_container.yml b/.github/workflows/podman_container.yml index ba311801..f7429a41 100644 --- a/.github/workflows/podman_container.yml +++ b/.github/workflows/podman_container.yml @@ -25,8 +25,8 @@ on: jobs: test_podman_container: - name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -35,11 +35,15 @@ jobs: matrix: ansible-version: - ansible<2.10 - - git+https://github.com/ansible/ansible.git@devel + #- git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest + - ubuntu-latest python-version: - 3.7 + include: + - os: ubuntu-20.04 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Check out repository @@ -66,14 +70,18 @@ jobs: ${{ runner.os }}- - name: Install Ansible ${{ matrix.ansible-version }} - run: python -m pip install --user '${{ matrix.ansible-version }}' + run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - name: Build and install the collection tarball run: | + export PATH=~/.local/bin:$PATH + + echo "Run ansible version" + command -v ansible + ansible --version rm -rf /tmp/just_new_collection ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - name: Run collection tests for podman container run: | diff --git a/.github/workflows/podman_container_idem.yml b/.github/workflows/podman_container_idem.yml index 966aebdb..043a9bdb 100644 --- a/.github/workflows/podman_container_idem.yml +++ b/.github/workflows/podman_container_idem.yml @@ -25,8 +25,8 @@ on: jobs: test_podman_container_idem: - name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -35,11 +35,15 @@ jobs: matrix: ansible-version: - ansible<2.10 - # - git+https://github.com/ansible/ansible.git@devel + # - git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest + - ubuntu-latest python-version: - 3.7 + include: + - os: ubuntu-20.04 + "ansible-version": git+https://github.com/ansible/ansible.git@devel + "python-version": 3.7 steps: - name: Check out repository @@ -66,19 +70,22 @@ jobs: ${{ runner.os }}- - name: Install Ansible ${{ matrix.ansible-version }} - run: python -m pip install --user '${{ matrix.ansible-version }}' + run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - name: Build and install the collection tarball run: | rm -rf /tmp/just_new_collection ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - name: Run idempotency tests for podman container run: | export PATH=~/.local/bin:$PATH + echo "Run ansible version" + command -v ansible + ansible --version + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then diff --git a/.github/workflows/podman_container_info.yml b/.github/workflows/podman_container_info.yml index 2faa0857..eab6cbcb 100644 --- a/.github/workflows/podman_container_info.yml +++ b/.github/workflows/podman_container_info.yml @@ -25,8 +25,8 @@ on: jobs: test_podman_container_info: - name: Podman container info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + name: Podman container info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -35,11 +35,15 @@ jobs: matrix: ansible-version: - ansible<2.10 - - git+https://github.com/ansible/ansible.git@devel + # - git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest + - ubuntu-latest python-version: - 3.7 + include: + - os: ubuntu-20.04 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Check out repository @@ -66,19 +70,22 @@ jobs: ${{ runner.os }}- - name: Install Ansible ${{ matrix.ansible-version }} - run: python -m pip install --user '${{ matrix.ansible-version }}' + run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - name: Build and install the collection tarball run: | rm -rf /tmp/just_new_collection ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - name: Run collection tests for podman container info run: | export PATH=~/.local/bin:$PATH + echo "Run ansible version" + command -v ansible + ansible --version + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then diff --git a/.github/workflows/podman_image.yml b/.github/workflows/podman_image.yml index c91b442a..f46cbf00 100644 --- a/.github/workflows/podman_image.yml +++ b/.github/workflows/podman_image.yml @@ -25,8 +25,8 @@ on: jobs: test_podman_image: - name: Podman image ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + name: Podman image ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -35,11 +35,15 @@ jobs: matrix: ansible-version: - ansible<2.10 - - git+https://github.com/ansible/ansible.git@devel + # - git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest + - ubuntu-latest python-version: - 3.7 + include: + - os: ubuntu-20.04 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Check out repository @@ -66,19 +70,22 @@ jobs: ${{ runner.os }}- - name: Install Ansible ${{ matrix.ansible-version }} - run: python -m pip install --user '${{ matrix.ansible-version }}' + run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - name: Build and install the collection tarball run: | rm -rf /tmp/just_new_collection ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - name: Run collection tests for podman image run: | export PATH=~/.local/bin:$PATH + echo "Run ansible version" + command -v ansible + ansible --version + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then diff --git a/.github/workflows/podman_image_info.yml b/.github/workflows/podman_image_info.yml index b063c4b1..794280f8 100644 --- a/.github/workflows/podman_image_info.yml +++ b/.github/workflows/podman_image_info.yml @@ -25,8 +25,8 @@ on: jobs: test_podman_image_info: - name: Podman image info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + name: Podman image info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -35,11 +35,15 @@ jobs: matrix: ansible-version: - ansible<2.10 - - git+https://github.com/ansible/ansible.git@devel + # - git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest + - ubuntu-latest python-version: - 3.7 + include: + - os: ubuntu-20.04 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Check out repository @@ -66,19 +70,22 @@ jobs: ${{ runner.os }}- - name: Install Ansible ${{ matrix.ansible-version }} - run: python -m pip install --user '${{ matrix.ansible-version }}' + run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - name: Build and install the collection tarball run: | rm -rf /tmp/just_new_collection ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - name: Run collection tests for podman image info run: | export PATH=~/.local/bin:$PATH + echo "Run ansible version" + command -v ansible + ansible --version + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then diff --git a/.github/workflows/podman_network_info.yml b/.github/workflows/podman_network_info.yml index 82a766d8..2ead3bad 100644 --- a/.github/workflows/podman_network_info.yml +++ b/.github/workflows/podman_network_info.yml @@ -23,8 +23,8 @@ on: jobs: test_podman_network_info: - name: Podman network info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + name: Podman network info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -33,11 +33,15 @@ jobs: matrix: ansible-version: - ansible<2.10 - - git+https://github.com/ansible/ansible.git@devel + # - git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest + - ubuntu-latest python-version: - 3.7 + include: + - os: ubuntu-20.04 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Check out repository @@ -64,19 +68,22 @@ jobs: ${{ runner.os }}- - name: Install Ansible ${{ matrix.ansible-version }} - run: python -m pip install --user '${{ matrix.ansible-version }}' + run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - name: Build and install the collection tarball run: | rm -rf /tmp/just_new_collection ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - name: Run collection tests for podman network info run: | export PATH=~/.local/bin:$PATH + echo "Run ansible version" + command -v ansible + ansible --version + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then diff --git a/.github/workflows/podman_volume_info.yml b/.github/workflows/podman_volume_info.yml index b64b63ff..8cf2715d 100644 --- a/.github/workflows/podman_volume_info.yml +++ b/.github/workflows/podman_volume_info.yml @@ -23,8 +23,8 @@ on: jobs: test_podman_volume_info: - name: Podman volume info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} - runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + name: Podman volume info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} defaults: run: shell: bash @@ -33,11 +33,15 @@ jobs: matrix: ansible-version: - ansible<2.10 - - git+https://github.com/ansible/ansible.git@devel + # - git+https://github.com/ansible/ansible.git@stable-2.10 os: - - vm: ubuntu-latest + - ubuntu-latest python-version: - 3.7 + include: + - os: ubuntu-20.04 + ansible-version: git+https://github.com/ansible/ansible.git@devel + python-version: 3.7 steps: - name: Check out repository @@ -64,19 +68,22 @@ jobs: ${{ runner.os }}- - name: Install Ansible ${{ matrix.ansible-version }} - run: python -m pip install --user '${{ matrix.ansible-version }}' + run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - name: Build and install the collection tarball run: | rm -rf /tmp/just_new_collection ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - name: Run collection tests for podman volume info run: | export PATH=~/.local/bin:$PATH + echo "Run ansible version" + command -v ansible + ansible --version + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then diff --git a/ci/run_connection_test.sh b/ci/run_connection_test.sh index 77ec5efa..55b7ee7d 100755 --- a/ci/run_connection_test.sh +++ b/ci/run_connection_test.sh @@ -39,4 +39,4 @@ if [[ "$CON_TYPE" == "podman" ]]; then elif [[ "$CON_TYPE" == "buildah" ]]; then ${SUDO} buildah rm buildah-container fi -${SUDO} rm -f /tmp/local_file +sudo rm -f /tmp/local_file /tmp/remote_file diff --git a/ci/run_containers_tests.sh b/ci/run_containers_tests.sh index a6748cf6..21811a5f 100755 --- a/ci/run_containers_tests.sh +++ b/ci/run_containers_tests.sh @@ -15,7 +15,8 @@ exit_code=0 CMD="ANSIBLE_ROLES_PATH=${CURWD}/../tests/integration/targets \ ${ANSIBLECMD:-ansible-playbook} \ -i localhost, -c local --diff \ - ci/playbooks/containers/${TEST2RUN}.yml" + ci/playbooks/containers/${TEST2RUN}.yml \ + -e ansible_python_interpreter=$(command -v python)" bash -c "$CMD -vv" || exit_code=$? if [[ "$exit_code" != 0 ]]; then diff --git a/plugins/modules/podman_container.py b/plugins/modules/podman_container.py index 2c36711a..b2c79e24 100644 --- a/plugins/modules/podman_container.py +++ b/plugins/modules/podman_container.py @@ -1598,9 +1598,13 @@ def diffparam_memory_reservation(self): def diffparam_network(self): before = [self.info['hostconfig']['networkmode']] - after = self.params['network'] - if self.params['pod'] and not self.module.params['network']: + # TODO(sshnaidm): special case for rootful container > v2. + # Discover later what is running user and set default accordingly + if not self.module.params['network'] and ( + before == ['bridge'] or self.params['pod']): after = before + else: + after = self.params['network'] return self._diff_update_and_compare('network', before, after) def diffparam_no_hosts(self): @@ -1653,6 +1657,8 @@ def diffparam_rm(self): def diffparam_security_opt(self): before = self.info['hostconfig']['securityopt'] + # In rootful containers with apparmor there is a default security opt + before = [o for o in before if 'apparmor=containers-default' not in o] after = self.params['security_opt'] before, after = sorted(list(set(before))), sorted(list(set(after))) return self._diff_update_and_compare('security_opt', before, after) diff --git a/plugins/modules/podman_image.py b/plugins/modules/podman_image.py index 2aa1249c..16c09d6d 100644 --- a/plugins/modules/podman_image.py +++ b/plugins/modules/podman_image.py @@ -119,6 +119,10 @@ description: Remove intermediate containers after a successful build type: bool default: True + extra_args: + description: + - Extra args to pass to build, if executed. Does not idempotently check for new build args. + type: str push_args: description: Arguments that control pushing images. type: dict @@ -376,6 +380,7 @@ import json import re +import shlex from ansible.module_utils.basic import AnsibleModule from ansible_collections.containers.podman.plugins.module_utils.podman.common import run_podman_command @@ -574,6 +579,10 @@ def build_image(self): cred_string = '{user}:{password}'.format(user=self.username, password=self.password) args.extend(['--creds', cred_string]) + extra_args = self.build.get('extra_args') + if extra_args: + args.extend([arg for arg in shlex.split(extra_args)]) + args.append(self.path) rc, out, err = self._run(args, ignore_errors=True) @@ -714,6 +723,7 @@ def main(): cache=dict(type='bool', default=True), rm=dict(type='bool', default=True), volume=dict(type='list', elements='str'), + extra_args=dict(type='str'), ), ), push_args=dict( diff --git a/tests/integration/targets/podman_container_idempotency/files/Dockerfile b/tests/integration/targets/podman_container_idempotency/files/Dockerfile index 822662f4..7f6721fb 100644 --- a/tests/integration/targets/podman_container_idempotency/files/Dockerfile +++ b/tests/integration/targets/podman_container_idempotency/files/Dockerfile @@ -8,6 +8,8 @@ ARG build_arg ENV password root ENV username root +WORKDIR /work + RUN adduser -D user && \ adduser -D user2 @@ -17,10 +19,8 @@ RUN chmod a+rwx /start EXPOSE 80 EXPOSE 8080/tcp - VOLUME ["/data", "/data2"] USER user -WORKDIR /work STOPSIGNAL 9 # problem with OS w/o systemd diff --git a/tests/integration/targets/podman_container_idempotency/tasks/build_test_container.yml b/tests/integration/targets/podman_container_idempotency/tasks/build_test_container.yml index f81eae33..a9ecb039 100644 --- a/tests/integration/targets/podman_container_idempotency/tasks/build_test_container.yml +++ b/tests/integration/targets/podman_container_idempotency/tasks/build_test_container.yml @@ -19,6 +19,7 @@ path: /tmp/usr_img build: format: docker + extra_args: --cgroup-manager=cgroupfs - name: Build test docker image for root user containers.podman.podman_image: diff --git a/tests/integration/targets/podman_container_idempotency/tasks/root-podman.yml b/tests/integration/targets/podman_container_idempotency/tasks/root-podman.yml index d49dbea3..d09e42d3 100644 --- a/tests/integration/targets/podman_container_idempotency/tasks/root-podman.yml +++ b/tests/integration/targets/podman_container_idempotency/tasks/root-podman.yml @@ -12,6 +12,19 @@ state: present command: 1h +- name: Run container as is again + containers.podman.podman_container: + image: "{{ idem_image }}" + name: root-idempotency + state: present + command: 1h + register: info_a + +- name: Check that it is not recreated + assert: + that: + - info_a is not changed + - name: Run containers with ulimits containers.podman.podman_container: image: "{{ idem_image }}"