Andrew Bogott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/216296

Change subject: Fixup the glance image cron
......................................................................

Fixup the glance image cron

Change-Id: I0be79f6d0ae94234444666a7ae8c33492e95fe41
---
M modules/openstack/manifests/glance/service.pp
1 file changed, 31 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/96/216296/1

diff --git a/modules/openstack/manifests/glance/service.pp 
b/modules/openstack/manifests/glance/service.pp
index dddda8d..c2e76d6 100644
--- a/modules/openstack/manifests/glance/service.pp
+++ b/modules/openstack/manifests/glance/service.pp
@@ -60,28 +60,45 @@
     $spare_glance_host = hiera('labs_nova_controller_spare')
     # Set up a keypair and rsync image files between the main glance server
     #  and the spare.
-    ssh::userkey { 'glance':
-        require => Package['glance'],
+    user { 'glancesync':
+        ensure     => present,
+        name       => 'glancesync'
+        shell      => '/bin/sh',
+        comment    => 'glance rsync user',
+        gid        => 'glance',
+        managehome => true,
+        require    => Package['glance'],
+    }
+
+    ssh::userkey { 'glancesync':
+        require => user['glancesync'],
         ensure  => present,
-        source  => 'puppet:///private/ssh/glance/glance.pub',
+        source  => 'puppet:///private/ssh/glancesync/glancesync.pub',
     }
-    file { '/var/lib/glance/.ssh':
+    file { '/home/glancesync/.ssh':
         ensure  => directory,
-        owner   => 'glance',
-        group   => 'glance',
+        owner   => 'glancesync',
+        group   => 'glancesync',
         mode    => '0700',
-        require => Package['glance'],
+        require => user['glancesync'],
     }
-    file { '/var/lib/glance/.ssh/id_rsa':
-        source  => 'puppet:///private/ssh/glance/glance.key',
-        owner   => 'glance',
-        group   => 'glance',
+    file { '/var/lib/glancesync/.ssh/id_rsa':
+        source  => 'puppet:///private/ssh/glancesync/glancesync.key',
+        owner   => 'glancesync',
+        group   => 'glancesync',
         mode    => '0600',
-        require => File['/var/lib/glance/.ssh'],
+        require => File['/var/lib/glancesync/.ssh'],
     }
     cron { 'rsync_glance_images':
-        command     => "/usr/bin/rsync -aS ${image_datadir} 
${spare_glance_host}:${image_datadir}",
+        command     => "/usr/bin/rsync -aS ${image_datadir}/* 
${spare_glance_host}:${image_datadir}/",
         minute      => 15,
-        user        => 'glance',
+        user        => 'glancesync',
+        require => user['glancesync'],
+    }
+    cron { 'rsync_chown_images':
+        command     => "chown -R glance ${image_datadir}/*",
+        minute      => 30,
+        user        => 'root',
+        require     => cron['rsync_glance_images'],
     }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/216296
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0be79f6d0ae94234444666a7ae8c33492e95fe41
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to