CoffeeITWorks / ansible_burp2_server

Ansible role to deploy burp2 server
MIT License
10 stars 9 forks source link

/bin/sh: burp: command not found on read burp installed version task #76

Closed guimaluf closed 3 years ago

guimaluf commented 3 years ago

I'm installing burp in CentOS using both server and client burp roles. However, I'm getting

TASK [coffeeitworks.burp2_client : read burp installed version] *******************************
fatal: [example.com]: FAILED! => {
    "changed": false,
    "cmd": "burp -V",
    "delta": "0:00:00.003200",
    "end": "2021-05-18 09:28:37.151225",
    "rc": 127,
    "start": "2021-05-18 09:28:37.148025"
}

STDERR:

/bin/sh: burp: command not found

MSG:

non-zero return code

I'm using the defaults variables which installs burp on /usr/local/sbin. It seems to be an ansible normal and expected behaviour.

Remember that sudo sanitizes the environment when switching users, which is why you end up with a minimal default PATH.

This only happens when become: true is set.

(venv) [gb637@seed ]$ ansible -m shell gb637-backup -a "which burp"
gb637-backup | CHANGED | rc=0 >>
/usr/local/sbin/burp
(venv) [gb637@seed ]$ ansible -m shell gb637-backup -a "which burp" -b
gb637-backup | FAILED | rc=1 >>
which: no burp in (/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin/)non-zero return code
(venv) [gb637@seed ]$ 

I believe a sane solution would be to add become: false to that specific task.

This affects burp2_client role as well: https://github.com/CoffeeITWorks/ansible_burp2_client/issues/31

pablodav commented 3 years ago

Should be resolved in latest version, thanks for your report and contribution!

Please confirm I was spending some time on improving the tests and migrating to github actions.