Skip to content

junos_shutdown - XMLSyntaxError' object has no attribute 'rsp #243

@infectedgti

Description

@infectedgti

Hi,
I received an error when I run this script on QFX10002 :

---
#Playbook pour redémarrer SD-SRV-C012-2
- name: Reboot devices running Junos OS
  hosts: SD-SRV-C012-2
  roles:
  - Juniper.junos    
  connection: local
  gather_facts: no

  vars:
    restart: 'yes'
    reboot_wait: 300
  vars_prompt:
  - name: shutdown
    prompt: "Enter 'shutdown' to continue"
    private: no

  tasks:
  - name: Checking NETCONF connectivity
    wait_for: host={{ inventory_hostname }} port=830 timeout=5

  - name: Reboot de SD-SRV-C012-2
    junos_shutdown:
      user={{ juniper_user }}
      ssh_private_key_file={{ juniper_ssh_private_key_file }}
      host={{ inventory_hostname }}
      shutdown={{ shutdown }}
      reboot={{ restart }}
    register: sd_result
    notify:
    - pause_for_reboot
    - wait_reboot

  handlers:
  - name: pause_for_reboot
    pause: seconds=70
    when: sd_result.reboot == true
  - name: wait_reboot
    wait_for: host={{ inventory_hostname }} port=830 timeout={{ reboot_wait }}
    when: sd_result.reboot == true

fatal: [SD-SRV-C012-2]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "at": null,
            "host": "SD-SRV-C012-2",
            "in_min": "0",
            "mode": null,
            "passwd": null,
            "port": "830",
            "reboot": true,
            "shutdown": "shutdown",
            "ssh_private_key_file": "/root/.ssh/id_rsa",
            "user": "ansible"
        }
    },
    "msg": "error during device reboot or shutdown SD-SRV-C012-2: 'XMLSyntaxError' object has no attribute 'rsp'"

No problem with EX4600.

Thank you for you help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions