From 2099895646179392775dc51e96397852a1204200 Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Wed, 4 May 2016 12:26:30 -0400 Subject: [PATCH] Move flavor provisioning to new nova flavor provider Change-Id: I17beaa19632181fa10c91b137eaef365ab44641b Depends-On: Ic370ac65990d0b3a360340632ada4016231c8a93 --- manifests/provision.pp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/manifests/provision.pp b/manifests/provision.pp index b1a963995..79f7e5c11 100644 --- a/manifests/provision.pp +++ b/manifests/provision.pp @@ -4,25 +4,21 @@ class openstack_integration::provision { include ::openstack_integration::config - $os_auth_options = "--os-username admin --os-password a_big_secret --os-tenant-name openstack --os-auth-url ${::openstack_integration::config::keystone_auth_uri}/v2.0" - - exec { 'manage_m1.nano_nova_flavor': - path => '/usr/bin:/bin:/usr/sbin:/sbin', - provider => shell, - command => "nova ${os_auth_options} flavor-create m1.nano 42 128 0 1", - unless => "nova ${os_auth_options} flavor-list | grep m1.nano", + nova_flavor { 'm1.nano': + ensure => present, + id => '42', + ram => '128', + disk => '0', + vcpus => '1', } - Keystone_user_role['admin@openstack'] -> Exec['manage_m1.nano_nova_flavor'] - Class['::nova::keystone::auth'] -> Exec['manage_m1.nano_nova_flavor'] - - exec { 'manage_m1.micro_nova_flavor': - path => '/usr/bin:/bin:/usr/sbin:/sbin', - provider => shell, - command => "nova ${os_auth_options} flavor-create m1.micro 84 128 0 1", - unless => "nova ${os_auth_options} flavor-list | grep m1.micro", + nova_flavor { 'm1.micro': + ensure => present, + id => '84', + ram => '128', + disk => '0', + vcpus => '1', } - Keystone_user_role['admin@openstack'] -> Exec['manage_m1.micro_nova_flavor'] - Class['::nova::keystone::auth'] -> Exec['manage_m1.micro_nova_flavor'] + Class['::nova::keystone::auth'] -> Nova_flavor<||> neutron_network { 'public': tenant_name => 'openstack',