Software Development Kit (SDK) and API Discussions

ansible playbook: create SVM with static IP adress and subnet ...

Thomas2
2,476 Views

Hi,

I have a question regarding create a SVM via ansible. We have a network with static IP adresses.

With Ontap GUI you can create SVM ... The data LIF configuration allows to

either  select using subnet with an (static) IP address

or specify IP,netmask and  gateway. This works.

 

In the ansible module 

  • netapp.ontap.na_ontap_interface

this is not possible to do it like in GUI.

The documentation shows for address:

Specifies the LIF's IP address.
Required when state=present and is_ipv4_link_local if false and subnet_name is not set.
 
----------- The part of the playbook --------------------
na_ontap_interface:
state: present
interface_name: ansibletestsvm2_nfs_lif1
home_port: e0c-110
home_node: XXXXXXX
role: data
protocols:
- nfs
admin_status: up
failover_policy: system-defined
firewall_policy: mgmt
is_auto_revert: true
address: XX.XX.XX.XX
netmask: 255.255.254.0
subnet_name: subnet vlan 110
----------------------------------------
 
Any ideas howto configure a SVM with  static IP using ansible ?
Running the playbook give the result:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "parameters are mutually exclusive: subnet_name|address, subnet_name|netmask"}
 
Thanks in advance.
 
Best regards,
 Thomas

 

 

 

2 REPLIES 2

Greg_Wilson
2,335 Views

I don't think you need the line

 

subnet_name: subnet vlan 110

 

all I use is

 

<snip>

interface_name: "{{ item.lif_interface_name }}"
home_port: "{{ item.lif_cluster_node_home_port }}"
home_node: "{{ item.lif_cluster_node_home_node }}"
role: "{{ item.lif_role }}"
protocols: "{{ item.lif_protocols }}"
admin_status: up
failover_policy: local-only
firewall_policy: "{{ item.lif_firewall }}"
is_auto_revert: true
address: "{{ item.lif_ip_address }}"
netmask: "{{ item.lif_netmask }}"

<snip>

 

tahmad
2,135 Views

hey @Thomas2 , was your question answered by @Greg_Wilson ?

 

thanks

Public