Bedrock/ansible problem with the git module in the 'deploy' task

Hello,

I’m using bedrock/ansible (trellis) to manage my deploys. I’ve encountered a problem that puzzles me completely. Here is why:

I have bedrock/ansible projects. This is my directory structure:

project-1.local/
β”œβ”€β”€ ansible/
└── site/  
project-2.local/
β”œβ”€β”€ ansible/
└── site/  

Both projects are configured exactly the same. Both get deployed to the staging environment using a public git repositories. if I run ./deploy.sh staging project-1.net in the ansible directory of project-1, all is good, the site is deployed correctly - all tasks executed.

Howver, running ./deploy.sh staging project-2.net in the ansible directory of project-2 gives this error message:

failed: [my.staging.host.ip] => {β€œcmd”: β€œ/usr/bin/git ls-remote origin -h refs/heads/master”, β€œfailed”: true, β€œrc”: 128}
stderr: ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

msg: ERROR: Repository not found.
fatal: Could not read from remote repository.

I’ve been trying to find possible problems with ssh key forwarding, but this appears to be working fine. project-1.net and project-2.net are configured exactly the same - these directories exist on the staging host. The projects themselves are also there as I was able to deploy both sites before.

I do not see any apparent reason why anssible would deploy the first project but not the second one.

I’d really appreciate your advice on how I could debug it and get to the core of the problem.
`

Ok I found what the problem was. It appears that I provisioned my staging host with a misspelled repository address. Consequently, remote_project_root/shared/sources had a repository with wrong address set as a remote. Even if a correct address was supplied in ansible wordpress_sites array, the wrong address on the remote host would not be overriden. That was it.

1 Like

Thanks for letting everyone know what the issue was :smiley: