Lack of remote server setup variables

After a new trellis install I do vagrant up and works fine. When I try to set up remote server with:

ansible-playbook server.yml -e env=staging

I get:

PLAY [Ensure necessary variables are defined] **********************************

TASK [Ensure environment is defined] *******************************************
skipping: [localhost]

PLAY [Determine Remote User] ***************************************************
skipping: no hosts matched

PLAY [WordPress Server - Install LEMP Stack with PHP 7.0 and MariaDB MySQL] ****
skipping: no hosts matched

PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=0   

Seems there is some missing variable. I checked it again and again but found nothing. My hosts/stagingis pointing to a DO droplet. It looks:


I forget something? Thank you.

The hosts/staging file mentions…

Add each host to the [staging] group and to a “type” group such as [web]

Did you include the [web] group?



Both group names are needed for the hosts parameter in server.yml to match your host.

1 Like

That was. Fixed!

(20 chars)

1 Like

After that I have another error

TASK [setup] *******************************************************************
fatal: []: FAILED! => {"failed": true, "msg": "ERROR! Incorrect sudo password"}

I have gorup_vars/all/users.yml:

admin_user: aitor

# Also define sudoer_passwords in group_vars/<environment>/main.yml
  - name: "{{ web_user }}"
      - "{{ web_group }}"
      - "{{ lookup('file', '~/.ssh/') }}"
      # -
  - name: "{{ admin_user }}"
      - sudo
      - "{{ lookup('file', '~/.ssh/') }}"
      # -

web_user: web
web_group: www-data
  - "/usr/sbin/service php7.0-fpm *"

And I can connect by hand at ssh aitor@staging-IP because I have copied my public key to remote server.

Thank you.

Please don’t use the same thread for different issues. This is also covered in the docs:

1 Like