Provision fails on nginx reload in wordpress-setup task

Nginx doesn’t reload when it is being notified as the last step in the wordpress-setup task when I try to provision my production machine. Based on the error message it looks like nginx isn’t even running? Any thoughts on what might cause this?

NOTIFIED: [common | reload nginx] *********************************************
failed: [ip-of-production-machine] => {"failed": true}
msg: reload: Job is not running: nginx

The task is run here: https://github.com/roots/bedrock-ansible/blob/master/roles/wordpress-setup/tasks/nginx.yml#L28

Here are my production variables with sensitive info stripped out:

mysql_root_password: XYZ

github_ssh_keys:
  - username: XYZ
    authorized:
      - "{{ web_user }}"

project_pre_build_commands_local:
   - path: "{{ project.local_path }}/web/app/themes/brostroms"
     cmd: npm install
   - path: "{{ project.local_path }}/web/app/themes/brostroms"
     cmd: bower install
   - path: "{{ project.local_path }}/web/app/themes/brostroms"
     cmd: gulp --production

project_local_files:
  - name: compiled theme assets
    src: "{{ project.local_path }}/web/app/themes/brostroms/dist"
    dest: web/app/themes/brostroms

wordpress_sites:
  brostroms150.se:
    site_hosts:
      - brostroms150.se
    local_path: '../site' # path targeting local Bedrock site directory (relative to Ansible root)
    repo: git@bitbucket.org:poggen/brostroms150.se.git
    branch: master
    multisite:
      enabled: false
      subdomains: false
    ssl:
      enabled: false
    system_cron: true
    env:
      wp_home: http://brostroms150.se
      wp_siteurl: http://brostroms150.se/wp
      wp_env: production
      db_name: XYZ
      db_user: XYZ
      db_password: XYZ
      # Generate your keys here: https://api.wordpress.org/secret-key/1.1/salt/
      auth_key: "XYZ"
      auth_salt: "XYZ"
      logged_in_key: "XYZ"
      logged_in_salt: "XYZ"
      nonce_key: "XYZ"
      nonce_salt: "XYZ"
      secure_auth_key: "XYZ"
      secure_auth_salt: "XYZ"

Does this always happen? And there were no errors previous to this?

I’ve never seen it myself or from anyone else before. Doesn’t mean it’s not a bug though.

Your production server was stock Ubuntu 14.04?

First time I’ve encountered it as well. I’ve tried to run the provision command a couple of more times (tried again just now) and it always stops at this stage.

Server is a stock Ubuntu 14.04 @ Digital Ocean.

Is there a way to verify that nginx is running earlier in the provisioning process? It doesn’t look like there’s a specific task for explicitly starting the nginx service, or am I missing something?

TASK: [nginx | Add Nginx PPA] *************************************************
ok: [ip]

TASK: [nginx | Install Nginx] *************************************************
ok: [ip]

TASK: [nginx | Grab h5bp/server-configs-nginx] ********************************
ok: [ip]

TASK: [nginx | Copy over h5bp configuration] **********************************
changed: [ip] => (item=mime.types)
changed: [ip] => (item=h5bp/)

TASK: [nginx | Copy SSL conf files] *******************************************
ok: [ip] => (item=/Users/Oscar/Sites/brostroms150.se/ansible/roles/nginx/files/ssl-stapling.conf)
ok: [ip] => (item=/Users/Oscar/Sites/brostroms150.se/ansible/roles/nginx/files/ssl.conf)

TASK: [nginx | Create nginx.conf] *********************************************
ok: [ip]

TASK: [nginx | Disable default server] ****************************************
ok: [ip]

TASK: [nginx | Enable better default site to drop unknown requests] ***********
changed: [ip]

TASK: [nginx | Create base WordPress config] **********************************
ok: [ip]

OK, my bad - I’d accidentally created a LAMP droplet instead of a vanilla 14.04 machine… Sorry for the inconvenience.

No problem, glad it you got it sorted.