Skip to content

Commit

Permalink
Merge pull request #381 from etiennedub/fix_quota
Browse files Browse the repository at this point in the history
Fix quota exec command
  • Loading branch information
cmd-ntrf authored Sep 24, 2024
2 parents d3c20f5 + 5ad3f88 commit c1aae73
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion site/profile/manifests/volumes.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
class profile::volumes (
Hash[String, Hash[String, Hash]] $devices,
) {

file { '/etc/xfs_quota':
ensure => 'directory',
}

if $devices =~ Hash[String, Hash[String, Hash]] {
package { 'lvm2':
ensure => installed,
Expand Down Expand Up @@ -166,11 +171,19 @@
}

if $filesystem == 'xfs' and $quota {
# Save the xfs quota setting to avoid applying at every iteration
file { "/etc/xfs_quota/${volume_tag}-${volume_name}":
ensure => 'file',
content => "#FILE TRACKED BY PUPPET DO NOT EDIT MANUALLY\n${quota}",
require => File['/etc/xfs_quota']
}

exec { "apply-quota-${name}":
command => "xfs_quota -x -c 'limit bsoft=${quota} bhard=${quota} -d' /mnt/${name}",
command => "xfs_quota -x -c 'limit bsoft=${quota} bhard=${quota} -d' /mnt/${volume_tag}/${volume_name}",
require => Mount["/mnt/${volume_tag}/${volume_name}"],
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'],
refreshonly => true,
subscribe => [File["/etc/xfs_quota/${volume_tag}-${volume_name}"]],
}
}
}

0 comments on commit c1aae73

Please sign in to comment.