ovirt-ansible-collection icon indicating copy to clipboard operation
ovirt-ansible-collection copied to clipboard

ovirt_vm: cloud_init_persist leads to changed always being True

Open jake2184 opened this issue 4 years ago • 0 comments

SUMMARY

Multiple runs of ovirt_vm returns "changed: True", even when no changes (should) have been made, when cloud_init_persist is defined.

This is due to to line 1579 in ovirt_vm.py, in the boolean logic for the return value of _update_check:

not self.param('cloud_init_persist') and

_update_check will always return false if this param is defined. This means that self.changed = True is always met on line 617 of ovirt.py.

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible 2.9.10
  config file = /home/jake2184/ansible.cfg
  configured module search path = ['/home/jake2184/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
CONFIGURATION
ANSIBLE_PIPELINING(/home/jake2184/ansible.cfg) = True
DEFAULT_FORKS(/home/jake2184/ansible.cfg) = 25
DEFAULT_REMOTE_USER(/home/jake2184/ansible.cfg) = root
DEFAULT_STDOUT_CALLBACK(/home/jake2184/ansible.cfg) = debug
HOST_KEY_CHECKING(/home/jake2184/ansible.cfg) = False
OS / ENVIRONMENT

Centos 8.2

STEPS TO REPRODUCE

Running the below always results in "changed: True"

- name: Deploy from template
  ovirt_vm:
    auth: "{{ ovirt_auth }}"
    template: Centos8
    cluster: mgmt1
    name: myhostname
    clone: True
    #state: present
    cloud_init_persist: True
    cloud_init:
      nic_boot_protocol: static
      nic_ip_address: 10.136.6.10
      nic_netmask: 255.255.255.0
      nic_gateway: 10.136.6.254
      nic_on_boot: true
      nic_name: enp1s0
      host_name: myhostname
EXPECTED RESULTS

The module to return changed:True only when a change occurs

ACTUAL RESULTS

The module returns changed:True with every iteration.

When running with -vvv to see the diff, the diffs can be compared and are equal

jake2184 avatar Aug 03 '20 12:08 jake2184