Git repo cannot be accessed
up vote
-1
down vote
favorite
I've got a very strange issue with Ansible since last friday. We've been using Ansible with Jenkins for about 1.5 year to Build and Deploy our code. But, since last friday we're getting the following error when Ansible tries to pull the Git repo.
"Git repo Git@GitHub.com: User/reponame.git cannot be accessed".
I don't think this is a Jenkins error because, when I run the script on the command line, I'm also getting this error. The Ansible we use, is based on Trellis from Roots. The YAML file used is the following:
---
- include: "{{ deploy_update_before | default('../hooks/example.yml') }}"
tags: deploy-update-before
- name: Check whether project source path is a git repo
stat:
path: "{{ project_source_path }}/.git"
register: git_project
- name: Get current git remote URL
command: git config --get remote.origin.url
args:
chdir: "{{ project_source_path }}"
register: remote_origin_url
when: git_project.stat.exists
changed_when: false
- name: Update git remote URL
command: git remote set-url origin {{ project_git_repo }}
args:
chdir: "{{ project_source_path }}"
when: git_project.stat.exists and remote_origin_url.stdout != project_git_repo
- name: Clone project files
git:
repo: "{{ project_git_repo }}"
dest: "{{ project_source_path }}"
version: "{{ project_version }}"
accept_hostkey: yes
ignore_errors: true
no_log: false
register: git_clone
- name: Failed connection to remote repo
fail:
msg: |
Git repo {{ project.repo }} cannot be accessed. Please verify the repository exists and you have SSH forwarding set up correctly.
More info:
> https://roots.io/trellis/docs/deploys/#ssh-keys
> https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding
when: git_clone | failed
- include: "{{ deploy_update_after | default('../hooks/example.yml') }}"
tags: deploy-update-after
When I run the following command on the command line while logged in as the user 'jenkins', everything seems to be perfectly fine:
ssh -T git@github.com
Hi User/reponame.git You've successfully authenticated, but GitHub does not provide shell access.
Also, cloning works as expected.
$ mkdir test && cd test && git clone git@github.com:User/reponame.git
The output is:
Cloning into 'reponame'...
remote: Enumerating objects: 975, done.
remote: Counting objects: 100% (975/975), done.
remote: Compressing objects: 100% (554/554), done.
remote: Total 83485 (delta 701), reused 615 (delta 412), pack-reused 82510
Receiving objects: 100% (83485/83485), 338.98 MiB | 21.21 MiB/s, done.
Resolving deltas: 100% (55561/55561), done.
I've already checked and executed the steps on the following pages:
https://roots.io/trellis/docs/deploys/#ssh-keys
https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding
Can someone tell me what's going wrong?
FIXED - Git repo cannot be accessed with Ansible and Jenkins
I've got a very strange issue with Ansible since last friday. We've been using Ansible with Jenkins for about 1.5 year to Build and Deploy our code. But, since last friday we're getting the following error when Ansible tries to pull the GIT repo.
"Git repo git@github.com:User/reponame.git cannot be accessed".
I don't think this is a Jenkins error because, when I run the script on the command line, i'm also getting this error. The Ansible we use, is based on Trellis from Roots. The YAML file used is the following:
When i run the following command on the command line while logged in as the user 'jenkins', everything seems to be perfectly fine:
Hi User/reponame.git You've successfully authenticated, but GitHub does not provide shell access.
Can someone tell me what's going wrong?
Thanks in advance!
EDIT: It's fixed. Github made some changes to their IP addresses, our host didn't whitelist them ;-).
jenkins github ssh ansible
add a comment |
up vote
-1
down vote
favorite
I've got a very strange issue with Ansible since last friday. We've been using Ansible with Jenkins for about 1.5 year to Build and Deploy our code. But, since last friday we're getting the following error when Ansible tries to pull the Git repo.
"Git repo Git@GitHub.com: User/reponame.git cannot be accessed".
I don't think this is a Jenkins error because, when I run the script on the command line, I'm also getting this error. The Ansible we use, is based on Trellis from Roots. The YAML file used is the following:
---
- include: "{{ deploy_update_before | default('../hooks/example.yml') }}"
tags: deploy-update-before
- name: Check whether project source path is a git repo
stat:
path: "{{ project_source_path }}/.git"
register: git_project
- name: Get current git remote URL
command: git config --get remote.origin.url
args:
chdir: "{{ project_source_path }}"
register: remote_origin_url
when: git_project.stat.exists
changed_when: false
- name: Update git remote URL
command: git remote set-url origin {{ project_git_repo }}
args:
chdir: "{{ project_source_path }}"
when: git_project.stat.exists and remote_origin_url.stdout != project_git_repo
- name: Clone project files
git:
repo: "{{ project_git_repo }}"
dest: "{{ project_source_path }}"
version: "{{ project_version }}"
accept_hostkey: yes
ignore_errors: true
no_log: false
register: git_clone
- name: Failed connection to remote repo
fail:
msg: |
Git repo {{ project.repo }} cannot be accessed. Please verify the repository exists and you have SSH forwarding set up correctly.
More info:
> https://roots.io/trellis/docs/deploys/#ssh-keys
> https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding
when: git_clone | failed
- include: "{{ deploy_update_after | default('../hooks/example.yml') }}"
tags: deploy-update-after
When I run the following command on the command line while logged in as the user 'jenkins', everything seems to be perfectly fine:
ssh -T git@github.com
Hi User/reponame.git You've successfully authenticated, but GitHub does not provide shell access.
Also, cloning works as expected.
$ mkdir test && cd test && git clone git@github.com:User/reponame.git
The output is:
Cloning into 'reponame'...
remote: Enumerating objects: 975, done.
remote: Counting objects: 100% (975/975), done.
remote: Compressing objects: 100% (554/554), done.
remote: Total 83485 (delta 701), reused 615 (delta 412), pack-reused 82510
Receiving objects: 100% (83485/83485), 338.98 MiB | 21.21 MiB/s, done.
Resolving deltas: 100% (55561/55561), done.
I've already checked and executed the steps on the following pages:
https://roots.io/trellis/docs/deploys/#ssh-keys
https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding
Can someone tell me what's going wrong?
FIXED - Git repo cannot be accessed with Ansible and Jenkins
I've got a very strange issue with Ansible since last friday. We've been using Ansible with Jenkins for about 1.5 year to Build and Deploy our code. But, since last friday we're getting the following error when Ansible tries to pull the GIT repo.
"Git repo git@github.com:User/reponame.git cannot be accessed".
I don't think this is a Jenkins error because, when I run the script on the command line, i'm also getting this error. The Ansible we use, is based on Trellis from Roots. The YAML file used is the following:
When i run the following command on the command line while logged in as the user 'jenkins', everything seems to be perfectly fine:
Hi User/reponame.git You've successfully authenticated, but GitHub does not provide shell access.
Can someone tell me what's going wrong?
Thanks in advance!
EDIT: It's fixed. Github made some changes to their IP addresses, our host didn't whitelist them ;-).
jenkins github ssh ansible
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I've got a very strange issue with Ansible since last friday. We've been using Ansible with Jenkins for about 1.5 year to Build and Deploy our code. But, since last friday we're getting the following error when Ansible tries to pull the Git repo.
"Git repo Git@GitHub.com: User/reponame.git cannot be accessed".
I don't think this is a Jenkins error because, when I run the script on the command line, I'm also getting this error. The Ansible we use, is based on Trellis from Roots. The YAML file used is the following:
---
- include: "{{ deploy_update_before | default('../hooks/example.yml') }}"
tags: deploy-update-before
- name: Check whether project source path is a git repo
stat:
path: "{{ project_source_path }}/.git"
register: git_project
- name: Get current git remote URL
command: git config --get remote.origin.url
args:
chdir: "{{ project_source_path }}"
register: remote_origin_url
when: git_project.stat.exists
changed_when: false
- name: Update git remote URL
command: git remote set-url origin {{ project_git_repo }}
args:
chdir: "{{ project_source_path }}"
when: git_project.stat.exists and remote_origin_url.stdout != project_git_repo
- name: Clone project files
git:
repo: "{{ project_git_repo }}"
dest: "{{ project_source_path }}"
version: "{{ project_version }}"
accept_hostkey: yes
ignore_errors: true
no_log: false
register: git_clone
- name: Failed connection to remote repo
fail:
msg: |
Git repo {{ project.repo }} cannot be accessed. Please verify the repository exists and you have SSH forwarding set up correctly.
More info:
> https://roots.io/trellis/docs/deploys/#ssh-keys
> https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding
when: git_clone | failed
- include: "{{ deploy_update_after | default('../hooks/example.yml') }}"
tags: deploy-update-after
When I run the following command on the command line while logged in as the user 'jenkins', everything seems to be perfectly fine:
ssh -T git@github.com
Hi User/reponame.git You've successfully authenticated, but GitHub does not provide shell access.
Also, cloning works as expected.
$ mkdir test && cd test && git clone git@github.com:User/reponame.git
The output is:
Cloning into 'reponame'...
remote: Enumerating objects: 975, done.
remote: Counting objects: 100% (975/975), done.
remote: Compressing objects: 100% (554/554), done.
remote: Total 83485 (delta 701), reused 615 (delta 412), pack-reused 82510
Receiving objects: 100% (83485/83485), 338.98 MiB | 21.21 MiB/s, done.
Resolving deltas: 100% (55561/55561), done.
I've already checked and executed the steps on the following pages:
https://roots.io/trellis/docs/deploys/#ssh-keys
https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding
Can someone tell me what's going wrong?
FIXED - Git repo cannot be accessed with Ansible and Jenkins
I've got a very strange issue with Ansible since last friday. We've been using Ansible with Jenkins for about 1.5 year to Build and Deploy our code. But, since last friday we're getting the following error when Ansible tries to pull the GIT repo.
"Git repo git@github.com:User/reponame.git cannot be accessed".
I don't think this is a Jenkins error because, when I run the script on the command line, i'm also getting this error. The Ansible we use, is based on Trellis from Roots. The YAML file used is the following:
When i run the following command on the command line while logged in as the user 'jenkins', everything seems to be perfectly fine:
Hi User/reponame.git You've successfully authenticated, but GitHub does not provide shell access.
Can someone tell me what's going wrong?
Thanks in advance!
EDIT: It's fixed. Github made some changes to their IP addresses, our host didn't whitelist them ;-).
jenkins github ssh ansible
I've got a very strange issue with Ansible since last friday. We've been using Ansible with Jenkins for about 1.5 year to Build and Deploy our code. But, since last friday we're getting the following error when Ansible tries to pull the Git repo.
"Git repo Git@GitHub.com: User/reponame.git cannot be accessed".
I don't think this is a Jenkins error because, when I run the script on the command line, I'm also getting this error. The Ansible we use, is based on Trellis from Roots. The YAML file used is the following:
---
- include: "{{ deploy_update_before | default('../hooks/example.yml') }}"
tags: deploy-update-before
- name: Check whether project source path is a git repo
stat:
path: "{{ project_source_path }}/.git"
register: git_project
- name: Get current git remote URL
command: git config --get remote.origin.url
args:
chdir: "{{ project_source_path }}"
register: remote_origin_url
when: git_project.stat.exists
changed_when: false
- name: Update git remote URL
command: git remote set-url origin {{ project_git_repo }}
args:
chdir: "{{ project_source_path }}"
when: git_project.stat.exists and remote_origin_url.stdout != project_git_repo
- name: Clone project files
git:
repo: "{{ project_git_repo }}"
dest: "{{ project_source_path }}"
version: "{{ project_version }}"
accept_hostkey: yes
ignore_errors: true
no_log: false
register: git_clone
- name: Failed connection to remote repo
fail:
msg: |
Git repo {{ project.repo }} cannot be accessed. Please verify the repository exists and you have SSH forwarding set up correctly.
More info:
> https://roots.io/trellis/docs/deploys/#ssh-keys
> https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding
when: git_clone | failed
- include: "{{ deploy_update_after | default('../hooks/example.yml') }}"
tags: deploy-update-after
When I run the following command on the command line while logged in as the user 'jenkins', everything seems to be perfectly fine:
ssh -T git@github.com
Hi User/reponame.git You've successfully authenticated, but GitHub does not provide shell access.
Also, cloning works as expected.
$ mkdir test && cd test && git clone git@github.com:User/reponame.git
The output is:
Cloning into 'reponame'...
remote: Enumerating objects: 975, done.
remote: Counting objects: 100% (975/975), done.
remote: Compressing objects: 100% (554/554), done.
remote: Total 83485 (delta 701), reused 615 (delta 412), pack-reused 82510
Receiving objects: 100% (83485/83485), 338.98 MiB | 21.21 MiB/s, done.
Resolving deltas: 100% (55561/55561), done.
I've already checked and executed the steps on the following pages:
https://roots.io/trellis/docs/deploys/#ssh-keys
https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding
Can someone tell me what's going wrong?
FIXED - Git repo cannot be accessed with Ansible and Jenkins
I've got a very strange issue with Ansible since last friday. We've been using Ansible with Jenkins for about 1.5 year to Build and Deploy our code. But, since last friday we're getting the following error when Ansible tries to pull the GIT repo.
"Git repo git@github.com:User/reponame.git cannot be accessed".
I don't think this is a Jenkins error because, when I run the script on the command line, i'm also getting this error. The Ansible we use, is based on Trellis from Roots. The YAML file used is the following:
When i run the following command on the command line while logged in as the user 'jenkins', everything seems to be perfectly fine:
Hi User/reponame.git You've successfully authenticated, but GitHub does not provide shell access.
Can someone tell me what's going wrong?
Thanks in advance!
EDIT: It's fixed. Github made some changes to their IP addresses, our host didn't whitelist them ;-).
jenkins github ssh ansible
jenkins github ssh ansible
edited yesterday
Zoe
10.1k73475
10.1k73475
asked Nov 5 at 17:48
Danny
44
44
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53159587%2fgit-repo-cannot-be-accessed%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password