Deploy Hanging on WP Cron Setup

Hi Guys, I am hoping you can help me, I have my site running locally on my machine absolutely fine, I have come to upload this onto my server which is an ubuntu server on the AWS Lightsail service. My issue is that the deploy is halting when it comes to setting up the WP System Cron Please see the error I receive below.

TASK [wordpress-setup : Setup WP system cron] **********************************************************
System info:
  Ansible 2.4.3.0; Darwin
  Trellis at "Bump Ansible `version_tested_max` to 2.4.3.0"
---------------------------------------------------
The task includes an option with an undefined variable. The error was: 'None'
has no attribute 'enabled'


The error appears to have been in 'myLocalSitePath/trellis/roles
/wordpress-setup/tasks/main.yml': line 45, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Setup WP system cron
  ^ here

exception type: <class 'ansible.errors.AnsibleUndefinedVariable'>
exception: 'None' has no attribute 'enabled'
fatal: [52.203.19.96]: FAILED! => {}

Why would Ansible be failing here, any help you can give would be great.

Thanks.
Luke

My best guess is that your multisite definition in group_vars/<env>/wordpress_sites.yml appears as

  ...
  branch: master
  multisite:
  ssl:
    enabled: false
  ...

but needs to be this:

  ...
  branch: master
  multisite:
+   enabled: false
  ssl:
    enabled: false
  ...

Ansible interprets a definition varname: <blank> as None but Trellis sets up and uses multisite as a dictionary with the enabled attribute. So if you see exception: 'None' has no attribute 'enabled' it likely means that the task doesn’t know what to do with item.value.multisite.enabled because item.value.multisite is None and has no attribute enabled.

If adding enabled to the multisite definition doesn’t resolve it, could you post the contents for your relevant group_vars/<env>/wordpress_sites.yml?

Edit: Added space, correcting each enabled:false to be enabled: false

1 Like

Thank you very much for your help, sorry for not coming back sooner, I am still having some issues deploying to my staging server, I will post the errors that I am getting shortly if you are able to help at all that would be great.

Kind Regards
Luke