# Composer + Trellis + Bedrock Private Composer Repositories

**URL:** https://discourse.roots.io/t/composer-trellis-bedrock-private-composer-repositories/22831
**Category:** bedrock
**Created:** 2022-04-07T15:02:29Z
**Posts:** 10
**Showing post:** 3 of 10

## Post 3 by @mattia — 2022-04-12T16:45:05Z

I tried with this [Composer failing due to incorrect GitHub fingerprint - #2 by Twansparant](https://discourse.roots.io/t/composer-failing-due-to-incorrect-github-fingerprint/21735/2) solution, but it didn’t work. (when I run composer install from one of the failed deploy release folders, I can see this error `Your github oauth token for github.com contains invalid characters:`)

so I tried with this other solution [Gitlab private repo as composer package - #13 by alwaysblank](https://discourse.roots.io/t/gitlab-private-repo-as-composer-package/20592/13)

```
# trellis/deploy-hooks/build-before.yml
---
- name: Create composer auth.json
  template:
    src: "{{ playbook_dir }}/deploy-hooks/auth.json.j2"
    dest: "{{ deploy_helper.new_release_path }}/auth.json"
    mode: "0600"
```

```
# trellis/group_vars/all/vault.yml
vault_wordpress_env_defaults:
   vault_github_user: 'xxxxx'
   vault_github_pass: 'xxxxx'
```

```
# trellis/deploy-hooks/auth.json.j2
{
  "http-basic": {
    "github.com": {
      "username": "{{ vault_github_user }}",
      "password": "{{ vault_github_pass }}"
    }
  }
}
```

or even (vault\_github\_pass value is the personal access token ghp\_[YOUR-PERSONAL-TOKEN])

```
# trellis/deploy-hooks/auth.json.j2
{
  "github-oauth": {
    "github.com": "{{ vault_github_pass }}"
  }
}
```

I even re-provisioning (not sure if this was a step needed), then when I tried to deploy, I can see a new error `AnsibleUndefinedVariable: 'vault_github_token' is undefined` or `AnsibleUndefinedVariable: 'vault_github_user' is undefined` (depending of which of the 2 auth.json.j2 I use)

Could someone please point me to the right direction, I am running out of options and I can’t deploy anymore?

is there a way to achieve this or it is better to move from Github to bitbucket in order to have a private wordPress plugins as composer dependencies?

@alwaysblank , @Twansparant I am tagging you because I saw your comments on the similar/related topic (I can’t reply in that topic because the comments are closed)

thanks

---

_[View the full topic](https://discourse.roots.io/t/composer-trellis-bedrock-private-composer-repositories/22831)._
