--- - name: VLAN Automation with Ansible on HP Com7 Devices hosts: switches gather_facts: no connection: local tasks: # - name: ensure VLAN 10 exists # comware_vlan: # vlanid: 10 # name: VLAN10_WEB # descr: LOCALSEGMENT # username: "{{ username }}" # password: "{{ password }}" # hostname: "{{ inventory_hostname }}" - name: get gather_facts comware_facts: username: "acladmin" password: "0V0FKgngLeLqkPvklm9S" hostname: "{{ inventory_hostname }}" - name: enable acl comware_acl: aclid: "{{ aclid }}" state: "{{ state }}" groupcg: advanced name: "{{interface}}" appdirec: "{{ appdirec }}" username: "acladmin" password: "0V0FKgngLeLqkPvklm9S" hostname: "{{ inventory_hostname }}" - name: save running config comware_save: username: "{{ username }}" password: "{{ password }}" hostname: "{{ inventory_hostname }}"