Xilonz / trellis-backup-role

Ansible backup role to use with trellis. Works with s3, FTP, local disk...
63 stars 9 forks source link

Error Provisioning a Trellis site #4

Closed smaboshe closed 7 years ago

smaboshe commented 7 years ago

While setting up trellis-backup-role on a test site, I get the following error during provisioning:

TASK [trellis-backup : List backup jobs] ***************************************
 [WARNING]: when statements should not include jinja2 templating delimiters
such as {{ }} or {% %}. Found: {{ item.value.backup is defined and
item.value.backup.enabled | default(false) }}

System info:
  Ansible 2.3.2.0; Vagrant 1.9.7; Linux
  Trellis at "Option to install WP-CLI packages"
---------------------------------------------------
the field 'args' has an invalid value, which appears to include a variable
that is undefined. The error was: 'dict object' has no attribute
'backup_target_user'

The error appears to have been in '/home/silumesii/sites/example.com/trellis/vendor/roles/trellis-backup/tasks/main.yml': line
15, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: List backup jobs
  ^ here

fatal: [default]: FAILED! => {"failed": true}

Additional background is available on the Roots forum.

Any idea what might be happening here?

robyurkowski commented 7 years ago

@smaboshe Yeah, it's not super well documented yet, but you need to set up some backup information within wordpress_sites.yml or vault.yml. The above error is basically just saying you don't have a backup_target_user key.

What you need is something like this in your vault:

vault_wordpress_sites:`
  <site domain>:
    env:
      db_password: #...
      # ...

      backup_target_user: ""
      backup_target_pass: ""

If you're using S3, you need to specify your access key as the user and secret as the pass.

I'll try to do a PR with these documentation details soon.

jillro commented 7 years ago

I guess I forgot to put it in the doc as I had only been using myself with SSH and public key. A commit containing the document has been merge, thank you.