ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 394 forks source link

OSError: [Errno 2] No such file or directory : '/root/ansible-container-env/lib/python2.7/site-packages/ansible_container-0.9.3rc0-py2.7.egg/contain er/docker/files/setup.py' #968

Closed Seally10 closed 6 years ago

Seally10 commented 6 years ago

ansible-container build

I get error:

Building Docker Engine context...
ERROR Unknown exception
Traceback (most recent call last): File "/root/ansible-container-env/lib/python2.7/site-packages/ansiblecontainer-0.9.3rc0-py2.7.egg/container/cli.py", line 302, in call getattr(core, u'hostcmd{}'.format(args.subcommand))(vars(args)) File "/root/ansible-container-env/lib/python2.7/site-packages/ansible_container-0.9.3rc0-py2.7.egg/container/init.py", line 28, in wrapped return fn(*args, **kwargs) File "/root/ansible-container-env/lib/python2.7/site-packages/ansible_container-0.9.3rc0-py2.7.egg/container/core.py", line 184, in hostcmd_build environment=env_vars File "/root/ansible-container-env/lib/python2.7/site-packages/ansible_container-0.9.3rc0-py2.7.egg/container/docker/engine.py", line 107, in wr apped__ return fn(self, *args, kwargs) File "/root/ansible-container-env/lib/python2.7/site-packages/ansible_container-0.9.3rc0-py2.7.egg/container/init.py", line 28, in _wrapped _ return fn(*args, **kwargs) File "/root/ansible-container-env/lib/python2.7/site-packages/ansible_container-0.9.3rc0-py2.7.egg/container/docker/engine.py", line 1086, in bui ld_conductor_image arcname='container-src/conductor-build/setup.py') File "/usr/lib64/python2.7/tarfile.py", line 1975, in add tarinfo = self.gettarinfo(name, arcname) File "/usr/lib64/python2.7/tarfile.py", line 1847, in gettarinfo statres = os.lstat(name) OSError: [Errno 2] No such file or directory: '/root/ansible-container-env/lib/python2.7/site-packages/ansible_container-0.9.3rc0-py2.7.egg/contain er/docker/files/setup.py'

Voronenko commented 6 years ago

Looking at green tests, it rather is connected to environment. Can you provide more details about context?

Seally10 commented 6 years ago

@Voronenko 1、cd /root; virtualenv ansible-container-env 2、install ansible-container: cd ansible-container-develop; python setup.py install 3、mkdir myproject; cd myproject; ansible-container init 4、edit container.yml 5、cd /etc/ansible/roles; ansible-galaxy init test 6、run ansible-container build

OSError: [Errno 2] No such file or directory: .... ansible_container-0.9.3rc0-py2.7.egg/contain er/docker/files/setup.py'

then run touch .... ansible_container-0.9.3rc0-py2.7.egg/container/docker/files/setup.py

OSError: [Errno 2] No such file or directory: .... .... ansible_container-0.9.3rc0-py2.7.egg/container/docker/files/conductor-requirements.txt

then run touch .... ansible_container-0.9.3rc0-py2.7.egg/container/docker/files/conductor-requirements.txt

OSError: [Errno 2] No such file or directory: .... .... ansible_container-0.9.3rc0-py2.7.egg/container/docker/files/conductor-requirements.yml

then run touch .... ansible_container-0.9.3rc0-py2.7.egg/container/docker/files/conductor-requirements.yml

another error: (role create in step 5) ansible.errors.AnsibleError: the role 'test' was not found in ./roles:/src/roles:/etc/ansible/roles

then i move role 'test' to ./roles/, it works, role 'test' why it can not found in /etc/ansible/roles/

I am new in ansible-container .

Thanks

Voronenko commented 6 years ago

Docker context does not allow you to escape directory root,

Voronenko commented 6 years ago

You can also just try to install sa-ansible-container[docker] - that's current develop packed as pypi package.

Seally10 commented 6 years ago

@Voronenko Thank you very much!

Voronenko commented 6 years ago

Reopen question, if some new linked question arises.