Documentation

cs_instance_facts - Gathering facts from the API of instances from Apache CloudStack based clouds.

New in version 2.1.

Synopsis

Gathering facts from the API of an instance.

Requirements (on host that executes module)

  • python >= 2.6
  • cs >= 0.6.10

Options

parameter required default choices comments
account
no
    Account the instance is related to.
    api_http_method
    no get
    • get
    • post
    HTTP method used.
    api_key
    no
      API key of the CloudStack API.
      api_region
      no cloudstack
        Name of the ini section in the cloustack.ini file.
        api_secret
        no
          Secret key of the CloudStack API.
          api_timeout
          no 10
            HTTP timeout.
            api_url
            no
              URL of the CloudStack API e.g. https://cloud.example.com/client/api.
              domain
              no
                Domain the instance is related to.
                name
                yes
                  Name or display name of the instance.
                  project
                  no
                    Project the instance is related to.

                    Examples

                    - local_action:
                        module: cs_instance_facts
                        name: web-vm-1
                    
                    - debug: var=cloudstack_instance
                    

                    Return Values

                    Common return values are documented here Common Return Values, the following are the fields unique to this module:

                    name description returned type sample
                    cloudstack_instance.ssh_key Name of SSH key deployed to instance. success string key@work
                    cloudstack_instance.name Name of the instance. success string web-01
                    cloudstack_instance.password The password of the instance if exists. success string Ge2oe7Do
                    cloudstack_instance.default_ip Default IP address of the instance. success string 10.23.37.42
                    cloudstack_instance.domain Domain the instance is related to. success string example domain
                    cloudstack_instance.tags List of resource tags associated with the instance. success dict [ { "key": "foo", "value": "bar" } ]
                    cloudstack_instance.zone Name of zone the instance is in. success string ch-gva-2
                    cloudstack_instance.state State of the instance. success string Running
                    cloudstack_instance.public_ip Public IP address with instance via static NAT rule. success string 1.2.3.4
                    cloudstack_instance.display_name Display name of the instance. success string web-01
                    cloudstack_instance.affinity_groups Affinity groups the instance is in. success list [ "webservers" ]
                    cloudstack_instance.id UUID of the instance. success string 04589590-ac63-4ffc-93f5-b698b8ac38b6
                    cloudstack_instance.project Name of project the instance is related to. success string Production
                    cloudstack_instance.instance_name Internal name of the instance (ROOT admin only). success string i-44-3992-VM
                    created Date of the instance was created. success string 2014-12-01T14:57:57+0100
                    cloudstack_instance.password_enabled True if password setting is enabled. success boolean True
                    cloudstack_instance.iso Name of ISO the instance was deployed with. success string Debian-8-64bit
                    cloudstack_instance.service_offering Name of the service offering the instance has. success string 2cpu_2gb
                    cloudstack_instance.account Account the instance is related to. success string example account
                    cloudstack_instance.hypervisor Hypervisor related to this instance. success string KVM
                    cloudstack_instance.security_groups Security groups the instance is in. success list [ "default" ]
                    cloudstack_instance.group Group name of the instance is related. success string web
                    cloudstack_instance.template Name of template the instance was deployed with. success string Debian-8-64bit


                    Notes

                    Note

                    Ansible uses the cs library’s configuration method if credentials are not provided by the arguments api_url, api_key, api_secret. Configuration is read from several locations, in the following order. - The CLOUDSTACK_ENDPOINT, CLOUDSTACK_KEY, CLOUDSTACK_SECRET and CLOUDSTACK_METHOD. CLOUDSTACK_TIMEOUT environment variables. - A CLOUDSTACK_CONFIG environment variable pointing to an .ini file, - A cloudstack.ini file in the current working directory. - A .cloudstack.ini file in the users home directory. Optionally multiple credentials and endpoints can be specified using ini sections in cloudstack.ini. Use the argument api_region to select the section name, default section is cloudstack. See https://github.com/exoscale/cs for more information.

                    Note

                    This module supports check mode.

                    This is an Extras Module

                    For more information on what this means please read Extras Modules

                    For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.