Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error when run the playbook twice | idempotency is not achieved #288

Closed
sumanth-lingappa opened this issue Sep 30, 2023 · 1 comment
Assignees

Comments

@sumanth-lingappa
Copy link
Collaborator

Describe the bug
When I run the below playbook second time, I am getting the below error.

It is expected that the second run does not try to push the config keeping the principle of idempotency.

To Reproduce
Steps to reproduce the behaviour:

  1. My ansible-playbook is...
- name: Crate monitor group binding
  hosts: localhost
  gather_facts: false
  tasks:
    - name: Add servicegroup
      delegate_to: localhost
      netscaler.adc.servicegroup:
        state: present
        servicegroupname: demo-sg
        servicetype: HTTP
    - name: Bind Monitor to Service group
      delegate_to: localhost
      netscaler.adc.servicegroup_lbmonitor_binding:
        state: present
        monitor_name: HTTP
        monstate: ENABLED
        servicegroupname: demo-sg
  1. The ansible-playbook command I executed is...
ansible-playbook -I inventory playbook.yaml # run this command 2 times in a row
  1. The ansible-playbook logs are...
.
.
.
,
        "TRACE: ENTRY: create_or_update() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x10e0b8490>,), {}",
        "TRACE: ENTRY: update_diff_list() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x10e0b8490>,), {'existing': {'servicegroupname': 'demo-sg', 'monitor_name': 'http', 'monweight': '0', 'monstate': 'ENABLED', 'weight': '1', 'state': 'ENABLED', 'passive': False}, 'desired': {'monitor_name': 'HTTP', 'monstate': 'ENABLED', 'servicegroupname': 'demo-sg'}}",
        "TRACE: EXIT: update_diff_list() returned None",
        "TRACE: ENTRY: is_resource_identical() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x10e0b8490>,), {}",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x10e0b8490>, 'monitor_name', 'http', 'HTTP'), {}",
        "TRACE: EXIT: is_attribute_equal() returned False",
        "DEBUG: Attribute `monitor_name` differs. Desired: (<class 'str'>) HTTP. Existing: (<class 'str'>) http",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x10e0b8490>, 'monstate', 'ENABLED', 'ENABLED'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x10e0b8490>, 'servicegroupname', 'demo-sg', 'demo-sg'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: return_failure() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x10e0b8490>, \"Cannot change value for the following non-updateable attributes ['monitor_name']\"), {}"
    ],
    "msg": "Cannot change value for the following non-updateable attributes ['monitor_name']"
}

PLAY RECAP **************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
  1. I am seeing the below error...
Cannot change value for the following non-updateable attributes ['monitor_name']"

Please specify the equivalent NSCLI command, if you were to manually configure via CLI

Not required. as the above playbook is standalone

Expected behaviour
stated above

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Python version python --version output
  • Ansible version ansible --version output
  • NetScaler version show ns version output

Additional context
Add any other context about the problem here.

@sumanth-lingappa sumanth-lingappa self-assigned this Sep 30, 2023
@sumanth-lingappa
Copy link
Collaborator Author

#289 solved this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant