Failed to connect to github.com port 443

748 views
Skip to first unread message

Pedro Ferro

unread,
Mar 14, 2017, 6:36:10 AM3/14/17
to Ansible Project

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...@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:

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...@ckan-2.5.3#egg=ckan", "failed": true, "msg": "stdout: Obtaining ckan from git+https://github.com/ckan/ckan...@ckan-2.5.3#egg=ckan\n  Cloning https://github.com/ckan/ckan.git (to ckan-2.5.3) to ./src/ckan\n  Complete output from command /usr/bin/git clone -q https://github.com/ckan/ckan.git /tmp/src/ckan:\n  \n----------------------------------------\nCleaning up...\nCommand /usr/bin/git clone -q 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 'https://github.com/ckan/ckan.git/': Failed to connect to 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...@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

Dick Visser

unread,
Mar 14, 2017, 1:21:21 PM3/14/17
to ansible...@googlegroups.com
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

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/pip_module.html


Dick
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/53e2b4b9-a052-42f3-9fa1-963a7b027d4a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Dick Visser
Sr. System & Network Engineer
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs
Reply all
Reply to author
Forward
0 new messages