rubrik-modules-for-ansible icon indicating copy to clipboard operation
rubrik-modules-for-ansible copied to clipboard

rubrik_job_status not working if using rubrik_on_demand_snapshot to take multiple VM backups

Open punit-devops opened this issue 4 years ago • 2 comments

Expected Behavior

Please describe the behavior you are expecting.

If I am using rubrik_on_demand_snapshot to take on-demand back of a single VM and then using rubrik_job_status in the same playbook. It is giving me the status of that backup job just fine.

But if I am using rubrik_on_demand_snapshot to take on-demand back of multiple VMs and then using rubrik_job_status in the same playbook. It is not working. I think it should work in both cases.

There are chances that I am not using it correctly.

Current Behavior

What is the current behavior?

This is the error I am getting:

The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'job_status_url

Failure Information (for bugs)

Please help provide information about the failure if this is a bug.

  • Use verbose outputs to capture any debug information.
---

- hosts: localhost
  connection: local
  gather_facts: false

  tasks:
    - rubrik_on_demand_snapshot:
        object_name: "{{ item }}"
        object_type: vmware
      with_items:
        - VM1
        - VM2
      register: snapshot

    - rubrik_job_status:
        url: "{{ snapshot.job_status_url }}"

------

Error:

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
changed: [localhost] => (item=VM1)
changed: [localhost] => (item=VM2)

fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'job_status_url'\n\nThe error appears to be in '/data/rubrik-modules-for-ansible/on-demand-snapshot-n-job-status-v0.2.yml': line 16, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - rubrik_job_status:\n      ^ here\n"}


Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  • Use numbered list.
  1. I have provided the code and the error above.
  2. Please help me find a way to get job status even when multiple backups are being taken.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Version of project. Rubrik - 5.2
  • Version of dependencies. - Ansible 2.9.7
  • Version of operating system. - CentOS Linux 7 (Core)

Failure Logs

Please include any relevant log snippets or files here.

I have already provided the error and the code.

  • Use verbose outputs to capture any debug information.
Error:

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
changed: [localhost] => (item=VM1)
changed: [localhost] => (item=VM2)

fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'job_status_url'\n\nThe error appears to be in '/data/rubrik-modules-for-ansible/on-demand-snapshot-n-job-status-v0.2.yml': line 16, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - rubrik_job_status:\n      ^ here\n"}

punit-devops avatar Oct 22 '20 14:10 punit-devops