Try the pip module with environment:

---
- hosts: localhost

  tasks:

    - name: install ckan 2.5.3
      pip:
        name: 'git+https://github.com/ckan/[email protected]#egg=ckan'
        virtualenv: /usr/lib/ckan/default
      environment:
          https_proxy: http://https://10.0.32.6:8080


    - name: install requirements.txt
      pip:
        requirements: /usr/lib/ckan/default/src/ckan/requirements.txt
      environment:
          https_proxy: http://https://10.0.32.6:8080


On Wed, Feb 22, 2017 at 11:25 PM, Pedro Ferro <[email protected]> wrote:

> Hi,
>
> First of all I'm not an IT guy so you have to excuse me for any basic
> questions that I probably make.
>
>
> I'm trying to replicate an installation of CKAN through Ansible in a
> Ubuntu 14.04 virtual machine (I'm beyond a proxy)
>
> Because I'm quiet ignorant in Ansible, I use the "shell" command to do
> almost everything (I imagine that is quiet wrong but it has worked  so
> far...)
>
> I'm trying to replicate this comand that I make via terminal:
>
> . /usr/lib/ckan/default/bin/activate # activate virtualenv
>
>
> pip install -e 'git+https://github.com/ckan/[email protected]#egg=ckan'
>
> pip install -r /usr/lib/ckan/default/src/ckan/requirements.txt
>
>
> In an ansible file I have like this:
>
> ---
> - hosts: localhost
>   sudo: yes
>
>
>
>
>   tasks:
>     - name: activate virtualenv
>       shell: . /usr/lib/ckan/default/bin/activate
>
>
>     - name: export https proxy
>       shell: export https_proxy=’https://10.0.32.6:8080’
>
>
>     - name: install ckan 2.5.3
>       shell: pip install -e 'git+https://github.com/ckan/
> [email protected]#egg=ckan'
>
>
>     - name: install requirements.txt
>       shell: pip install -r /usr/lib/ckan/default/src/ckan/requirements.
> txt
>
> and got this error:
>
> PLAY [localhost]
> ***************************************************************
>
>
>
>
> TASK [setup]
> *******************************************************************
>
> ok: [localhost]
>
>
>
>
>
> TASK [activate virtualenv]
> *****************************************************
>
>
> changed: [localhost]
>
>
>
>
>
> TASK [export https proxy]
> ******************************************************
>
>
> changed: [localhost]
>
>
>
>
>
> TASK [install ckan 2.5.3]
> ******************************************************
>
>
> fatal: [localhost]: FAILED! =>
> {"changed": true, "cmd": "pip install -e
> 'git+https://github.com/ckan/[email protected]#egg=ckan'",
> "delta": "0:00:00.372384", "end":
> "2017-02-22 17:11:20.423442", "failed": true,
> "rc": 1, "start": "2017-02-22 17:11:20.051058",
> "stderr": "fatal: unable to access
> 'https://github.com/ckan/ckan.git/': Failed to connect to github.com port
> 443:
> No route to host", "stdout": "Obtaining ckan from
> git+https://github.com/ckan/[email protected]#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/ckan/install/ansible/playbooks/src/ckan:\n
> \n----------------------------------------\nCleaning up...\nCommand
> /usr/bin/git clone -q https://github.com/ckan/ckan.git
> /tmp/ckan/install/ansible/playbooks/src/ckan failed with error code 128 in
> None\nStoring debug log for failure in /home/pf/.pip/pip.log",
> "stdout_lines": ["Obtaining ckan from
> git+https://github.com/ckan/[email protected]#egg=ckan";, "  Cloning
> https://github.com/ckan/ckan.git (to
> ckan-2.5.3) to ./src/ckan", "
> Complete output from command /usr/bin/git clone -q
> https://github.com/ckan/ckan.git
> /tmp/ckan/install/ansible/playbooks/src/ckan:", "  ",
> "----------------------------------------", "Cleaning up...",
> "Command /usr/bin/git clone -q https://github.com/ckan/ckan.git
> /tmp/ckan/install/ansible/playbooks/src/ckan
> failed with error code 128 in None", "Storing debug log for failure
> in /home/pf/.pip/pip.log"], "warnings": []}
>
>
>             to
> retry, use: --limit
> @/tmp/ckan/install/ansible/playbooks/install_software_ckan253.retry
>
>
>
>
>
> PLAY RECAP
> *********************************************************************
>
>
> localhost                  : ok=3    changed=2
> unreachable=0    failed=1
>
>  I try some variations  in the ansible file, but the result is always the
> some.
>
> Thanks in advance,
> Pedro
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/bbe53947-ca57-48e8-b6e7-485a9a5f3258%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/bbe53947-ca57-48e8-b6e7-485a9a5f3258%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Nehal J Wani

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG6NSrn5m-JBE9O6%2BDqxFBUDSH3fYpvSaDSrt69T3XUHuZ1Y9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to