# Djangocms via ansible and vagrant

**URL:** <https://forum.ansible.com/t/djangocms-via-ansible-and-vagrant/24652>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [June 5, 2017, 6:58pm UTC](https://forum.ansible.com/t/djangocms-via-ansible-and-vagrant/24652 "2017-06-05T18:58:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrej\_Friesen](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@Andrej\_Friesen](https://forum.ansible.com/u/Andrej_Friesen)\
**Post date:** [June 5, 2017, 6:58pm UTC](https://forum.ansible.com/t/djangocms-via-ansible-and-vagrant/24652/1 "2017-06-05T18:58:37Z")

</div>

Hi,

iam trying to setup a djangocms dev environment with ansible and vagrant.

But if iam running this Playbook:

`

- name: Setup Virtualenv  
pip:  
virtualenv: “{{ virtualenv\_path }}”  
requirements: “{{ virtualenv\_path }}/requirements.txt”

# virtualenv\_python: python3

# virtualenv\_command: virtualenv

become: true

# - name: Set permissions on migrate.py

# file:

# dest: “{{ virtualenv\_path }}/manage.py”

# mode: 755

- name: Create project directory for djangocms website  
file:  
path: “{{ virtualenv\_path}}/{{ project\_name}}”  
state: directory

- name: Install djangocms  
shell: “{{ virtualenv\_path }}/bin/djangocms -f -p {{ virtualenv\_path}}/{{ project\_name}} mysite”

# args:

# chdir: “{{ virtualenv\_path}}/{{ project\_name}}”

- name: Start webservice  
command: "{{virtualenv\_path }}/bin/python {{virtualenv\_path }}/{{ project\_name}}/manage.py runserver 0.0.0.0:8080 "

`

i get an error:

`

TASK [deploy : Install djangocms] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /vagrant/ansible/roles/deploy/tasks/main.yaml:19  
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/commands/command.py  
 ESTABLISH LOCAL CONNECTION FOR USER: ubuntu  
 EXEC /bin/sh -c ‘echo ~ && sleep 0’  
 EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /home/ubuntu/.ansible/tmp/ansible-tmp-1496685538.28-252176297847487`” && echo ansible-tmp-1496685538.28-252176297847487=“`echo /home/ubuntu/.ansible/tmp/ansible-tmp-1496685538.28-252176297847487`” ) && sleep 0’  
 PUT /tmp/tmpoyUX\_p TO /home/ubuntu/.ansible/tmp/ansible-tmp-1496685538.28-252176297847487/command.py  
 EXEC /bin/sh -c ‘chmod u+x /home/ubuntu/.ansible/tmp/ansible-tmp-1496685538.28-252176297847487/ /home/ubuntu/.ansible/tmp/ansible-tmp-1496685538.28-252176297847487/command.py && sleep 0’  
 EXEC /bin/sh -c ‘/usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1496685538.28-252176297847487/command.py; rm -rf “/home/ubuntu/.ansible/tmp/ansible-tmp-1496685538.28-252176297847487/” \> /dev/null 2\>&1 && sleep 0’  
fatal: [default]: FAILED! =\> {  
“changed”: true,  
“cmd”: “/var/www/site/bin/djangocms -f -p /var/www/site/techniktip mysite”,  
“delta”: “0:00:02.143124”,  
“end”: “2017-06-05 17:59:00.575333”,  
“failed”: true,  
“invocation”: {  
“module\_args”: {  
“\_raw\_params”: “/var/www/site/bin/djangocms -f -p /var/www/site/techniktip mysite”,  
“\_uses\_shell”: true,  
“chdir”: null,  
“creates”: null,  
“executable”: null,  
“removes”: null,  
“warn”: true  
}  
},  
“rc”: 1,  
“start”: “2017-06-05 17:58:58.432209”,  
“stderr”: “Traceback (most recent call last):\n File "/var/www/site/bin/djangocms", line 11, in \n sys.exit(execute())\n File "/var/www/site/local/lib/python2.7/site-packages/djangocms\_installer/main.py", line 33, in execute\n verbose=config\_data.verbose\n File "/var/www/site/local/lib/python2.7/site-packages/djangocms\_installer/install/ **init**.py", line 98, in requirements\n logger.error(‘cmd : %s :%s’ % (e.cmd, e.output))\nAttributeError: ‘exceptions.OSError’ object has no attribute ‘cmd’”,  
“stderr\_lines”: [  
“Traceback (most recent call last):”,  
" File "/var/www/site/bin/djangocms", line 11, in “,  
" sys.exit(execute())”,  
" File "/var/www/site/local/lib/python2.7/site-packages/djangocms\_installer/main.py", line 33, in execute",  
" verbose=config\_data.verbose",  
" File "/var/www/site/local/lib/python2.7/site-packages/djangocms\_installer/install/ **init**.py", line 98, in requirements",  
" logger.error(‘cmd : %s :%s’ % (e.cmd, e.output))",  
“AttributeError: ‘exceptions.OSError’ object has no attribute ‘cmd’”  
],  
“stdout”: “Creating the project\nPlease wait while I install dependencies\nThe installation has failed.\n\n\n\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\n\nCheck documentation at [https://djangocms-installer.readthedocs.io](https://djangocms-installer.readthedocs.io)\n\n\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*”,  
“stdout\_lines”: [  
“Creating the project”,  
“Please wait while I install dependencies”,  
“The installation has failed.”,  
“”,  
“”,  
“_**",  
“”,  
“Check documentation at [https://djangocms-installer.readthedocs.io](https://djangocms-installer.readthedocs.io)”,  
“”,  
"**_”  
]  
}  
to retry, use: --limit @/vagrant/ansible/roles/playbook.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
default : ok=8 changed=0 unreachable=0 failed=1

Ansible failed to complete successfully. Any error output should be  
visible above. Please fix these errors and try again.

`

I dont know if this is ansible or djangocms related.  
Could somebody push me in the right direction to solve this problem?
