Here is an example that works for me:

- name: launch compute instance
  hosts: localhost
  vars:
     auth_url: "http://controller:35357/v2.0/";
     username:
     password:
     project:
     image: CentOS-7-x86_64-GenericCloud-1601
     key: somekey
     timeout: 200
     flavor: m1.small
     security: default

  tasks:
  - name: launch instance
    os_server:
      state: present
      auth:
        auth_url: "{{ auth_url }}"
        username: "{{ username }}"
        password: "{{ password }}"
        project_name: "{{ project }}"
      name: test
      image: "{{ image }}"
      key_name: "{{ key }}"
      timeout: "{{ timeout }}"
      flavor: "{{ flavor }}"
      security_groups: "{{ security }}"

On Thu, Mar 17, 2016 at 9:58 AM, David Biglin <dave.big...@gmail.com> wrote:
> Hi all,
>
> Sorry if this is in the wrong area for posting however I have been
> struggling for a while with this issue.
>
> I am trying to use Ansible to build a VM environment on an OpenStack based
> Hypervisor.
>
> I have used Ansible in the past to configure VMs once they have been
> configured.
>
> I have read through the Ansible Doc's and understand the OS Cloud management
> modules. However the issue I am having is regarding authentication with
> DataCentered our Cloud provider.
>
> When I connect up using the CLI I can list all the servers and create new
> machines using python.
>
> However the issue I am having is i cant seem to authenticate using Ansible.
>
> Has anyone successfully managed to build new VMs on OpenStack with Ansible
> and would they happen to have some sample code which is not just on the
> Ansible Docs.
>
> I have googled and only found how to install openstack with ansible.
>
> Cheers in advance.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3c0d3108-738d-4044-aa4c-09fe536fd9b7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKsMCERdBZwt2P57n_C%3DAW9BbmkVgrMt0TjNdphBVWH-juRL6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to