msg: [Errno 2] No such file or directory

1,700 views
Skip to first unread message

Yves Dorfsman

unread,
May 16, 2015, 11:25:10 AM5/16/15
to ansible...@googlegroups.com

Hi

I'm getting a "msg: [Errno 2] No such file or directory" on "apt" with the most simple playbook.

This is with version v1.9.1-1

I checked my syntax etc... and the only way I can fix it is to go to version v1.5.0. Googling, I see that this was an issue but it was fixed in 1.5.2.

Can there be something specific in my environment that causes this? A problem with sudo? Anybody else running into this?

Here is the full result:
TASK: [baselinux | install important packages] ********************************
failed: [tuck] => {"cmd": "DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install tmux", "failed": true, "rc": 2}
msg: [Errno 2] No such file or directory

FATAL: all hosts have already failed -- aborting

Is the issue that it tries to run 'DEBIAN_FRONTEND"?

--
http://yves.zioup.com
gpg: 4096R/32B0F416

Brian Coca

unread,
May 16, 2015, 12:01:21 PM5/16/15
to ansible...@googlegroups.com
DEBIAN_FRONTEND is just being set as an environment variable to tell
apt not to prompt.

what OS are you running against? can you share the 'simple play'?




--
Brian Coca

Yves Dorfsman

unread,
May 16, 2015, 12:34:21 PM5/16/15
to ansible...@googlegroups.com
On 2015-05-16 10:01, Brian Coca wrote:
> DEBIAN_FRONTEND is just being set as an environment variable to tell
> apt not to prompt.

I realise that, I knew you could do that with shell, but I hadn't realised it
worked with cmd which I thought was a C exec of a binary command.


> what OS are you running against? can you share the 'simple play'?

Ubuntu 14.04, although, in an LXC container, but I can ssh into that
container, and "sudo apt-get install tmux", and the sysctl module does work.
As far as ansible is concerned, that container is just another Ubuntu machine:

main.yaml in role:
- name: swappiness
sysctl: name=vm.swappiness value=0 reload=yes checks=none

- name: install important packages
apt: name=tmux


site.yaml
- name: Apply base Linux config
hosts: all
gather_facts: no
sudo: yes
remote_user: yves

roles:
- baselinux


The command I use to run it:
ansible-playbook --user yves -K site.yaml

Yves Dorfsman

unread,
May 16, 2015, 1:37:39 PM5/16/15
to ansible...@googlegroups.com

Ok, solved, the issue was with submodules, I did:

git submodule update --init lib/ansible/modules/core
git submodule update --init lib/ansible/modules/extras

and it works now. I think it was using the core modules from an old version.

I had not used ansible for a while, and had not re-read the doc, I see it now:

http://docs.ansible.com/intro_installation.html
git pull --rebase
git submodule update --init --recursive
Reply all
Reply to author
Forward
0 new messages