---

govuk::safe_to_reboot::can_reboot: 'no'
govuk::safe_to_reboot::reason: 'Mounted by backend machines, causes attachment delivery failures'

govuk_sudo::sudo_conf:
  deploy_assets_rsync:
    content: 'deploy ALL=(assets) NOPASSWD:/usr/bin/rsync --server -vlogDtprze.iLsf --delete . /mnt/uploads'

lv:
  data:
    pv:
        - '/dev/sdb1'
        - '/dev/sdc1'
    vg: 'uploads'

mount:
  /mnt/uploads:
    disk: '/dev/mapper/uploads-data'
    govuk_lvm: 'data'
    mountoptions: 'defaults'
    percent_threshold_warning: 5
    percent_threshold_critical: 2

---

govuk::safe_to_reboot::can_reboot: 'no'
govuk::safe_to_reboot::reason: 'Mounted by backend machines, causes attachment delivery failures'

govuk_sudo::sudo_conf:
  deploy_assets_rsync:
    content: 'deploy ALL=(assets) NOPASSWD:/usr/bin/rsync --server -vlogDtprze.iLs --delete . /mnt/uploads'

lv:
  data:
    pv:
        - '/dev/sdb1'
        - '/dev/sdc1'
    vg: 'uploads'

mount:
  /mnt/uploads:
    disk: '/dev/mapper/uploads-data'
    govuk_lvm: 'data'
    mountoptions: 'defaults'
    percent_threshold_warning: 5
    percent_threshold_critical: 2

Fix asset data sync rsync options
Fix asset data sync rsync options

During migrating machines to Carrenza we have 
upgraded to Trusty 14.04 from Precise 12.04.
The rsync package has been bumped from version
3.0.9 to version 3.1.0 in Trusty.

We are very specific in the rsync command that the
deploy user can run as the assets user.

Since migrating the nightly env-sync-backup job 
has always failed on sync’ing assets with the 
following:

```
2015-10-07T04:36:29Z: [assets] sudo: no tty present and no askpass program specified
2015-10-07T04:36:29Z: [assets] rsync: connection unexpectedly closed (0 bytes received so far) [sender]
2015-10-07T04:36:29Z: [assets] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.0]
```

Looking in `/var/log/auth.log` on asset-master-1 
we see:

```
Oct 13 04:40:00 asset-master-1.backend sudo:   deploy : command not allowed ; TTY=unknown ; PWD=/home/deploy ; USER=assets ; COMMAND=/usr/bin/rsync --server -vlogDtprze.iLs --delete . /mnt/uploads
```

The new 3.1.0 package doesn’t use the `-f` option
by default and hence isn’t matching what we allow 
to be run in the sudoers file. Deleting this
option from the sudoers file allows the rsync
command to run, and the sync assets job to 
succeed. 

There are open bugs in launchpad for similar 
incompatibility issues between rsync 3.1.0 and 
rsync 3.0.9