#Ansible error on creating new interface version 9.11.1P5

1 messages · Page 1 of 1 (latest)

rapid gale
#

Do you guys see anything wrong in the below yaml file. ansible version 2.9.18.
It errors out when i try to run this playbook.

  • hosts: localhost
    collections:

    • netapp.ontap

    vars:
    hostname: *******
    username: netapp-ansible
    password: ********

    tasks:

    • name: Create interface
      na_ontap_interface:
         state: present
         interface_name: "{{ item.interface_name }}"
         home_port: "{{ item.home_port }}"
          home_node: "{{ item.node }}"
          role: data
      is_auto_revert: true
          protocols: "{{ item.protocols }}"
          admin_status: up
          firewall_policy: system-defined
           address: "{{ item.address }}"
           netmask: 255.255.252.0
           vserver: "{{ vserver }}"
           hostname: "{{ hostname }}"
           username: "{{ username }}"
           password: "{{ password }}"
           https: true
           validate_certs: false
         with_items:
      • { node: ‘TTPDNAS-02’,interface_name: 'datalif1-52',vserver: 'nas01', protocols: 'nfs,cifs', home_port: 'h0h-52', address: '10.x.52.x' }
mystic imp
#

and error message is ?

rapid gale
#

@rapid gale
ERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each:
JSON: No JSON object could be decoded

Syntax Error while loading YAML.
did not find expected '-' indicator

The error appears to be in '/etc/ansible/playbooks/esg/svcrtint.yml': line 16, column 1, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

na_ontap_interface:

state: present
^ here

rapid gale
#

Ansible error on creating new interface version 9.11.1P5

rapid gale
#

Any help is much appreciated for the above error which i am in to.

sudden lance
#

we are not seeing "-" but bullets ? is it cos you pasted it here?

dire storm
#

I think slack consider - as bullet point, cannot check what the issue with the current format.

select the yaml part, you can see the <> option, it will format the yaml.

dire storm
#

*discord