# Copyright (c) 2019 Dell Inc. or its subsidiaries. All Rights Reserved.
---
- name: Build team payload
  set_fact:
    team_data: '{ "name": "{{ item.name }}", "description": "{{ item.description }}", "organization": "{{ item.organization }}" }'
  
- name: Create Team
  shell: > 
    kubectl exec -it -n ngci-consul {{ consul_pod_name.stdout }} -c ngci-secret-storage-consul --
    curl -XPOST -u {{ awx_admin_username }}:{{ awx_admin_password }} {{ awx_service_address }}/api/v2/teams/ -H 'Content-Type: application/json' -d '{{ team_data | to_json }}'
  no_log: "{{ enforce_no_log }}"