Merge pull request #348 from enovance/register_rhn

Register rhn
This commit is contained in:
Emilien Macchi
2014-03-07 17:15:54 +01:00
4 changed files with 26 additions and 2 deletions

View File

@@ -49,5 +49,7 @@ fixtures:
'vcsrepo': 'git://github.com/enovance/puppetlabs-vcsrepo' 'vcsrepo': 'git://github.com/enovance/puppetlabs-vcsrepo'
'stdlib': 'git://github.com/enovance/puppetlabs-stdlib.git' 'stdlib': 'git://github.com/enovance/puppetlabs-stdlib.git'
'xinetd': 'git://github.com/enovance/puppetlabs-xinetd.git' 'xinetd': 'git://github.com/enovance/puppetlabs-xinetd.git'
'rhnreg_ks': 'git://github.com/enovance/puppet-rhnreg_ks.git'
'dnsclient': 'git://github.com/enovance/puppet-module-dnsclient.git'
symlinks: symlinks:
'cloud': '#{source_dir}' 'cloud': '#{source_dir}'

View File

@@ -322,6 +322,14 @@ class os_params {
$api_eth = $internal_netif_ip $api_eth = $internal_netif_ip
$storage_eth = $storage_netif_ip $storage_eth = $storage_netif_ip
# Red Hat Network registration
$rhn_registration = {
username => 'rhn',
password => 'pass',
server_url => 'https://rhn.redhat.com/rpc/api',
force => true,
}
# OpenStack Identity # OpenStack Identity
$identity_roles_addons = ['SwiftOperator', 'ResellerAdmin'] $identity_roles_addons = ['SwiftOperator', 'ResellerAdmin']
$keystone_db_allowed_hosts = $db_allowed_hosts $keystone_db_allowed_hosts = $db_allowed_hosts

View File

@@ -18,7 +18,9 @@
# Installs the private cloud system requirements # Installs the private cloud system requirements
# #
class cloud { class cloud(
$rhn_registration = $os_params::rhn_registration,
) {
if ! ($::osfamily in [ 'RedHat', 'Debian' ]) { if ! ($::osfamily in [ 'RedHat', 'Debian' ]) {
fail("module puppet-cloud only support ${::osfamily}, only Red Hat or Debian") fail("module puppet-cloud only support ${::osfamily}, only Red Hat or Debian")
@@ -70,4 +72,9 @@ This node is under the control of Puppet ${::puppetversion}.
enable => true enable => true
} }
if $::osfamily == 'RedHat' and $rhn_registration {
create_resources('rhn_register', {
"${::hostname}" => $rhn_registration
} )
}
} }

View File

@@ -77,10 +77,17 @@ describe 'cloud' do
let :facts do let :facts do
{ :osfamily => 'RedHat', { :osfamily => 'RedHat',
:concat_basedir => '/var/lib/puppet/concat', :concat_basedir => '/var/lib/puppet/concat',
:puppetversion => '3.3' } :puppetversion => '3.3',
:hostname => 'redhat1' }
end
let :params do
{ :rhn_registration => { "username" => "rhn", "password" => "pass" } }
end end
# it_configures 'private cloud node' # it_configures 'private cloud node'
it { should contain_rhn_register('redhat1') }
end end
context 'on other platforms' do context 'on other platforms' do