---
- hosts: localhost
  vars_prompt:
    - name: lif_name
      prompt: enter lif_name
      private: false
    - name: ip_address
      prompt: enter ip_address
      private: false
    - name: netmask
      prompt: enter netmask
      private: false
    - name: vserver
      prompt: enter vserver
      private: false
    - name: clustername
      prompt: enter clustername
      private: false

  name: Setup ONTAP
  gather_facts: false
  collections:
  - netapp.ontap

  tasks:
  - include_vars: addlif_vars.yml

  - name: Create interface for vserver
    na_ontap_interface:
      state: present
      interface_name: "{{ lif_name }}"
      home_port: e0c
      home_node: cl1-01
      admin_status: up
      is_auto_revert: true
      address: "{{ ip_address }}" 
      netmask: "{{ netmask }}" 
      vserver: "{{ vserver }}" 
      hostname: "{{ clustername }}" 
      username: admin
      password: apix1234
      https: true
      validate_certs: false

