Roots Discourse

Setting auth token for Private Packagist (

I recently upgraded to Trellis 1.4.0, which offers a different way to set the auth token for Private Packagist. Unfortunately I can’t seem to get it to work. I can’t find any instructions in the official docs, but this pull request lays it out clearly enough.

Using that PR as a guide, I have in group_vars/staging/vault.yml

      - { hostname:, username: my-packagist-username, password: my-packagist-token }

I think that’s all I need, however when running trellis provision staging it completes successfully, but the composer authentications task never shows in the output. I’m not sure why but it’s not happening. Then when I run trellis deploy staging it fails at Composer authentication.

====================== Failed downloading primetime/wp-plugin-activation-
manifest, trying the next URL (401: The
manifest/' URL required
authentication. You must be using the interactive console to authenticate)
Warning from ====================== AUTHENTICATION
FAILURE Username and authentication token required, see - this is not your regular password

Sure enough, when I ssh into staging, there’s no auth.json file to be found. I feel like I’m missing some step to get it to generate, but I can’t figure out what. Any tips?

ansible 2.8.20
trellis 1.4.0
vagrant 2.2.10

Turns out the hostname value needs to point to the source with which you are attempting to authenticate, and not the name of the site that is the target of the deployment. :man_facepalming: So in my case, all I needed to do was change hostname from to (the hostname for Private Packagist) and now I’m able to deploy to staging and auth.json is created as expected.

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.