2015-12-23 22:54:56 +01:00
|
|
|
# Deploy OpenStack resources needed to run Tempest
|
2018-05-29 16:35:15 +00:00
|
|
|
# Provision based on service enabled
|
|
|
|
#
|
|
|
|
# [*glance*]
|
|
|
|
# (optional) Define if Glance Resources needs to be created.
|
|
|
|
# Default to true.
|
|
|
|
#
|
|
|
|
# [*neutron*]
|
|
|
|
# (optional) Define if Neutron Resources needs to be created.
|
|
|
|
# Default to true.
|
|
|
|
#
|
|
|
|
# [*nova*]
|
|
|
|
# (optional) Define if Nova Resources needs to be created.
|
|
|
|
# Default to true.
|
|
|
|
#
|
2022-06-06 16:00:39 +09:00
|
|
|
# [*image_format*]
|
|
|
|
# (optional) Format of glance images to be created.
|
|
|
|
# Defaults to 'qcow2'
|
|
|
|
#
|
2018-05-29 16:35:15 +00:00
|
|
|
class openstack_integration::provision (
|
2022-06-06 16:00:39 +09:00
|
|
|
$glance = true,
|
|
|
|
$nova = true,
|
|
|
|
$neutron = true,
|
|
|
|
$image_format = 'qcow2',
|
2018-05-29 16:35:15 +00:00
|
|
|
){
|
2015-12-23 22:54:56 +01:00
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
include openstack_integration::config
|
2016-03-01 18:50:40 -05:00
|
|
|
|
2018-05-29 16:35:15 +00:00
|
|
|
if $nova {
|
|
|
|
nova_flavor { 'm1.nano':
|
|
|
|
ensure => present,
|
|
|
|
id => '42',
|
|
|
|
ram => '128',
|
2019-02-15 18:00:00 +01:00
|
|
|
disk => '2',
|
2018-05-29 16:35:15 +00:00
|
|
|
vcpus => '1',
|
|
|
|
}
|
|
|
|
nova_flavor { 'm1.micro':
|
|
|
|
ensure => present,
|
|
|
|
id => '84',
|
|
|
|
ram => '128',
|
2019-02-15 18:00:00 +01:00
|
|
|
disk => '2',
|
2018-05-29 16:35:15 +00:00
|
|
|
vcpus => '1',
|
|
|
|
}
|
2023-11-05 23:25:47 +09:00
|
|
|
|
2018-05-29 16:35:15 +00:00
|
|
|
# NOTE(amoralej): "m1.tiny" flavor is required by murano scenario tests
|
|
|
|
nova_flavor { 'm1.tiny':
|
|
|
|
ensure => present,
|
|
|
|
id => '1',
|
|
|
|
ram => '128',
|
2019-02-15 18:00:00 +01:00
|
|
|
disk => '2',
|
2018-05-29 16:35:15 +00:00
|
|
|
vcpus => '1',
|
|
|
|
}
|
|
|
|
Keystone_user_role['admin@openstack'] -> Nova_flavor<||>
|
2017-05-05 15:54:29 +05:30
|
|
|
}
|
2015-12-23 22:54:56 +01:00
|
|
|
|
2018-05-29 16:35:15 +00:00
|
|
|
if $neutron {
|
|
|
|
neutron_network { 'public':
|
2022-02-17 23:56:02 +09:00
|
|
|
project_name => 'openstack',
|
2018-05-29 16:35:15 +00:00
|
|
|
router_external => true,
|
|
|
|
provider_physical_network => 'external',
|
|
|
|
provider_network_type => 'flat',
|
|
|
|
}
|
|
|
|
Keystone_user_role['admin@openstack'] -> Neutron_network<||>
|
2015-12-23 22:54:56 +01:00
|
|
|
|
2018-05-29 16:35:15 +00:00
|
|
|
neutron_subnet { 'public-subnet':
|
|
|
|
cidr => '172.24.5.0/24',
|
|
|
|
ip_version => '4',
|
|
|
|
allocation_pools => ['start=172.24.5.10,end=172.24.5.200'],
|
|
|
|
gateway_ip => '172.24.5.1',
|
|
|
|
enable_dhcp => false,
|
|
|
|
network_name => 'public',
|
2022-02-17 23:56:02 +09:00
|
|
|
project_name => 'openstack',
|
2018-05-29 16:35:15 +00:00
|
|
|
}
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
|
|
|
|
2018-05-29 16:35:15 +00:00
|
|
|
if $glance {
|
2023-10-15 12:29:27 +09:00
|
|
|
$image_path = "/tmp/openstack/image/cirros-0.6.2-x86_64-disk-${image_format}.img"
|
2022-06-06 16:00:39 +09:00
|
|
|
|
2018-05-29 16:35:15 +00:00
|
|
|
glance_image { 'cirros':
|
|
|
|
ensure => present,
|
|
|
|
container_format => 'bare',
|
2022-06-06 16:00:39 +09:00
|
|
|
disk_format => $image_format,
|
2018-05-29 16:35:15 +00:00
|
|
|
is_public => 'yes',
|
2022-06-06 16:00:39 +09:00
|
|
|
source => $image_path,
|
2018-05-29 16:35:15 +00:00
|
|
|
}
|
|
|
|
glance_image { 'cirros_alt':
|
|
|
|
ensure => present,
|
|
|
|
container_format => 'bare',
|
2022-06-06 16:00:39 +09:00
|
|
|
disk_format => $image_format,
|
2018-05-29 16:35:15 +00:00
|
|
|
is_public => 'yes',
|
2022-06-06 16:00:39 +09:00
|
|
|
source => $image_path,
|
2018-05-29 16:35:15 +00:00
|
|
|
}
|
|
|
|
Keystone_user_role['admin@openstack'] -> Glance_image<||>
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
|
|
|
}
|