# Failed to connect to github.com port 443

**URL:** <https://forum.ansible.com/t/failed-to-connect-to-github-com-port-443/23963>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [March 14, 2017, 10:36am UTC](https://forum.ansible.com/t/failed-to-connect-to-github-com-port-443/23963 "2017-03-14T10:36:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_Ferro](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pedro\_Ferro](https://forum.ansible.com/u/Pedro_Ferro)\
**Post date:** [March 14, 2017, 10:36am UTC](https://forum.ansible.com/t/failed-to-connect-to-github-com-port-443/23963/1 "2017-03-14T10:36:10Z")

</div>

Hi,

I’m working in a VM, with Ubuntu 14.04, beyond a proxy.

If I do this in the terminal I’ve success:

`

sudo mkdir -p /usr/lib/ckan/default

sudo chown `whoami` /usr/lib/ckan/default

virtualenv --no-site-packages /usr/lib/ckan/default

. /usr/lib/ckan/default/bin/activate

pip install -e ‘git+https://github.com/ckan/ckan.git@ckan-2.5.3#egg=ckan’

`

If I do the “same” trough an Ansible playbook

`

…  
'#create vitualenv and activate it

- name: mkdir /usr/lib/ckan/default  
shell: mkdir -p /usr/lib/ckan/default

- name: whoami`/usr/lib/ckan/default shell: chown`whoami` /usr/lib/ckan/default

- name: virtualenv  
shell: virtualenv --no-site-packages /usr/lib/ckan/default

- name: activate virtualenv  
shell: . /usr/lib/ckan/default/bin/activate

#install ckan 2.5.3 from github

- name: install ckan 2.5.3  
pip:  
name: ‘git+https://github.com/ckan/ckan.git@ckan-2.5.3#egg=ckan’

`

I always get this error:

`

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [Stop service apache2] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

TASK [Stop service nginx] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [mkdir ~/ckan/lib] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]  
[WARNING]: Consider using file module with state=directory rather than running  
mkdir

TASK [create symlinks] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]  
[WARNING]: Consider using file module with state=link rather than running ln

TASK [mkdir ~/ckan/etc] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

TASK [create symlinks] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

TASK [mkdir /usr/lib/ckan/default] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

TASK [whoami` /usr/lib/ckan/default] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]  
[WARNING]: Consider using file module with owner rather than running chown

TASK [virtualenv] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

TASK [activate virtualenv] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

TASK [install ckan 2.5.3] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [localhost]: FAILED! =\> {“changed”: false, “cmd”: “/usr/bin/pip2 install -e git+https://github.com/ckan/ckan.git@ckan-2.5.3#egg=ckan”, “failed”: true, “msg”: “stdout: Obtaining ckan from git+https://github.com/ckan/ckan.git@ckan-2.5.3#egg=ckan\n Cloning [GitHub - ckan/ckan: CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.](https://github.com/ckan/ckan.git) (to ckan-2.5.3) to ./src/ckan\n Complete output from command /usr/bin/git clone -q [GitHub - ckan/ckan: CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.](https://github.com/ckan/ckan.git) /tmp/src/ckan:\n \n----------------------------------------\nCleaning up…\nCommand /usr/bin/git clone -q [GitHub - ckan/ckan: CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.](https://github.com/ckan/ckan.git) /tmp/src/ckan failed with error code 128 in None\nStoring debug log for failure in /home/pf/.pip/pip.log\n\n:stderr: fatal: unable to access ‘[GitHub - ckan/ckan: CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.](https://github.com/ckan/ckan.git/)’: Failed to connect to [github.com](http://github.com) port 443: No route to host\n”}  
`

I’ve tried doing the pip instruction through shell but the result is the same

`  
#install ckan 2.5.3 from github

# - name: install ckan-2.5.3

# shell: pip install -e ‘git+https://github.com/ckan/ckan.git@ckan-2.5.3#egg=ckan’

`

I’m running the .yml file and the terminal commands from the same place in the shell, in my case

`pf@pf-VirtualBox:~$`

It’s probably something quiet basic but I stuck with this for so long that I don’t know what should I do.

Any help would be appreciate.

Pedro

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [March 14, 2017, 5:20pm UTC](https://forum.ansible.com/t/failed-to-connect-to-github-com-port-443/23963/2 "2017-03-14T17:20:53Z")

</div>

You should specify the environment vars that you need (such as  
HTTP\_PROXY) in your playbook.  
Take a look at this: [http://docs.ansible.com/ansible/playbooks\_environment.html](http://docs.ansible.com/ansible/playbooks_environment.html)

Also, the pip module has various virtualenv options - no need to do  
this with brittle shell commands.  
Same for mkdir and chown - this should be done using the file module.

[http://docs.ansible.com/ansible/file\_module.html](http://docs.ansible.com/ansible/file_module.html)  
[http://docs.ansible.com/ansible/pip\_module.html](http://docs.ansible.com/ansible/pip_module.html)

Dick
