Add initial support for creating volumes

For some services it may be desirable to have instances using
cinder volumes, this change allows to define that in the
infra_config.yml inventory and the provision_infra_servers
will create them.
A follow-up patch will attach the volumes defined on each instance.

Change-Id: I28d187569655fbbc45cec0bce771ce8adab1f4dd
This commit is contained in:
Ricardo Carrillo Cruz 2015-10-15 17:37:48 +02:00
parent 3e3a3b0ff0
commit cb16f959b7
2 changed files with 15 additions and 0 deletions

View File

@ -28,6 +28,11 @@ infra_servers:
net_name: your_neutron_network
security_groups: "default,webserver"
infra_type: gerrit
volumes:
- name: gerrit_volume
size: 40
- name: gerrit_volume2
size: 60
- name: nodepool
image: 9d25fe2d-cf31-4b05-8c58-f238ec78e633
flavor: standard.small

View File

@ -16,3 +16,13 @@
group: infra
infra_type: "{{ item.infra_type }}"
with_items: infra_servers
- name: Create OpenStack volumes
os_volume:
state: present
cloud: "{{item.os_client_config_cloud | default(os_client_config_cloud) }}"
display_name: "{{ item.1.name }}"
size: "{{ item.1.size }}"
with_subelements:
- infra_servers
- volumes