diff options
Diffstat (limited to 'cloud/openstack/os_server.py')
-rw-r--r-- | cloud/openstack/os_server.py | 222 |
1 files changed, 110 insertions, 112 deletions
diff --git a/cloud/openstack/os_server.py b/cloud/openstack/os_server.py index 12d8724e..f4d546d2 100644 --- a/cloud/openstack/os_server.py +++ b/cloud/openstack/os_server.py @@ -203,12 +203,11 @@ requirements: ''' EXAMPLES = ''' -# Creates a new instance and attaches to a network and passes metadata to -# the instance -- os_server: +- name: Create a new instance and attaches to a network and passes metadata to the instance + os_server: state: present auth: - auth_url: https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/ + auth_url: 'https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/' username: admin password: admin project_name: admin @@ -224,99 +223,98 @@ EXAMPLES = ''' hostname: test1 group: uge_master -# Creates a new instance in HP Cloud AE1 region availability zone az2 and +# Create a new instance in HP Cloud AE1 region availability zone az2 and # automatically assigns a floating IP - name: launch a compute instance hosts: localhost tasks: - - name: launch an instance - os_server: - state: present - auth: - auth_url: https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/ - username: username - password: Equality7-2521 - project_name: username-project1 - name: vm1 - region_name: region-b.geo-1 - availability_zone: az2 - image: 9302692b-b787-4b52-a3a6-daebb79cb498 - key_name: test - timeout: 200 - flavor: 101 - security_groups: default - auto_ip: yes - -# Creates a new instance in named cloud mordred availability zone az2 + - name: launch an instance + os_server: + state: present + auth: + auth_url: 'https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/' + username: username + password: Equality7-2521 + project_name: username-project1 + name: vm1 + region_name: region-b.geo-1 + availability_zone: az2 + image: 9302692b-b787-4b52-a3a6-daebb79cb498 + key_name: test + timeout: 200 + flavor: 101 + security_groups: default + auto_ip: yes + +# Create a new instance in named cloud mordred availability zone az2 # and assigns a pre-known floating IP - name: launch a compute instance hosts: localhost tasks: - - name: launch an instance - os_server: - state: present - cloud: mordred - name: vm1 - availability_zone: az2 - image: 9302692b-b787-4b52-a3a6-daebb79cb498 - key_name: test - timeout: 200 - flavor: 101 - floating_ips: - - 12.34.56.79 - -# Creates a new instance with 4G of RAM on Ubuntu Trusty, ignoring + - name: launch an instance + os_server: + state: present + cloud: mordred + name: vm1 + availability_zone: az2 + image: 9302692b-b787-4b52-a3a6-daebb79cb498 + key_name: test + timeout: 200 + flavor: 101 + floating_ips: + - 12.34.56.79 + +# Create a new instance with 4G of RAM on Ubuntu Trusty, ignoring # deprecated images - name: launch a compute instance hosts: localhost tasks: - - name: launch an instance - os_server: - name: vm1 - state: present - cloud: mordred - region_name: region-b.geo-1 - image: Ubuntu Server 14.04 - image_exclude: deprecated - flavor_ram: 4096 - -# Creates a new instance with 4G of RAM on Ubuntu Trusty on a Performance node + - name: launch an instance + os_server: + name: vm1 + state: present + cloud: mordred + region_name: region-b.geo-1 + image: Ubuntu Server 14.04 + image_exclude: deprecated + flavor_ram: 4096 + +# Create a new instance with 4G of RAM on Ubuntu Trusty on a Performance node - name: launch a compute instance hosts: localhost tasks: - - name: launch an instance - os_server: - name: vm1 - cloud: rax-dfw - state: present - image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) - flavor_ram: 4096 - flavor_include: Performance + - name: launch an instance + os_server: + name: vm1 + cloud: rax-dfw + state: present + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + flavor_ram: 4096 + flavor_include: Performance # Creates a new instance and attaches to multiple network - name: launch a compute instance hosts: localhost tasks: - - name: launch an instance with a string - os_server: - auth: - auth_url: https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/ - username: admin - password: admin - project_name: admin - name: vm1 - image: 4f905f38-e52a-43d2-b6ec-754a13ffb529 - key_name: ansible_key - timeout: 200 - flavor: 4 - nics: "net-id=4cb08b20-62fe-11e5-9d70-feff819cdc9f,net-id=542f0430-62fe-11e5-9d70-feff819cdc9f..." - -# Creates a new instance and attaches to a network and passes metadata to -# the instance -- os_server: + - name: launch an instance with a string + os_server: + auth: + auth_url: 'https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/' + username: admin + password: admin + project_name: admin + name: vm1 + image: 4f905f38-e52a-43d2-b6ec-754a13ffb529 + key_name: ansible_key + timeout: 200 + flavor: 4 + nics: "net-id=4cb08b20-62fe-11e5-9d70-feff819cdc9f,net-id=542f0430-62fe-11e5-9d70-feff819cdc9f..." + +- name: Creates a new instance and attaches to a network and passes metadata to the instance + os_server: state: present auth: - auth_url: https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/ + auth_url: 'https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/' username: admin password: admin project_name: admin @@ -330,51 +328,51 @@ EXAMPLES = ''' - net-name: another_network meta: "hostname=test1,group=uge_master" -# Creates a new instance and attaches to a specific network -- os_server: - state: present - auth: - auth_url: https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/ - username: admin - password: admin - project_name: admin - name: vm1 - image: 4f905f38-e52a-43d2-b6ec-754a13ffb529 - key_name: ansible_key - timeout: 200 - flavor: 4 - network: another_network - -# Creates a new instance with 4G of RAM on a 75G Ubuntu Trusty volume +- name: Creates a new instance and attaches to a specific network + os_server: + state: present + auth: + auth_url: 'https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/' + username: admin + password: admin + project_name: admin + name: vm1 + image: 4f905f38-e52a-43d2-b6ec-754a13ffb529 + key_name: ansible_key + timeout: 200 + flavor: 4 + network: another_network + +# Create a new instance with 4G of RAM on a 75G Ubuntu Trusty volume - name: launch a compute instance hosts: localhost tasks: - - name: launch an instance - os_server: - name: vm1 - state: present - cloud: mordred - region_name: ams01 - image: Ubuntu Server 14.04 - flavor_ram: 4096 - boot_from_volume: True - volume_size: 75 + - name: launch an instance + os_server: + name: vm1 + state: present + cloud: mordred + region_name: ams01 + image: Ubuntu Server 14.04 + flavor_ram: 4096 + boot_from_volume: True + volume_size: 75 # Creates a new instance with 2 volumes attached - name: launch a compute instance hosts: localhost tasks: - - name: launch an instance - os_server: - name: vm1 - state: present - cloud: mordred - region_name: ams01 - image: Ubuntu Server 14.04 - flavor_ram: 4096 - volumes: - - photos - - music + - name: launch an instance + os_server: + name: vm1 + state: present + cloud: mordred + region_name: ams01 + image: Ubuntu Server 14.04 + flavor_ram: 4096 + volumes: + - photos + - music ''' |