例子
本节由各种示例剧本组成,以实现不同的用例。这意味着要么在剧本中完成单个任务,要么一起完成任务列表。
第一天的自动化:
在配置新站点时,可以将必须执行的典型任务列为:
添加节点层次结构,将托管设备添加到层次结构,更改托管设备的主机名,创建AP组,白名单APS,将APS添加到AP组中,创建新的SSID。
- 名称:创建和配置站点主机:所有连接:local gather_facts:无角色: - 角色:arubanetworks.aos_wlan_role tasks: - 名称:创建niere hieraRchy aos_api_config:aos_api_config:方法:post config_path: /md /boston-名称:添加设备aos_api_config:方法:post config_path: /md data: - configuration_device:dev-model:a7010 mac-address:fa:fa:fa:fa:fa:fa:fa:fa:fa:fa:fa:fa config-path:md:md:md:md:md:md:md:md/波士顿 - 名称:托管设备AOS_API_CONFIG的Changnig主机名:方法:post config_path:/md/boston/fa:fa:fa:fa:fa:fa:fa:fa:fa data data: - 主机名:hostName:hostname:hostname:new -md-名称:new -md-名称:移动dirtua-- niveing dirtua--AP到AP组aos_api_config:方法:post config_path: /md /boston数据: - ap_group: - profile-name:test_apgroup virtual-ap: - profile-ap: - profile-name:test_vap- name:name:whitelist访问新的ap ap-group的访问点aos_cap_whitelist:操作:添加ap_name:test-ap-1 ap_group:test_apgroup mac_address:“ ab:32:32:32:32:32:32:32:32“描述:波士顿办公室,建筑物6,2楼,
运行时自动化
添加新的半径服务器
- hosts: all connection: local gather_facts: no roles: - role: arubanetworks.aos_wlan_role tasks: - name: Adding a RADIUS server aos_api_config: method: POST config_path: /md/Boston data: - rad_server: - rad_server_name: test-server rad_host: host: 1.1.1.1
创建客人SSID:
创建一个客人名称人configure the following profiles: Radius Server, Server Group, RFC server, Dot1x Auth profile, AAA profiles, Captive Portal Profile, SSID Profile, VAP Profile, AP Group
--- - name: Create and configure an internal Guest SSID hosts: all connection: local gather_facts: no roles: - role: arubanetworks.aos_wlan_role tasks: - name: Create the ssid profile with essid and opmode aos_api_config: method: POST config_path: /md/Boston data: - ssid_prof: profile-name: ssid-guest-demo ssid_enable: {} essid: essid: guest-demo opmode: opensystem: true - name: Create the netdestination for the authenticated clients aos_api_config: method: POST config_path: /md/Boston data: - netdst: dstname: netdst-guest-demo netdst__network: - address: 10.0.0.0 netmask: 255.0.0.0 - address: 192.16.0.0 netmask: 255.255.0.0 - name: Create the periodic time range aos_api_config: method: POST config_path: /md/Boston data: - time_range_per: name: guest-demo-working-hrs time_range_per__day: - day: Weekday StartTime: '07:00' EndTime: '18:00' - name: Create the policy with session acls and time range aos_api_config: method: POST config_path: /md/Boston data: - acl_sess: accname: acl-guest-demo-time-range acl_sess__v4policy: - suser: true dany: true service-name: svc-dhcp permit: true trname: guest-demo-working-hrs - suser: true dany: true service-name: svc-dns permit: true trname: guest-demo-working-hrs - suser: true dstalias: netdst-guest-demo service-any: true permit: true trname: guest-demo-working-hrs - suser: true dany: true service-name: svc-http permit: true trname: guest-demo-working-hrs - suser: true dany: true service-name: svc-https permit: true trname: guest-demo-working-hrs - suser: true dany: true service-any: true deny: true - name: Create the user role assigned after captive portal authentication aos_api_config: method: POST config_path: /md/Boston data: - role: rname: demo role__acl: - acl_type: session pname: acl-guest-demo-time-range - name: Create the captive portal authentication profile aos_api_config: method: POST config_path: /md/Boston data: - cp_auth_profile: profile-name: cp-guest-demo cp_default_role: default-role: demo cp_default_guest_role: default-guest-role: demo cp_server_group: server-group: internal allow_user: {} logout_popup: {} cp_proto_http: {} - name: Create the guest logon user role aos_api_config: method: POST config_path: /md/Boston data: - role: rname: usr-guest-demo role__acl: - acl_type: session pname: logon-control - acl_type: session pname: captiveportal - acl_type: session pname: v6-logon-control - acl_type: session pname: captiveportal6 role__cp: cp_profile_name: cp-guest-demo - name: Create the aaa profile aos_api_config: method: POST config_path: /md/Boston data: - aaa_prof: profile-name: aaa-guest-demo default_user_role: role: usr-guest-demo - name: Create the virtual ap profile aos_api_config: method: POST config_path: /md/Boston data: - virtual_ap: profile-name: vap-guest-demo aaa_prof: profile-name: aaa-guest-demo vlan: vlan: 16 ssid_prof: profile-name: ssid-guest-demo - name: Create the AP group with virtual AP profile aos_api_config: method: POST config_path: /md/Boston data: - ap_group: profile-name: apgrp-guest-demo virtual_ap: - profile-name: vap-guest-demo
监视自动化
Showcommand API Example to fetch the AP database
- 名称:执行show命令主机:所有连接:local gather_facts:无角色: - 角色:arubanetworks.aos_wlan_role任务: - 名称:获取有关访问点的基本信息aos_showcommand:command:命令:显示AP数据库
获取API示例以获取VLES VLAN
- hosts: all connection: local gather_facts: no roles: - role: arubanetworks.aos_wlan_role tasks: - name: Get a list of all VLANs from current as well as parent hierarchy aos_vlan: action: get type: all config_path: /md/Boston
Updated 1年前
Did this page help you?