When running openshift-ansible/playbooks/ovirt/openshift-cluster/ovirt-vm-infra.yml, an Ansible error is thrown near the very beginning of the playbook. See here: https://pastebin.com/18Gardw3
It seems like it's connected with variable openshift_ovirt_vm_manifest. But I don't think I have a configuration problem with this variable, because my configuration is quite simple.
Your ansible version per ansible --version
ansible 2.7.6
config file = /root/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, May 31 2018, 09:41:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
The output of rpm -q openshift-ansible
openshift-ansible-3.11.59-1.git.0.ba8e948.el7.noarch
<edit> in file from step 2 with information that is applicable for your environment.ansible-playbook -i inventory -e '@provisioning-vars.yaml' /usr/share/ansible/openshift-ansible/playbooks/ovirt/openshift-cluster/ovirt-vm-infra.ymlI would expect the playbook to successfully run and create 5 VMs.
Error is thrown. See here: https://pastebin.com/18Gardw3
openshift-ansible RPM package. I tested it with openshift-ansible-playbooks-3.11.51-2.git.0.51c90a3.el7.noarchI encountered the same error with openshift-ansible-3.11.69-1.git.0.2ff281f.el7.noarch as well.
Hey, could you please share the variable file with this one: openshift_ovirt_vm_manifest I think that the problem could be there.
Hi, I already referenced it in Steps to Reproduce, here's the link again: https://pastebin.com/izCsgncm
Do you have this line on ansible.cfg file?
jinja2_extensions = jinja2.ext.do
Ohh I think I got it, try to add those lines to openshift_ovirt_vm_profile on this example:
infra_vm:
cluster: "{{ openshift_ovirt_cluster }}"
template: "{{ template_name }}"
memory: 8GiB
cores: 1
disks:
- size: 50GiB
storage_domain: "{{ openshift_ovirt_data_store }}"
name: docker_disk
interface: virtio
cloud_init: <--------
authorized_ssh_keys: '{{ openshift_ovirt_ssh_key }}' <--------
state: running
I do not. My ansible.cfg looked like this:
[defaults]
forks = 10
host_key_checking = False
gathering = smart
roles_path = /usr/share/ansible/roles
remote_user = root
I tried adding it there and got this error:
TASK [openshift_ovirt : Create virtual machine list fact] ************************************************************
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'template'. Error was a <class 'ansible.errors.AnsibleFilterError'>, original message: |combine expects dictionaries, got Undefined"}
btw add it to your ansible.cfg it is necessary for the xxxx.update jinja plugin at the end of the template.
After updateing both my ansible.cfg and provisioning-vars.yaml the playbook worked correctly. So it seems there must have been a changes since openshift-ansible-3.11.51. Does this mean that cloud_init is not a mandatory key for profile? If so, it seems to me like a bug. If it isn't a bug though, I believe it should be at least documented there: https://github.com/oVirt/ovirt-ansible-vm-infra/blob/master/README.md
Nope, the mandatory key is the cloud_init field, but I added this because is useful to me :). I'm agree with you that this must be documented, thanks for the suggestion :), I will try to add those changes soon.
Thank you for such a quick reaction!