From aede924d6e3cfce9d3b82f1ee62a1476c8f4bf0b Mon Sep 17 00:00:00 2001 From: Aaron Greengrass Date: Thu, 23 Jan 2014 13:30:56 -0800 Subject: [PATCH] Move o.o user creation to it's own manifest. This patch creates a manifest for user creation that doesn't live in base. This is the first of several patches to abstract the openstack_project module. Moving user creation out to it's own manifest will allow consumers of this module to optionally select the user creation step. This does not affect existing functionality. It is a patch to to add additional functionality later. Change-Id: Ie96a28f1b05e4222dcc96b92357958a6b3276f96 --- .../manifests/users_install.pp | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 modules/openstack_project/manifests/users_install.pp diff --git a/modules/openstack_project/manifests/users_install.pp b/modules/openstack_project/manifests/users_install.pp new file mode 100644 index 0000000000..24eef91e5c --- /dev/null +++ b/modules/openstack_project/manifests/users_install.pp @@ -0,0 +1,43 @@ +# Class: openstack_project::users_install +# +# This class handles adding and removing openstack admin users +# from the servers. +# +# Parameters: +# install_users - Boolean to set install or removal of O.O +# admins. Defaults to 'false', can be set in hiera. +# +# Requires: +# openstack_project::users - must contain the users designated. +# +# Sample Usage: +# include openstack_project::users_install +# class { 'openstack_project::users_install': +# install_users => true, +# } + +class openstack_project::users_install ( + $install_users = false, +) { + + include openstack_project::users + + ## TODO: this should be it's own manifest. + if ( $install_users == true ) { + package { $::openstack_project::params::user_packages: + ensure => present + } + realize ( + User::Virtual::Localuser['mordred'], + User::Virtual::Localuser['corvus'], + User::Virtual::Localuser['clarkb'], + User::Virtual::Localuser['fungi'], + ) + } else { + user::virtual::disable{'mordred':} + user::virtual::disable{'corvus':} + user::virtual::disable{'clarkb':} + user::virtual::disable{'fungi':} + } +} +