Remove POSIX users, groups, and file modes.

This patch removes File resources which should be delivered by packaging
tools.  These resources (files, directories, modes, users, and group
attributes) could be in conflict with different OS packaging systems
which isn't a desired result.

Co-Authored-By: Ivan Berezovskiy <iberezovskiy@mirantis.com>

Closes-Bug: #1458915

Change-Id: I02fe8cc99dcd56e16ac66136a0da244a1eeb630b
This commit is contained in:
Drew Fisher 2015-08-11 08:28:45 -06:00 committed by Mykyta Karpin
parent cda71192de
commit 637f986252
5 changed files with 8 additions and 62 deletions

View File

@ -302,7 +302,6 @@ class glance::api(
)
}
Package[$glance::params::api_package_name] -> File['/etc/glance/']
Package[$glance::params::api_package_name] -> Class['glance::policy']
# adding all of this stuff b/c it devstack says glance-api uses the
@ -312,15 +311,6 @@ class glance::api(
Class['glance::policy'] ~> Service['glance-api']
Service['glance-api'] ~> Glance_image<||>
File {
ensure => present,
owner => 'glance',
group => 'glance',
mode => '0640',
notify => Service['glance-api'],
require => Class['glance']
}
# basic service config
glance_api_config {
'DEFAULT/bind_host': value => $bind_host;
@ -428,15 +418,6 @@ class glance::api(
}
}
resources { 'glance_api_config':
purge => $purge_config,
}
file { ['/etc/glance/glance-api.conf',
'/etc/glance/glance-api-paste.ini',
'/etc/glance/glance-cache.conf']:
}
if $manage_service {
if $enabled {
$service_ensure = 'running'

View File

@ -15,13 +15,6 @@ class glance(
include ::glance::params
file { '/etc/glance/':
ensure => directory,
owner => 'glance',
group => 'root',
mode => '0770',
}
if ( $glance::params::api_package_name == $glance::params::registry_package_name ) {
package { $::glance::params::api_package_name :
ensure => $package_ensure,

View File

@ -203,19 +203,8 @@ class glance::registry(
)
}
Package[$glance::params::registry_package_name] -> File['/etc/glance/']
Glance_registry_config<||> ~> Service['glance-registry']
File {
ensure => present,
owner => 'glance',
group => 'glance',
mode => '0640',
notify => Service['glance-registry'],
require => Class['glance']
}
glance_registry_config {
'DEFAULT/workers': value => $workers;
'DEFAULT/bind_host': value => $bind_host;
@ -278,14 +267,6 @@ class glance::registry(
}
}
resources { 'glance_registry_config':
purge => $purge_config
}
file { ['/etc/glance/glance-registry.conf',
'/etc/glance/glance-registry-paste.ini']:
}
if $sync_db {
include ::glance::db::sync
}
@ -306,7 +287,6 @@ class glance::registry(
enable => $enabled,
hasstatus => true,
hasrestart => true,
subscribe => File['/etc/glance/glance-registry.conf'],
require => Class['glance'],
tag => 'glance-service',
}

View File

@ -61,15 +61,14 @@ describe 'glance::registry' do
it { is_expected.to contain_class 'glance::registry::db' }
it { is_expected.to contain_class 'glance::registry::logging' }
it { is_expected.to contain_service('glance-registry').with(
'ensure' => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running' : 'stopped',
'enable' => param_hash[:enabled],
'hasstatus' => true,
'hasrestart' => true,
'subscribe' => 'File[/etc/glance/glance-registry.conf]',
'require' => 'Class[Glance]',
'tag' => 'glance-service',
)}
it { is_expected.to contain_service('glance-registry').with(
'ensure' => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running' : 'stopped',
'enable' => param_hash[:enabled],
'hasstatus' => true,
'hasrestart' => true,
'require' => 'Class[Glance]',
'tag' => 'glance-service',
)}
it 'is_expected.to not sync the db if sync_db is set to false' do
@ -126,7 +125,6 @@ describe 'glance::registry' do
'enable' => false,
'hasstatus' => true,
'hasrestart' => true,
'subscribe' => 'File[/etc/glance/glance-registry.conf]',
'require' => 'Class[Glance]',
'tag' => 'glance-service',
)}

View File

@ -10,12 +10,6 @@ describe 'glance' do
describe "when using default class parameters" do
let(:params) { default_params }
it { is_expected.to contain_file('/etc/glance/').with(
'ensure' => 'directory',
'owner' => 'glance',
'mode' => '0770'
)}
it { is_expected.to contain_package('python-openstackclient').with(
:tag => 'openstack'
)}