diff --git a/modules/openstack_project/manifests/gerrit.pp b/modules/openstack_project/manifests/gerrit.pp index af41884579..d7d8cb556c 100644 --- a/modules/openstack_project/manifests/gerrit.pp +++ b/modules/openstack_project/manifests/gerrit.pp @@ -415,11 +415,14 @@ class openstack_project::gerrit ( require => Class['::gerrit'], } cron { 'mirror_repack': + ensure => absent, + } + cron { 'mirror_gitgc': user => 'gerrit2', weekday => '0', hour => '4', minute => '7', - command => "find ${local_git_dir} -type d -name \"*.git\" -print -exec git --git-dir=\"{}\" repack -afd \\;", + command => "find ${local_git_dir} -type d -name \"*.git\" -print -exec git --git-dir=\"{}\" gc \\;", environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', } } diff --git a/modules/openstack_project/manifests/git_backend.pp b/modules/openstack_project/manifests/git_backend.pp index 9b2b17aaf2..8cf1a13f3d 100644 --- a/modules/openstack_project/manifests/git_backend.pp +++ b/modules/openstack_project/manifests/git_backend.pp @@ -118,10 +118,14 @@ class openstack_project::git_backend ( } cron { 'mirror_repack': + ensure => absent, + } + + cron { 'mirror_gitgc': user => 'cgit', hour => '4', minute => '7', - command => 'find /var/lib/git/ -not -path /var/lib/git/zuul -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \; -exec git --git-dir="{}" pack-refs --all \;', + command => 'find /var/lib/git/ -not -path /var/lib/git/zuul -type d -name "*.git" -print -exec git --git-dir="{}" gc \;', environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', require => User['cgit'], } @@ -202,12 +206,12 @@ class openstack_project::git_backend ( ensure => absent, } - cron { 'mirror_repack_zuul': + cron { 'mirror_gitgc_zuul': user => 'zuul', weekday => '0', hour => '4', minute => '7', - command => 'find /var/lib/git/zuul -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \; -exec git --git-dir="{}" pack-refs --all \;', + command => 'find /var/lib/git/zuul -type d -name "*.git" -print -exec git --git-dir="{}" git gc \;', environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', require => User['zuul'], }