From 3ed43ca05f8e5345fb0a80f4e49a75f3bb17bb97 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 28 Mar 2015 12:02:22 -0400 Subject: [PATCH] Add a clouds.yaml file in anticipation of shade As we move to using shade through nodepool, several things can consume clouds.yaml via os-client-config. ansible openstack modules can also read the file, as well as python-openstackclient. SO - if we start putting clouds.yaml files places, then we can opt in to using it instead of directories full of shell script env vars. Change-Id: If25ee14f06a4530da4779e062b1ad46238e44f2e --- .../manifests/nodepool_prod.pp | 31 +++++++++++++++++++ .../templates/nodepool/clouds.yaml.erb | 21 +++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 modules/openstack_project/templates/nodepool/clouds.yaml.erb diff --git a/modules/openstack_project/manifests/nodepool_prod.pp b/modules/openstack_project/manifests/nodepool_prod.pp index f2d0742af0..936c319bff 100644 --- a/modules/openstack_project/manifests/nodepool_prod.pp +++ b/modules/openstack_project/manifests/nodepool_prod.pp @@ -24,6 +24,7 @@ class openstack_project::nodepool_prod( $image_log_document_root = '/var/log/nodepool/image', $enable_image_log_via_http = true, $project_config_repo = '', + $clouds_yaml_template = 'openstack_project/nodepool/clouds.yaml.erb', ) { class { 'openstack_project::server': sysadmins => $sysadmins, @@ -59,4 +60,34 @@ class openstack_project::nodepool_prod( User['nodepool'], ], } + + file { '/home/nodepool/.config': + ensure => directory, + owner => 'nodepool', + group => 'nodepool', + require => [ + User['nodepool'], + ], + } + + file { '/home/nodepool/.config/openstack': + ensure => directory, + owner => 'nodepool', + group => 'nodepool', + require => [ + File['/home/nodepool/.config'], + ], + } + + file { '/home/nodepool/.config/openstack/clouds.yaml': + ensure => present, + owner => 'nodepool', + group => 'nodepool', + mode => '0400', + content => template($clouds_yaml_template), + require => [ + File['/home/nodepool/.config/openstack'], + User['nodepool'], + ], + } } diff --git a/modules/openstack_project/templates/nodepool/clouds.yaml.erb b/modules/openstack_project/templates/nodepool/clouds.yaml.erb new file mode 100644 index 0000000000..6531d675c4 --- /dev/null +++ b/modules/openstack_project/templates/nodepool/clouds.yaml.erb @@ -0,0 +1,21 @@ +clouds: + rax: + cloud: rackspace + region_name: DFW,ORD,IAD + auth: + username: '<%= rackspace_username %>' + password: '<%= rackspace_password %>' + project-id: '<%= rackspace_project %>' + hpcloud: + cloud: hp + region_name: region-a.geo-1,region-b.geo-1 + auth: + username: '<%= hpcloud_username %>' + password: '<%= hpcloud_password %>' + project-id: '<%= hpcloud_project %>' + tripleo-test-cloud-rh1: + auth: + username: '<%= tripleo_username %>' + password: '<%= tripleo_password %>' + project-id: '<%= tripleo_project %>' + auth-url: 'https://ci-overcloud.rh1.tripleo.org:13000/v2.0'