summaryrefslogtreecommitdiffstats
path: root/ansible_collections/cisco/dnac/playbooks/application_sets.yml
blob: ac489ece71aac6ac7fb1777023d10e170f816978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
- hosts: dnac_servers
  vars_files:
    - credentials.yml
  gather_facts: false
  tasks:
    - name: Create an application set
      cisco.dnac.application_sets:
        dnac_host: "{{ dnac_host }}"
        dnac_username: "{{ dnac_username }}"
        dnac_password: "{{ dnac_password }}"
        dnac_verify: "{{ dnac_verify }}"
        dnac_debug: "{{ dnac_debug }}"
        state: present
        payload:
          - name: AppSet1
      register: application_set_result

    - name: Get task info
      cisco.dnac.task_info:
        dnac_host: "{{ dnac_host }}"
        dnac_username: "{{ dnac_username }}"
        dnac_password: "{{ dnac_password }}"
        dnac_verify: "{{ dnac_verify }}"
        taskId: "{{ application_set_result.dnac_response.response.taskId }}"
      when:
        - application_set_result.dnac_response is defined
        - application_set_result.dnac_response.response is defined
        - application_set_result.dnac_response.response.taskId is defined
      register: task_result

    - name: Show new application_set
      ansible.builtin.debug:
        msg: "{{ application_set_result }}"
      when:
        - application_set_result is defined

    - name: Show retrieved task
      ansible.builtin.debug:
        msg: "{{ task_result.dnac_response.response }}"
      when:
        - task_result is defined
        - task_result.dnac_response is defined