Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filesystem module can't find mkfs on centos6.4 #2983

Closed
davidbirdsong opened this issue May 23, 2013 · 3 comments
Closed

filesystem module can't find mkfs on centos6.4 #2983

davidbirdsong opened this issue May 23, 2013 · 3 comments

Comments

@davidbirdsong
Copy link

filesystem doesn't work on my vanilla Centos6.4 where mkfs is at /bin/mkfs.

TASK: [mkfs on /dev/loop0] **************************************************** 
<10.100.1.215> ESTABLISH CONNECTION FOR USER: david on PORT 22 TO 10.100.1.215
<10.100.1.215> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1369269285.05-199335482779369 && chmod a+rx $HOME/.ansible/tmp/ansible-1369269285.05-199335482779369 && echo $HOME/.ansible/tmp/ansible-1369269285.05-199335482779369'
<10.100.1.215> REMOTE_MODULE filesystem force=yes fstype=ext4 dev=/dev/loop0
<10.100.1.215> PUT /tmp/tmpB5EWnM TO /home/david/.ansible/tmp/ansible-1369269285.05-199335482779369/filesystem
<10.100.1.215> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=<snip>] password: " -u root /bin/sh -c '"'"'/usr/bin/python /home/david/.ansible/tmp/ansible-1369269285.05-199335482779369/filesystem; rm -rf /home/david/.ansible/tmp/ansible-1369269285.05-199335482779369/ >/dev/null 2>&1'"'"''
failed: [10.100.1.215] => {"err": "/bin/sh: mkfs: command not found\n", "failed": true, "rc": 127}
msg: Creating filesystem ext4 on device '/dev/loop0' failed

FATAL: all hosts have already failed -- aborting

I include the following even though I'm sure paramiko is handling the remote shell in a completely different manner.

[david@ops-1 staging{master}]$ ssh 10.100.1.215 "env" | grep PATH 
PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin
[david@ops-1 staging{master}]$ ssh 10.100.1.215 "/bin/sh -c 'env'" | grep PATH 
PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin
@mpdehaan
Copy link
Contributor

Sounds easy enough to fix, we just need to let it use the find_module code in ansible module common better.

Thanks for the heads up!

@davidbirdsong
Copy link
Author

oops. mkfs is at /sbin/mkfs. i'll bet find_module doesn't need to know that though.

@mpdehaan
Copy link
Contributor

Yeah I was a bit curious about why you had said /bin.

We can teach it to look there too.

mpdehaan added a commit that referenced this issue May 30, 2013
Use get_bin_path to find mkfs command (issue #2983)
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants