Advertisement
Guest User

Untitled

a guest
Jan 14th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. # source rc file for Openstack auth
  2.  
  3. - name: Create Openstack instance
  4. hosts: "localhost"
  5. gather_facts: false
  6. # user: root
  7. connection: local
  8. become: yes
  9. become_user: root
  10.  
  11. vars:
  12. pb_os_username: "{{ lookup('env', 'OS_USERNAME') }}"
  13. pb_os_password: "{{ lookup('env', 'OS_PASSWORD') }}"
  14. pb_os_tenant_name: "{{ lookup('env', 'OS_TENANT_NAME') }}"
  15. pb_os_auth_url: "{{ lookup('env', 'OS_AUTH_URL') }}"
  16.  
  17. tasks:
  18. - name: launch an instance
  19. os_server:
  20. state: present
  21. auth:
  22. auth_url: "{{ pb_os_auth_url }}"
  23. username: "{{ pb_os_username }}"
  24. password: "{{ pb_os_password }}"
  25. project_name: "{{ pb_os_tenant_name }}"
  26. name: xyz-test
  27. image: 736f014f-8907-4e1e-9e02-cd4b04c4adb2
  28. boot_from_volume: True
  29. key_name: xyz-keypair1
  30. network: 1bacbdcc-a580-456d-bf8b-7937e63579b0
  31. security_groups: a8597ee7-3071-4a4f-9598-3439746f438e
  32. # userdata: "{{ lookup('file', 'cloudinit.yml') }}"
  33. timeout: 200
  34. flavor: 4
  35. meta:
  36. hostname: xyz-test
  37. group: ansible_group1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement