Skip to content

Commit

Permalink
Partial-Bug: #1418163
Browse files Browse the repository at this point in the history
    Address the password problems seen when openstack and compute are on different servers.
    Code was incorrectly using service_token as admin password.

Change-Id: Ie801467698e395075cc96cdfe042c41cf3646a09
  • Loading branch information
ajoshi9 committed Feb 6, 2015
1 parent b43494e commit 55dc529
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
33 changes: 23 additions & 10 deletions contrail/environment/modules/contrail/manifests/compute.pp
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,20 @@
provider => shell,
logoutput => "true"

} ->
exec { "fix-neutron-admin-password" :
command => "openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_password $keystone_admin_password && echo fix-neutron-admin-password >> /etc/contrail/contrail_compute_exec.out",
unless => "grep -qx fix-neutron-admin-password /etc/contrail/contrail_compute_exec.out",
provider => shell,
logoutput => "true"

} ->
exec { "fix-keystone-admin-password" :
command => "openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password $keystone_admin_password && echo fix-keystone-admin-password >> /etc/contrail/contrail_compute_exec.out",
unless => "grep -qx fix-keystone-admin-password /etc/contrail/contrail_compute_exec.out",
provider => shell,
logoutput => "true"

}

# Now reboot the system
Expand All @@ -578,23 +592,22 @@
before => Exec["reboot-server"],
unless => "grep -qx cp-ifcfg-file /etc/contrail/contrail_compute_exec.out",
provider => "shell",
require => Exec["setup-compute-server-setup"],
require => Exec["fix-keystone-admin-password"],
logoutput => 'true'
}
}
contrail::lib::report_status { "compute_completed": state => "compute_completed" }->
file { "/etc/contrail/interface_renamed" :
ensure => present,
mode => 0644,
content => "2"
} ->
exec { "reboot-server" :
command => "echo reboot-server-2 >> /etc/contrail/contrail_compute_exec.out && reboot",
unless => ["grep -qx reboot-server-2 /etc/contrail/contrail_compute_exec.out"],
require => Exec["setup-compute-server-setup"],
require => Exec["fix-keystone-admin-password"],
provider => "shell",
logoutput => 'true'
} ->
file { "/etc/contrail/interface_renamed" :
ensure => present,
mode => 0644,
content => "2"
}
contrail::lib::report_status { "compute_completed": state => "compute_completed" }

}
}
}
15 changes: 7 additions & 8 deletions contrail/environment/modules/contrail/manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,14 @@
# (optional) - Defaults to "" (use openstack_ip). UI parameter.
#
# [*keystone_admin_password*]
# Admin password for keystone service. Manifests also use keystone_admin_token
# to refer to this and hence is set to same value in this class.
# Admin password for keystone service.
# (optional) - Defaults to "contrail123". UI parameter.
#
# [*keystone_service_token*]
# Service token to access keystone service (MD5 hash generated). If not specified
# simple value of "keystoneservicetoken" used.
# to refer to this and hence is set to same value in this class.
# (optional) - Defaults to "contrailservicetoken".
# simple value of "contrail123" used. Manifests also use
# keystone_admin_token to refer to this and hence is set to same value in this class.
# (optional) - Defaults to "contrail123".
#
# [*keystone_admin_user*]
# User Name for admin user of keystone service.
Expand Down Expand Up @@ -449,7 +448,7 @@
$ssd_data_dir = "",
$keystone_ip = "",
$keystone_admin_password = "contrail123",
$keystone_service_token = "c0ntrail123",
$keystone_service_token = "contrail123",
$keystone_admin_user = "admin",
$keystone_admin_tenant = "admin",
$keystone_service_tenant = "services",
Expand Down Expand Up @@ -513,9 +512,9 @@
$external_bgp = "",
$contrail_plugin_location = "NEUTRON_PLUGIN_CONFIG=\'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini\'"
) {
# Manifests use keystone_admin_token to refer to keystone_admin_password too. Hence set
# Manifests use keystone_admin_token to refer to keystone_service_token too. Hence set
# that varible here.
$keystone_admin_token = $keystone_admin_password
$keystone_admin_token = $keystone_service_token

if (($contrail_internal_vip != "") or
($internal_vip != "") or
Expand Down

0 comments on commit 55dc529

Please sign in to comment.