- name: Ad group test
  hosts: ism
  connection: local
  gather_facts: no
  vars:
    ism:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Add active directory group information"
    inspur.sm.ad_group:
      state: "present"
      name: "wbs"
      domain: "inspur.com"
      pri: "administrator"
      kvm: "enable"
      vm: "disable"
      provider: "{{ ism }}"

  - name: "Set active directory group information"
    inspur.sm.ad_group:
      state: "present"
      name: "wbs"
      pri: "user"
      kvm: "disable"
      provider: "{{ ism }}"

  - name: "Delete active directory group information"
    inspur.sm.ad_group:
      state: "absent"
      name: "wbs"
      provider: "{{ ism }}"