How to reproduce:
1) Deploy a Containerized undercloud: "openstack undercloud install" with default undercloud.conf.
2) Run this playbook:
- hosts: localhost
become: true
tasks:
- name: include tripleo-modify-image
import_role:
name: tripleo-modify-image
vars:
tasks_from: yum_update.yml
source_image: docker.io/tripleomaster/centos-binary-nova-api:latest
compare_host_packages: true
yum_repos_dir_path: /etc/yum.repos.d
modified_append_tag: updated
3) See the error:
TASK [tripleo-modify-image : Inspect image] ***************************************************************************
ok: [localhost]
TASK [tripleo-modify-image : Set original_user] ***********************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 0\n\nThe error appears to have been in '/usr/share/ansible/roles/tripleo-modify-image/tasks/yum_update.yml': line 10, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set original_user\n ^ here\n"}
to retry, use: --limit @/home/vagrant/yum_update.retry
PLAY RECAP ************************************************************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=1
[vagrant@undercloud75 ~]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/tripleomaster/centos-binary-swift-proxy-server 959e1d7f755ee681b6f23b498d262a9e4dd6326f_4cbb1814 d1780297aee4 13 days ago 980 MB
docker.io/tripleomaster/centos-binary-neutron-server 959e1d7f755ee681b6f23b498d262a9e4dd6326f_4cbb1814 79f33e77c59d 13 days ago 1.08 GB
docker.io/tripleomaster/centos-binary-heat-api 959e1d7f755ee681b6f23b498d262a9e4dd6326f_4cbb1814 162f53d29e3e 13 days ago 971 MB
docker.io/tripleomaster/centos-binary-heat-api-cfn 959e1d7f755ee681b6f23b498d262a9e4dd6326f_4cbb1814 0e4c9b643006 13 days ago 971 MB
docker.io/tripleomaster/centos-binary-nova-api 959e1d7f755ee681b6f23b498d262a9e4dd6326f_4cbb1814 90d5dd5b8fe6 13 days ago 1.14 GB
docker.io/tripleomaster/centos-binary-nova-placement-api
[snip]
[vagrant@undercloud75 ~]$ docker inspect 90d5dd5b8fe6
[
{
"Id": "sha256:90d5dd5b8fe6d8e46f356f3586fb42f105a813168518abb1a588ed82318ae182",
"RepoTags": [
"docker.io/tripleomaster/centos-binary-nova-api:959e1d7f755ee681b6f23b498d262a9e4dd6326f_4cbb1814"
],
"RepoDigests": [
"docker.io/tripleomaster/centos-binary-nova-api@sha256:383ab78beb6d7479c6acdd9e54ff73f4ff91f82022912b37767eaf2db6c8872d"
],
"Parent": "",
"Comment": "",
"Created": "2018-07-20T17:32:00.097914999Z",
"Container": "c76af3eff79ee3260faeac4d6542e412de11472da924e530bcbed7a8ee88af2c",
"ContainerConfig": {
"Hostname": "093be9f77103",
"Domainname": "",
"User": "nova",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"KOLLA_BASE_DISTRO=centos",
"KOLLA_INSTALL_TYPE=binary",
"KOLLA_INSTALL_METATYPE=rdo",
"PS1=$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ "
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) ",
"USER [nova]"
],
"ArgsEscaped": true,
"Image": "sha256:67757b45c81948cd195f8b5b24565ab4eaa08fe30bc285473d19e92a724751b6",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": [],
"Labels": {
"build-date": "20180720",
"build_id": "1532106440",
"kolla_version": "7.0.0",
"maintainer": "TripleO Project (http://tripleo.org)",
"name": "nova-api",
"org.label-schema.schema-version": "= 1.0 org.label-schema.name=CentOS Base Image org.label-schema.vendor=CentOS org.label-schema.license=GPLv2 org.label-schema.build-date=20180531",
"rdo_version": "959e1d7f755ee681b6f23b498d262a9e4dd6326f_4cbb1814"
},
"StopSignal": "SIGTERM"
},
"DockerVersion": "1.13.1",
"Author": "",
"Config": {
"Hostname": "093be9f77103",
"Domainname": "",
"User": "nova",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"KOLLA_BASE_DISTRO=centos",
"KOLLA_INSTALL_TYPE=binary",
"KOLLA_INSTALL_METATYPE=rdo",
"PS1=$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ "
],
"Cmd": [
"kolla_start"
],
"ArgsEscaped": true,
"Image": "sha256:67757b45c81948cd195f8b5b24565ab4eaa08fe30bc285473d19e92a724751b6",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": [],
"Labels": {
"build-date": "20180720",
"build_id": "1532106440",
"kolla_version": "7.0.0",
"maintainer": "TripleO Project (http://tripleo.org)",
"name": "nova-api",
"org.label-schema.schema-version": "= 1.0 org.label-schema.name=CentOS Base Image org.label-schema.vendor=CentOS org.label-schema.license=GPLv2 org.label-schema.build-date=20180531",
"rdo_version": "959e1d7f755ee681b6f23b498d262a9e4dd6326f_4cbb1814"
},
"StopSignal": "SIGTERM"
},
"Architecture": "amd64",
"Os": "linux",
"Size": 1140868585,
"VirtualSize": 1140868585,
"GraphDriver": {
"Name": "overlay2",
"Data": {
"LowerDir": "/var/lib/docker/overlay2/c3227424516dea4e8ba1bf6be5ae7c5b3d0c17929ec0a85401b72dc22c6d6dc3/diff:/var/lib/docker/overlay2
[snip]
]
}
}
]
The role works fine in CI so I'm investigating if it comes from my environment or playbook.
I was using a wrong value of the image name, I didn't have latest tag in my local registry.