{"body":"[centos@aschultz-undercloud foo]$ cat test.yaml\n- hosts: localhost\n  connection: local\n  name: Run update\n  serial: 1\n  gather_facts: no\n  any_errors_fatal: yes\n  tasks:\n  - set_fact:\n      container_registry_insecure_registries:\n      - 192.168.24.1:8787\n      container_registry_login: true\n      container_registry_logins:\n        docker.io:\n          username: pa55word\n        '192.0.2.1:8787':\n          registry_username: password\n  - name: ensure podman and deps are installed\n    package:\n      name: podman\n      state: latest\n  - copy:\n      content: ''\n      dest: /etc/cni/net.d/87-podman-bridge.conflist\n      force: true\n    ignore_errors: true\n    name: Remove default cni config for cni0 if exists\n  - command: ip link delete cni0\n    ignore_errors: true\n    name: Delete cni0 interface if exists\n  - ini_file:\n      option: registries\n      path: /etc/containers/registries.conf\n      section: registries.insecure\n      value: '{{ container_registry_insecure_registries }}'\n    name: configure insecure registries /etc/containers/registries.conf\n    when: container_registry_insecure_registries | length > 0\n  - environment:\n      REGISTRY: '{{ item.key }}'\n      REGISTRY_PASSWORD: '{{ lookup(''dict'', item.value).value }}'\n      REGISTRY_USERNAME: '{{ lookup(''dict'', item.value).key }}'\n    loop: '{{ lookup(''dict'', container_registry_logins) }}'\n    name: Perform container registry login(s)\n    shell: echo podman login --username=$REGISTRY_USERNAME --password=$REGISTRY_PASSWORD $REGISTRY\n    when:\n    - container_registry_login | bool\n    - container_registry_logins | length > 0\n[centos@aschultz-undercloud foo]$ ansible-playbook test.yaml\n [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'\n\n\nPLAY [Run update] *********************************************************************************************************************************************\n\nTASK [set_fact] ***********************************************************************************************************************************************\nok: [localhost]\n\nTASK [ensure podman and deps are installed] *******************************************************************************************************************\nok: [localhost]\n\nTASK [Remove default cni config for cni0 if exists] ***********************************************************************************************************\nok: [localhost]\n\nTASK [Delete cni0 interface if exists] ************************************************************************************************************************\nfatal: [localhost]: FAILED! => {\"changed\": true, \"cmd\": [\"ip\", \"link\", \"delete\", \"cni0\"], \"delta\": \"0:00:00.004999\", \"end\": \"2019-07-10 18:10:30.748110\", \"msg\": \"non-zero return code\", \"rc\": 1, \"start\": \"2019-07-10 18:10:30.743111\", \"stderr\": \"Cannot find device \\\"cni0\\\"\", \"stderr_lines\": [\"Cannot find device \\\"cni0\\\"\"], \"stdout\": \"\", \"stdout_lines\": []}\n...ignoring\n\nTASK [configure insecure registries /etc/containers/registries.conf] ******************************************************************************************\nok: [localhost]\n\nTASK [Perform container registry login(s)] ********************************************************************************************************************\nchanged: [localhost] => (item={'key': u'192.0.2.1:8787', 'value': {u'registry_username': u'password'}})\nchanged: [localhost] => (item={'key': u'docker.io', 'value': {u'username': u'pa55word'}})\n\nPLAY RECAP ****************************************************************************************************************************************************\nlocalhost                  : ok=6    changed=2    unreachable=0    failed=0   \n\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/uvJ97zVH","modified":1562782266,"id":"uvJ97zVH","size":3792,"lines":76,"own_paste":false,"theme":"","date":1562782266}