How to create an additional environment?

Hi!

UPDATE: Nevermind I made a small mistake, it works!

Given the amazing results we had with our first Trellis based project, I’m converting our team to use Trellis.

We would like to have a fourth environment to test deployments and play around with it: test.domain.com

I added a folder “test” in group_vars, with a copy of the staging files, which i then modified to set up the environment.

I also added a hosts file “test” with the relevant domains names.

But when i run : `ansible-playbook server.yml -e env=test``

I get :

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

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

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

What am I doing wrong? Did I miss another configuration step?

Thank you,
a.

Hi, I’m having a similar issue. Could you share how you fix it? And perhaps more in-depth what you change

It’s helpful to share with us what you’ve tried so far @Enrique_German. The post you replied to is 5 years old so the author may not be around to reply.

Adding another environment is done in a couple of steps. For example:

  1. copy an existing group_vars folder: cp -R group_vars/staging group_vars/test
  2. update values in all the new config files copied over
  3. copy a hosts file: cp hosts/staging hosts/test
  4. update hostnames in the new hosts file