summaryrefslogtreecommitdiffstats
path: root/ansible_collections/cisco/dnac/playbooks/application_sets.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/cisco/dnac/playbooks/application_sets.yml')
-rw-r--r--ansible_collections/cisco/dnac/playbooks/application_sets.yml43
1 files changed, 43 insertions, 0 deletions
diff --git a/ansible_collections/cisco/dnac/playbooks/application_sets.yml b/ansible_collections/cisco/dnac/playbooks/application_sets.yml
new file mode 100644
index 000000000..ac489ece7
--- /dev/null
+++ b/ansible_collections/cisco/dnac/playbooks/application_sets.yml
@@ -0,0 +1,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