I’ve looked at every thread with the topic at hand but I’ve yeilided no results. Right now I have a file structure like this:
group_vars
-all
-development
-new_staging
users.yml
wordpress.yml
-production
-staging
hosts
-new_staging
I have this in the new staging hosts file:
new_host ansible_host=204.48.17.0
[new_staging]
new_host
[web]
new_host
I also have set in the users.yml file under new_staging another ssh key that is different from other deploys.
(part of the file)
# Also define 'vault_users' (`group_vars/staging/vault.yml`, `group_vars/production/vault.yml`)
users:
- name: "{{ web_user }}"
groups:
- "{{ web_group }}"
keys:
- "{{ lookup('file', '~/.ssh/new_staging.pub') }}"
- name: "{{ admin_user }}"
groups:
- sudo
keys:
- "{{ lookup('file', '~/.ssh/new_staging.pub') }}"
I am basically trying to deploy to a digital ocean droplet between two different ips and two different ssh keys. I am able to connect to the ssh via terminal but it’s not working correctly for trellis. I have a multi site layout for trellis that has this layout:
Project
- site1
- site2
- site3
- trellis
so basically for site two I need to be able to push to two different DO droplets on two different accounts at different staging ips and ssh keys
This is the error I get now when I deploy:
SSH Error: data could not be sent to remote host "ip". Make sure
this host can be reached over ssh
fatal: [new_staging]: UNREACHABLE! => {
"changed": false,
"unreachable": true
}
EDIT: Ended up figuring out that the known_hosts file was messing with me, after removing that it ran fine with this set up