From b5843bf8721ff62540ccbbfe98e74a63ccfa9105 Mon Sep 17 00:00:00 2001 From: Dheeraj Gautam Date: Wed, 10 Aug 2016 16:32:06 -0700 Subject: [PATCH] SM-Storage: create ceph user/group and use latest package resource Partial Bug: #1609619 Partial Bug: #1611446 With current version of ceph, uses ceph:ceph instead of root:root. This causes ceph-mon to fail to come up and provisioning gets stuck. ensure latest for contrail-storage package instead of present. This will install latest version for package available. PATCH 2: add ceph:ceph for /var/lib/ceph and directory/files under /var/lib/ceph. This is needed for mitaka Change-Id: Id317d8d00d05deb2196f3f710d0af33ee3aeccc5 --- contrail/environment/modules/ceph/manifests/mon.pp | 3 +++ contrail/environment/modules/contrail/manifests/common.pp | 5 ++++- .../modules/contrail/manifests/lib/storage_common.pp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contrail/environment/modules/ceph/manifests/mon.pp b/contrail/environment/modules/ceph/manifests/mon.pp index 91fd1298..68277acd 100644 --- a/contrail/environment/modules/ceph/manifests/mon.pp +++ b/contrail/environment/modules/ceph/manifests/mon.pp @@ -130,12 +130,15 @@ mon_data=\$(ceph-mon ${cluster_option} --id ${id} --show-config-value mon_data) if [ ! -d \$mon_data ] ; then mkdir -p \$mon_data + chown -h ceph:ceph \$mon_data if ceph-mon ${cluster_option} \ + --setuser ceph --setgroup ceph \ ${public_addr_option} \ --mkfs \ --id ${id} \ --keyring ${keyring_path} ; then touch \$mon_data/done \$mon_data/${init} \$mon_data/keyring + chown -h ceph:ceph \$mon_data/done \$mon_data/${init} \$mon_data/keyring else rm -fr \$mon_data fi diff --git a/contrail/environment/modules/contrail/manifests/common.pp b/contrail/environment/modules/contrail/manifests/common.pp index 44bd2e88..6969723c 100644 --- a/contrail/environment/modules/contrail/manifests/common.pp +++ b/contrail/environment/modules/contrail/manifests/common.pp @@ -40,13 +40,16 @@ $contrail_group_details = { 'nova' => { gid => '499'}, 'kvm' => { gid => '498'}, - 'libvirtd' => { gid => '497'} + 'libvirtd' => { gid => '497'}, + 'ceph' => { gid => '496'} } $contrail_users_details = { 'nova' => { ensure => present, uid => '499', gid => '499', home => '/var/lib/nova' , managehome => true}, 'libvirt-qemu' => { ensure => present, uid => '498', gid => '498', home => '/var/lib/libvirt', managehome => true}, 'libvirt-dnsmasq' => { ensure => present, uid => '497', gid => '497', home => '/var/lib/libvirt/dnsmasq', managehome => true}, + 'ceph' => { ensure => present, uid => '496', gid => '496', home => '/var/lib/ceph', managehome => true}, } + create_resources(group, $contrail_group_details) create_resources(user, $contrail_users_details) diff --git a/contrail/environment/modules/contrail/manifests/lib/storage_common.pp b/contrail/environment/modules/contrail/manifests/lib/storage_common.pp index ed62d700..5a7be1c6 100644 --- a/contrail/environment/modules/contrail/manifests/lib/storage_common.pp +++ b/contrail/environment/modules/contrail/manifests/lib/storage_common.pp @@ -29,7 +29,7 @@ contrail::lib::report_status { 'storage_started': state => 'storage_started' } -> - package { 'contrail-storage' : ensure => present, } + package { 'contrail-storage' : ensure => latest, } -> file { 'contrail-storage-rest-api.conf': ensure => present,