-
Notifications
You must be signed in to change notification settings - Fork 171
Open
Description
Summary
The juniper.device.command module fails with ConnectionError: Type 'bool' cannot be serialized when using connection: juniper.device.pyez with Ansible 2.17+ for certain commands (particularly clear commands).
Environment
- Ansible version: 2.18.5
- juniper.device collection version: 2.0.0
- Python version: 3.11
- junos-eznc version: 2.7.6
- ncclient version: 0.7.0
- Device: QFX series
Steps to Reproduce
Minimal playbook that reproduces the issue:
---
- name: Test juniper.device bug
hosts: all
connection: juniper.device.pyez
gather_facts: false
tasks:
- name: This fails with bool serialization error
juniper.device.command:
commands:
- "clear ddos-protection protocols statistics"
- "clear ddos-protection protocols states"Run with:
ansible-playbook -k -u <user> test_bug.yml --limit <qfx-device>Expected Behavior
Commands should execute successfully and return results.
Actual Behavior
Task fails with error:
ansible.module_utils.connection.ConnectionError: Type 'bool' cannot be serialized.
Commands Affected
clearcommands (confirmed:clear ddos-protection protocols statistics,clear ddos-protection protocols states)- Possibly other operational commands that trigger specific RPC code paths
- Regular
showcommands appear to work in most cases
Workaround
Add connection: local to the task to bypass the persistent connection:
- name: Clear ddos statistics and state
juniper.device.command:
commands:
- "clear ddos-protection protocols statistics"
- "clear ddos-protection protocols states"
connection: local # Workaround for bool serialization bugReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels