Ansible Modules: tacp_datacenter

The tacp_datacenter module creates or deletes virtual datacenters (VDCs).

The tacp_datacenter module provides the following functions:

For an overview of VDCs in ThinkAgile CP, see the following topic:

Virtual datacenters

Sample Playbooks

Note:
  • For more information about the parameters used with the tacp_datacenter module, run the following command:

    ansible-doc -t module tacp_datacenter
  • For more information about obtaining the API key, which is used to access the ThinkAgile CP Cloud Controller, see the following topic:

    Authorize Token

Create a new Virtual Datacenter

The following is an Ansible playbook in .yml format that creates a new virtual datacenter (VDC) on the ThinkAgile CP stack:

- name: Create a new virtual datacenter
  hosts: localhost
  gather_facts: false
  vars:
    api_key: <api-key-created-from-the-developer-options-page>
  tasks:
    - name: Create a new datacenter on ThinkAgile CP
      tacp_datacenter:
        api_key: "{{ api_key }}"
        name: MY_NEW_VDC
        support_widget_for_vdc_users: yes
        migration_zones:
          - name: <name-of-existing-migration-zone>
            cpu_cores: 10
            memory_gb: 20
        storage_pools:
          - name: <name-of-existing-storage-pool>
            storage_gb: 100
        networks:
          - name: <name-of-existing-network>
            network_type: VLAN
          - name: <name-of-existing-network>
            network_type: VNET
        templates:
          - name: FreeNAS 9.10
            new_name: CustomFreeNAS 9.10
            cpu_cores: 1
            memory_mb: 2048
            description: My custom FreeNAS template
            wait_to_download: yes
          - name: CentOS 7 - Jenkins - Lenovo Template
            cpu_cores: 4
            description: CentOS 7 with custom CPU cores amount
            wait_to_download: no
          - name: RHEL 7.4 (Minimal) - Lenovo Template
            description: RHEL 7.4 with default resources
            wait_to_download: no