Bug 1574226 - Can't specify variables with scope to only one role
Summary: Can't specify variables with scope to only one role
Alias: None
Product: ovirt-ansible-collection
Classification: oVirt
Component: image-template
Version: 1.1.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: ovirt-4.2.4
: ---
Assignee: Ondra Machacek
QA Contact: Petr Kubica
Depends On:
TreeView+ depends on / blocked
Reported: 2018-05-02 20:26 UTC by Petr Kubica
Modified: 2018-06-26 08:46 UTC (History)
1 user (show)

Fixed In Version: ovirt-ansible-image-template-1.1.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-06-26 08:46:21 UTC
oVirt Team: Infra
rule-engine: ovirt-4.2+

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-ansible-image-template pull 15/ 0 None None None 2018-05-31 07:50:22 UTC

Description Petr Kubica 2018-05-02 20:26:47 UTC
Description of problem:
Uploading one image into two different datacenters will fail:
    qcow_url: http://server.com/image.qcow2
    template_name: pkubica-rhevm30-rhel62
    template_memory: 4GiB
    template_cpu: 4
    template_disk_size: 50GiB

    - role: oVirt.image-template
      template_cluster: cluster_in_datacenter1
      template_disk_storage: storage_in_datacenter1
    - role: oVirt.image-template
      template_cluster: cluster_in_datacenter2
      template_disk_stroage: storage_in_datacenter2

Separate into two different plays will work but template_name must be different to each datacenter.

when image doesn't exist in engine:
TASK [oVirt.image-template : Fetch storages] **********************
task path: /home/pkubica/.ansible/roles/oVirt.image-template/tasks/qcow2_image.yml:42
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_6Xuc6e/ansible_module_ovirt_storage_domains_facts.py", line 87, in main
    connection = create_connection(auth)
  File "/tmp/ansible_6Xuc6e/ansible_modlib.zip/ansible/module_utils/ovirt.py", line 146, in create_connection
    headers=auth.get('headers', None),
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/__init__.py", line 303, in __init__
    raise Error('The \'url\' parameter is mandatory')
Error: The 'url' parameter is mandatory

fatal: [engine.example.com]: FAILED! => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "fetch_nested": false, 
            "nested_attributes": [], 
            "pattern": ""
    "msg": "The 'url' parameter is mandatory"

when image exist in engine:
same traceback but in task:
TASK [oVirt.image-template : Check if template already exists]

Version-Release number of selected component (if applicable):
oVirt.image-template (1.1.6)

How reproducible:

Steps to Reproduce:
see description

Actual results:
User must separate roles into plays but using variable with role should work.
Also specify only qcow_url and template_name to upload multiple images should also work

Comment 1 Petr Kubica 2018-06-25 12:26:13 UTC
Verified in

Comment 2 Sandro Bonazzola 2018-06-26 08:46:21 UTC
This bugzilla is included in oVirt 4.2.4 release, published on June 26th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.4 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

Note You need to log in before you can comment on or make changes to this bug.