Puppet Class: profile::openstack::base::observerenv
- Defined in:
- modules/profile/manifests/openstack/base/observerenv.pp
Overview
SPDX-License-Identifier: Apache-2.0 Access credentials for the keystone 'novaobserver' account
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'modules/profile/manifests/openstack/base/observerenv.pp', line 3
class profile::openstack::base::observerenv(
String $region = lookup('profile::openstack::base::region'),
Stdlib::Fqdn $keystone_api_fqdn = lookup('profile::openstack::base::keystone_api_fqdn'),
String $os_user = lookup('profile::openstack::base::observer_user'),
String $os_password = lookup('profile::openstack::base::observer_password'),
String $os_project = lookup('profile::openstack::base::observer_project'),
) {
$root_clouds_file = '/root/.config/openstack/clouds.yaml'
wmflib::dir::mkdir_p($root_clouds_file.dirname.dirname, {'mode' => '0700'})
wmflib::dir::mkdir_p($root_clouds_file.dirname, {'mode' => '0700'})
concat { $root_clouds_file:
mode => '0400',
show_diff => false,
}
concat::fragment { 'root_clouds_file_header':
target => $root_clouds_file,
order => '01',
content => "clouds:\n",
}
$clouds_file = '/etc/openstack/clouds.yaml'
ensure_resource('file', $clouds_file.dirname, { 'ensure' => 'directory',
'mode' => '0755' })
concat { $clouds_file:
mode => '0444',
show_diff => false,
}
concat::fragment { 'observer_clouds_file_header':
target => $clouds_file,
order => '01',
content => inline_template('<%= "clouds:" + "\n" %>'),
}
openstack::util::envscript { 'novaobserver':
region => $region,
keystone_api_fqdn => $keystone_api_fqdn,
keystone_api_port => 25000,
keystone_api_interface => 'public',
os_user => $os_user,
os_password => $os_password,
os_project => $os_project,
os_project_domain_id => 'default',
os_user_domain_id => 'default',
scriptpath => '/usr/local/bin/observerenv.sh',
yaml_mode => '0444',
clouds_files => [$clouds_file, $root_clouds_file],
}
openstack::util::envscript { 'ossystemobserver':
region => $region,
keystone_api_fqdn => $keystone_api_fqdn,
keystone_api_port => 25000,
keystone_api_interface => 'public',
os_user => $os_user,
os_password => $os_password,
os_project_domain_id => 'default',
os_user_domain_id => 'default',
scriptpath => '/usr/local/bin/osobserverenv.sh',
yaml_mode => '0444',
clouds_files => [$clouds_file, $root_clouds_file],
os_system_scope => 'all',
}
}
|