Fatal: [192.168.50.5] => SSH Error: Permission denied (publickey)

Is there a deploy cmd that allows for this to override the default branch that is already defined in group_vars?

Maybe it’s not the most common work flow since you could do this all locally and then merge to staging and deploy but what if I wanted to override what is defined in staging ie: branch:staging and wanted to push branch:staging-test-feature without having to merge this branch back to staging in order to deploy it.

ie: ./deploy.sh staging <branch_override> staging.mysite.com

You can correct my understanding of what you’d like to do.

If you usually have branch: staging in group_vars/staging/wordpress_sites.yml but you’d like to test a new feature you’ve added to a branch named staging-test-feature, then I think you’d just do this:

  • Push the staging-test-feature branch to your remote repo.
  • Temporarily change branch: staging-test-feature on your local machine. There’s no need to commit this temporary change to your remote repo because the deploy will read your local machine’s ansible files even though it deploys the remote repo’s bedrock project.
  • Run the deploy.

Trellis does not currently accommodate passing the branch as a CLI parameter. If you’re especially motivated to have a CLI branch parameter instead of temporarily modifying branch in group_vars/staging/wordpress_sites.yml, you could edit deploy.yml like this:

  vars:
    project: "{{ wordpress_sites[site] }}"
    project_root: "{{ www_root }}/{{ site }}"
+   project_version: "{{ branch | default(project.branch) }}"

and run a command like this:

ansible-playbook deploy.yml -i hosts/staging -e "site=example.com branch=staging-test-feature"
1 Like

Perfect, makes sense.

Did you get your SSH sorted? Sometimes I have too many keys loaded at the same time and I get that error.

ssh-add -L to see and -D to dump them all if your on Linux

1 Like