- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
01-Text | 151.87 KB |
Contents
Installing the SeerEngine-DC Ansible plug-in
Setting up the basic environment
Obtaining the plug-in installation package
Creating a security group playbook
Creating an interface playbook
Overview
Ansible, an automated operations and maintenance tool programmed in Python, allows for bulk system configuration, program deployment, and command execution. The SeerEngine-DC Ansible plug-in provides customized modules that can synchronize the plays in Ansible playbooks to the SeerEngine-DC controller through the RESTful API.
The SeerEngine-DC Ansible plug-in provides the following customized modules:
· Network—Creates or deletes vNetworks.
· Port—Creates or deletes vPorts.
· QoS—Creates or deletes network policies.
· Router—Creates or deletes vRouters.
· Security group—Creates or deletes security groups.
· Subnet—Creates or deletes vSubnets.
· Tenant—Creates or deletes tenants.
· Device—Creates or deletes devices.
· Interface—Manages device interface status.
Preparing for installation
Hardware requirements
Table 1 shows the minimum hardware requirements for installing the SeerEngine-DC Ansible plug-in on a physical server or virtual machine.
Table 1 Minimum hardware requirements
CPU |
Memory size |
Drive size |
One core |
2 GB |
5 GB |
Software requirements
The SeerEngine-DC Ansible plug-in can operate only on the CentOS 7 series and CentOS 8 series operating systems.
Installing the SeerEngine-DC Ansible plug-in
Setting up the basic environment
Before installing the plug-in, set up the basic environment first.
To set up the basic environment:
1. Download and install the Ansible installation package online.
[root@localhost ~]# pip3 install ansible
CAUTION: Make sure the Ansible installation package is in version 2.10.0 or later. |
2. Install the requests package.
[root@localhost ~]# pip3 install requests
Installing the plug-in
Obtaining the plug-in installation package
Obtain the SeerEngine-DC Ansible package of the required version and then save the package to the target installation directory on the target server or virtual machine.
Alternatively, transfer the installation package to the target installation directory through a file transfer protocol such as FTP, TFTP, or SCP. Use the binary transfer mode to prevent the software package from being corrupted during transit.
Installing the plug-in
Access the directory where the SeerEngine-DC Ansible package (a .tar.gz file) is saved, and install the package. In the following example, the SeerEngine-DC Ansible package is saved to the /root directory. The name of the package is SeerEngine_DC-ANSIBLE_PLUGIN-version1.tar.gz. version1 represents the version of the package.
[root@localhost ~]# ansible-galaxy collection install SeerEngine_DC-ANSIBLE_PLUGIN-E6203.tar.gz
Verifying the installation
Verify that the SeerEngine-DC Ansible package is correctly installed. If the correct software version is displayed, the package is installed successfully.
[root@localhost ~]# ansible-galaxy collection list | grep h3c
h3c.sdn 2.0.0
Removing the plug-in
1. Identify the path where the plug-in is saved.
[root@localhost ~]# find / -name h3c
/root/.ansible/collections/ansible_collections/h3c
2. Remove the code block from the path.
[root@localhost ~] rm -rf /root/.ansible/collections/ansible_collections/h3c
3. Verify that the plug-in is removed successfully. If no result is displayed, the plug-in is removed successfully.
[root@localhost ~]# ansible-galaxy collection list | grep h3c
Upgrading the plug-in
To upgrade the SeerEngine-DC Ansible plug-in, you must remove the current version first, and install the new version. For information about installing the SeerEngine-DC Ansible plug-in, see "Installing the plug-in." For information about removing the SeerEngine-DC Ansible plug-in, see "Removing the plug-in."
Creating playbooks
CAUTION: The SeerEngine-DC controller performs a fuzzy match when it searches for resources through the RESTful API. For example, if you use an Ansible playbook to delete a vNetwork resource named net1, all vNetworks whose name contains "net1", for example, net12 and net123 are matched and will also be deleted. To avoid such issues, you must make sure the names of the resources are not inclusive of each other when you create resources on the controller. |
Create a playbook in the format of xxx.yaml. When you run a playbook, the system calls a specific custom module defined in that playbook.
Restrictions and guidelines
For a required parameter, you must enter the parameter and its value in the playbook. For an optional parameter, if you do not specify a value for it, the system uses the default value, if any. Other parameters are common parameters defined by Ansible. You specify the parameters by following the examples.
Creating a network playbook
- name: network
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.network:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
name: “net1”
tenant_name: “ansible”
shared: false
admin_state_up: true
external: false
provider_physical_network: “phy1”
provider_network_type: vxlan
provider_segmentation_id: 222
mtu: 1450
state: present
Table 2 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
network |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn.network |
Network module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
name |
Name of the vNetwork, required. |
net1 |
tenant_name |
Name of the tenant to which the network belongs. For an internal network, this parameter is required. For an external network, this parameter is optional. |
ansible |
shared |
Whether to share the network, optional: · true. · false. The default value is false. |
false |
admin_state_up |
Management state, optional: · true. · false. The default value is true. |
true |
external |
Whether the network is an external network, optional: · true. · false. The default value is false. |
false |
provider_physical_network |
Name of the physical interface, optional. |
phy1 |
provider_network_type |
Type of the network, optional: · vlan. · vxlan. |
vxlan |
provider_segmentation_id |
ID of the network segment, optional. The value is an integer in the range of 1 to 16777215. |
222 |
mtu |
Value of the network MTU, optional. The value is an integer in the range of 68 to 65535. |
1450 |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Creating a port playbook
- name: port
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.port:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
name: “port1”
network_name: “network1”
mac_address:“00:50:56:bd:2c:b6”
fixed_ips:[{“subnet_name”:”sub1”, ”ip_address”:”99.0.92.8”}]
binding_profile:{"enable_snat": true, "fw_enabled": “true”}
port_security_enabled: true
port_securities_name:[“sq1”, ”sg2”]
qos_name: “qos1”
state:present
Table 3 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
port |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn.port |
Port module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
name |
Name of the virtual port, required. |
port1 |
network_name |
Name of the network in which the port resides, required. |
network1 |
mac_address |
MAC address of the port, optional. |
00:50:56:bd:2c:b6 |
fixed_ips |
IP address of the port, required. This parameter is list type. |
[{“subnet_name”:”sub1”, ”ip_address”:”99.0.92.8”}] |
binding_profile |
Customized data, optional. This parameter is dictionary type. |
{"enable_snat": true, "fw_enabled": “true”} |
port_security_enabled |
Port security, optional: · true. · false. The default value is true. |
true |
port_securities_name |
Name of the security group to which the port is bound, optional. This parameter is list type. |
[“sq1”, ”sg2”] |
qos_name |
Name of QoS policy to which the port is bound, optional. |
qos1 |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Creating a QoS playbook
- name: qos
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.qos:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
name: “qos1”
policies: {"dscp": "3", "rateUnit": "Kbps", "rx_averateLimit": "22", "rx_brustsize": "33","tx_averateLimit": "33","tx_brustsize": "22"}
state: present
Table 4 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
qos |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn.qos |
QoS module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
name |
Name of QoS policy, required. |
qos1 |
policies |
QoS policy, optional. This parameter is dictionary type. |
{"dscp": "3", "rateUnit": "Kbps", "rx_averateLimit": "22", "rx_brustsize": "33", "tx_averateLimit": "33", "tx_brustsize": "22"} |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Creating a router playbook
- name: router
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.router:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
name: “router1”
tenant_name: “ansible”
admin_state_up: true
provider_segmentation_id: 123
router_internal_subnet_interface_name: [“sub1”, ”sub2”]
external_gateway: “external_network”
state: present
Table 5 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
router |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn.router |
Router module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
name |
Name of the vRouter, required. |
router1 |
tenant_name |
Name of the tenant to which the router belongs, required. |
ansible |
admin_state_up |
Management state, optional: · true. · false. The default value is true. |
true |
provider_segmentation_id |
L3VNI, an integer in the range of 1 to 16777215. |
123 |
router_internal_subnet_interface_name |
Name of the internal subnet to which the router is bound, optional. This parameter is list type. |
[“sub1”, ”sub2”] |
external_gateway |
Network name of the gateway, optional. |
external_network |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Creating a security group playbook
- name: security_group
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.security_group:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
name: “sg1”
tenant_name: “ansible”
ip_mac_binding: true
empty_rule_action: deny
securityrules: [{"direction": "ingress","ipprefix": "66.0.3.0/24","protocol": "TCP","ip_version": "4","portrange_max": "49","portrange_min": "3"}]
state: present
Table 6 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
security_group |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn. security_group |
Security group module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
name |
Name of the security group, required. |
sg1 |
tenant_name |
Name of the tenant to which the security group belongs, required. |
ansible |
ip_mac_binding |
IP-MAC spoofing prevention, required. · true. · false. |
true |
empty_rule_action |
Action to be taken if no rule is specified, optional: · permit. · deny. The default value is permit. |
deny |
securityrules |
Rule of the security group, optional. This parameter is list type. |
[{"direction": "ingress","ipprefix": "66.0.3.0/24","protocol": "TCP","ip_version": "4","portrange_max": "49","portrange_min": "3"}] |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Creating a subnet playbook
- name: subnet
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.subnet:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
name: “subnet1”
network_name: “network1”
cidr: “99.0.98.0/24”
ip_version: “4”
gateway_ip: “99.0.98.1”
enable_dhcp: true
allocation_pools: [{"start": "99.0.98.1","end":"99.0.98.25"}]
dns_nameservers:[“99.0.9.9”]
leaseTime: 365
dhcp_options: {"server_identifier":"99.0.98.2","domain_name":"dhcp_domain"}
ipv6_address_mode: dhcpv6-stateless
ipv6_ra_mode: dhcpv6-stateless
state: present
Table 7 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
subnet |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn. subnet |
Subnet module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
name |
Name of the vSubnet, required. |
subnet1 |
network_name |
Name of the network to which the vSubnet belongs, required. |
network1 |
cidr |
Network address, required. |
99.0.98.0/24 |
ip_version |
Version of the IP address, required: · 4 · 6 |
4 |
gateway_ip |
IP address of the gateway, optional. |
99.0.98.1 |
enable_dhcp |
Whether to enable DHCP for the subnet, optional: · true. · false. |
true |
allocation_pools |
Subnet address pool, optional. This parameter is list type. |
[{"start": "99.0.98.1","end":"99.0.98.25"}] |
dns_nameservers |
DNS server list, optional. This parameter is list type. |
[“99.0.9.9”] |
leaseTime |
Lease time of the DHCP client address, optional. This parameter is supported by only IPv4. The default value is 365. |
365 |
dhcp_options |
DHCP options, optional. This parameter is dictionary type. |
{"server_identifier":"99.0.98.2","domain_name":"dhcp_domain"} |
ipv6_address_mode |
IPv6 address mode, optional: · None. · slaac. · dhcpv6-stateful. · dhcpv6-stateless. |
dhcpv6-stateless |
ipv6_ra_mode |
IPv6 RA mode, optional: · None. · slaac. · dhcpv6-stateful. · dhcpv6-stateless. |
dhcpv6-stateless |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Creating a tenant playbook
- name: tenant
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.tenant:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
name: “ansible”
type: local-create
vds_list: “VDS1”
state: present
Table 8 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
tenant |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn.tenant |
Tenant module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
name |
Name of the tenant, required. |
ansible |
type |
Source of the tenant, required: · default. · local-create. · import. · iam. |
local-create |
vds_list |
VDS of the tenant, required. |
VDS1 |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Creating a device playbook
- name: device
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.device:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
name: “device1”
description: “my_device”
type: EDGW
management_ip: “99.0.50.159”
management_ip6: “64::64”
vtep_ip: “159.159.159.159”
vtep_ip6: “77::77”
dci_vtep_ip: “180.180.180.180”
dci_vtep_ip6: “88::88”
fabric_name: “fabric1”
prior_region_name: “region1”
label: “biaoqian”
smooth_flag: “ON”
snmp_parameter_version: SNMP_V2
snmp_parameter_community_write: “write”
snmp_parameter_community_read: “read”
snmp_parameter_user_name: “sdn”
snmp_parameter_authentication_protocol: MD5
snmp_parameter_authentication_password: “1qaz2wsx3ed”
snmp_parameter_privacy_protocol: DES
snmp_parameter_privacy_password: “2wsx3edc1qaz”
netconf_name: “root”
netconf_password: “123456”
openflow_connection_vrf: “vrf1”
openflow_inband_management_vlan: “200”
openflow_ssl_policy_name: “ssl1”
openflow_ssl_access_control_policy_name: “ssl2”
openflow_controller_port: 6633
openflow_forbidden_port: 0
reserve_tunnel_id: 256
role_name: leaf
state: present
Table 9 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
device |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn.device |
Device module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
name |
Name of the device, required. |
device1 |
description |
Description for the device, optional |
my_device |
type |
Type of the device, required: · UNDERLAY_DEVICE. · EDGW. · EDGW_BORDER. · TRADITIONAL_DEVICE. |
EDGW |
management_ip |
IPv4 address for device management. You must specify an IPv4 or IPv6 address for device management. This parameter is mutually exclusive with the management_ip6 parameter. |
99.0.50.159 |
management_ip6 |
IPv6 address for device management. You must specify an IPv4 or IPv6 address for device management. This parameter is mutually exclusive with the management_ip parameter. |
64::64 |
vtep_ip |
VXLAN tunnel endpoint (VTEP) IPv4 address. This parameter is required when the value of the type parameter is UNDERLAY_DEVICE, EDGW, or EDGW_BORDER and not required when the value of the type parameter is TRADITIONAL_DEVICE. |
159.159.159.159 |
vtep_ip6 |
VXLAN tunnel endpoint (VTEP) IPv6 address. This parameter is required when the value of the type parameter is UNDERLAY_DEVICE, EDGW, or EDGW_BORDER and not required when the value of the type parameter is TRADITIONAL_DEVICE. |
77::77 |
dci_vtep_ip |
VTEP IPv4 address for DC interconnection, optional. |
180.180.180.180 |
dci_vtep_ip6 |
VTEP IPv6 address for DC interconnection, optional. |
88::88 |
fabric_name |
Name of the fabric to which the device belongs. If you do not configure this parameter, the default fabric on the controller is used. If the controller does not have a default fabric, you must configure this parameter. |
fabric1 |
prior_region_name |
Name of the preferential region, optional. |
region1 |
label |
Label, optional. |
biaoqian |
smooth_flag |
How data is synchronized between the controller and device when the device is activated, optional: · DEFAULT. · ON. · OFF. The default value is DEFAULT. If you select ON or OFF, add double quotation marks for it. |
"ON" |
snmp_parameter_version |
SNMP version, optional: · SNMP_V2. · SNMP_V3. |
SNMP_V2 |
snmp_parameter_community_write |
SNMP read-write community string, optional. This parameter takes effect only when the value of the snmp_parameter_version parameter is SNMP_V2. |
write |
snmp_parameter_community_read |
SNMP read-only community string, optional. This parameter takes effect only when the value of the snmp_parameter_version parameter is SNMP_V2. |
read |
snmp_parameter_user_name |
SNMPv3 username, a case-sensitive string of 1 to 32 characters. Chinese characters are not supported. This parameter is required and takes effect only when the value of the snmp_parameter_version parameter is SNMP_V3. |
sdn |
snmp_parameter_authentication_protocol |
SNMPv3 authentication algorithm, optional: · MD5. · SHA. This parameter takes effect only when the value of the snmp_parameter_version parameter is SNMP_V3. |
MD5 |
snmp_parameter_authentication_password |
SNMPv3 authentication password, a string of 10 to 64 characters that must contain a minimum of two of the four character types: digits, uppercase letters, lowercase letters, and special characters. Chinese characters, quotation marks (?), spaces, username, and username spelled backward are not supported. This parameter is required and takes effect only when the snmp_parameter_authentication_protocol parameter is configured. |
1qaz2wsx3ed |
snmp_parameter_privacy_protocol |
SNMPv3 encryption algorithm, optional: · DES. · AES128. · AES192. · AES256. · 3DES. This parameter takes effect only when the snmp_parameter_authentication_protocol parameter is configured. |
DES |
snmp_parameter_privacy_password |
SNMPv3 encryption password, a string of 10 to 64 characters that must contain a minimum of two of the four character types: digits, uppercase letters, lowercase letters, and special characters. Chinese characters, quotation marks (?), spaces, username, and username spelled backward are not supported. This parameter is required and takes effect only when the snmp_parameter_privacy_protocol parameter is configured. |
2wsx3edc1qaz |
netconf_name |
NETCONF username. You can leave this parameter unconfigured if the NETCONF username of the device is consistent with the default NETCONF username configured for devices on the controller. If not consistent, you must configure this parameter. |
root |
netconf_password |
NETCONF password. You can leave this parameter unconfigured if the NETCONF password of the device is consistent with the default NETCONF password configured for devices on the controller. If not consistent, you must configure this parameter. |
123456 |
openflow_connection_vrf |
VRF to which the controller belongs specified for the device to establish OpenFlow connection with the controller. |
vrf1 |
openflow_inband_management_vlan |
In-band management VLAN ID or range in the range of 1 to 4094, optional. |
200 |
openflow_ssl_policy_name |
SSL client policy name, optional. |
ssl1 |
openflow_ssl_access_control_policy_name |
Certificate access control policy name, optional. |
ssl2 |
openflow_controller_port |
Port number used by the controller for establishing OpenFlow connection with the device, optional. The value is an integer in the range of 1 to 65535. |
6633 |
openflow_forbidden_port |
Forbidden port number in the OpenFlow instance, option. The value is an integer in the range of 0 to 7. |
0 |
reserve_tunnel_id |
Number of tunnels reserved for other services. The value is an integer in the range of 0 to 64000. The default value is 256. |
256 |
role_name |
Role of the device, optional: · spine. · aggr. · leaf. · access. |
leaf |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Creating an interface playbook
- name: interface
hosts: localhost
gather_facts: false
become: false
tasks:
- h3c.sdn.interface:
auth:
url: https://99.0.92.23:8443
username: sdn
password: sdn123456
device_name: “device1”
if_index: “XGE2/1/1”
state: present
Table 10 Parameter description
Parameter |
Description |
Example |
name |
Name of the playbook. |
interface |
hosts |
Host on which the playbook runs. |
localhost |
gather_facts |
Whether to collect information about the host: · true. · false. |
false |
become |
Whether to escalate privilege: · true. · false. |
false |
tasks |
Tasks in the playbook. |
N/A |
h3c.sdn.interface |
Interface module that the task calls. |
N/A |
auth |
Peer controller authentication parameters. |
N/A |
url |
API of the controller, required. |
https://99.0.92.23:8443 |
username |
Username of the controller, required. |
sdn |
password |
Password of the controller, required. |
sdn123456 |
device_name |
Device name, required. |
device1 |
if_index |
Device interface name. |
XGE2/1/1 |
state |
Execution state, optional: · absent—Delete. · present—Create. The default value is present. |
present |
Running playbooks
To run a playbook, execute the ansible-playbook xxx.yaml command. The following example runs the network playbook.
[root@localhost ~]# ansible-playbook h3c_network.yaml