Skip to content

Commit

Permalink
Merge pull request #560 from wyardley/permissions_changes
Browse files Browse the repository at this point in the history
Update file / directory permissions
  • Loading branch information
hunner committed Aug 17, 2017
2 parents 58cb3a6 + 869bc94 commit a365f4f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
20 changes: 10 additions & 10 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,23 @@
ensure => directory,
owner => '0',
group => '0',
mode => '0644',
mode => '0755',
}
file { '/etc/rabbitmq/ssl':
ensure => directory,
owner => '0',
group => '0',
mode => '0644',
mode => '0755',
}
file { 'rabbitmq.config':
ensure => file,
path => $config_path,
content => template($config),
owner => '0',
group => '0',
mode => '0644',
group => $rabbitmq_group,
mode => '0640',
notify => Class['rabbitmq::service'],
}
Expand All @@ -141,8 +141,8 @@
path => $env_config_path,
content => template($env_config),
owner => '0',
group => '0',
mode => '0644',
group => $rabbitmq_group,
mode => '0640',
notify => Class['rabbitmq::service'],
}
Expand All @@ -151,8 +151,8 @@
path => $inetrc_config_path,
content => template($inetrc_config),
owner => '0',
group => '0',
mode => '0644',
group => $rabbitmq_group,
mode => '0640',
notify => Class['rabbitmq::service'],
}
Expand All @@ -162,8 +162,8 @@
path => '/etc/rabbitmq/rabbitmqadmin.conf',
content => template('rabbitmq/rabbitmqadmin.conf.erb'),
owner => '0',
group => '0',
mode => '0644',
group => $rabbitmq_group,
mode => '0640',
require => File['/etc/rabbitmq'],
}
}
Expand Down
3 changes: 2 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$package_provider = $rabbitmq::package_provider
$package_require = $rabbitmq::package_require
$package_source = $rabbitmq::real_package_source
$rabbitmq_group = $rabbitmq::rabbitmq_group

package { 'rabbitmq-server':
ensure => $package_ensure,
Expand All @@ -26,7 +27,7 @@
file { $rabbitmq::environment_variables['MNESIA_BASE']:
ensure => 'directory',
owner => 'root',
group => 'rabbitmq',
group => $rabbitmq_group,
mode => '0775',
require => Package['rabbitmq-server'],
}
Expand Down
9 changes: 7 additions & 2 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,17 @@

describe 'manages configuration directory correctly' do
it { should contain_file('/etc/rabbitmq').with(
'ensure' => 'directory'
'ensure' => 'directory',
'mode' => '0755'
)}
end

describe 'manages configuration file correctly' do
it { should contain_file('rabbitmq.config') }
it { should contain_file('rabbitmq.config').with(
'owner' => '0',
'group' => 'rabbitmq',
'mode' => '0640'
)}
end

context 'configures config_cluster' do
Expand Down

0 comments on commit a365f4f

Please sign in to comment.