go-ansible icon indicating copy to clipboard operation
go-ansible copied to clipboard

Set -v (VerboseV) not working

Open prakasa1904 opened this issue 1 year ago • 1 comments

I try to enable -v arg, but it not work, the command always missing -v args. Below is the command output:

ansible-playbook  --extra-vars @/home/cloud.terpusat.com/my-variable.json --inventory /home/cloud.terpusat.com/my-inventory.json --tags golang  --connection ssh --private-key /cloud.terpusat.com/my-key --user root  --become-method sudo cloud.terpusat.com/my-playbook.yml

but when use Verbose, the output will always use -vvvv args, which is not what I want:

ansible-playbook  --extra-vars @/home/cloud.terpusat.com/my-variable.json --inventory /home/cloud.terpusat.com/my-inventory.json --tags golang  -vvvv --connection ssh --private-key /cloud.terpusat.com/my-key --user root  --become-method sudo cloud.terpusat.com/my-playbook.yml

any trick on this, how to use -v / -vv arg ?

prakasa1904 avatar Jun 22 '24 08:06 prakasa1904

Hi @prakasa1904 ! Thanks for opening this issue!

Indeed, the String method in AnsiblePlaybookOptions does not cover all verbosity levels, and I will fix this. In the meantime, when generating the command options, setting the VerboseV attribute should correctly include the -v flag.

I keep you updated! Thanks!

apenella avatar Jun 26 '24 05:06 apenella

Hi @prakasa1904! Version v2.0.1 solves the issue with the String method, which returned the verbose flags incorrectly. However, as I mentioned, when go-ansible executes a command, it uses the GenerateCommandOptions method, instead, and the issue is not present there.

Will you need further help with this?

apenella avatar Jul 10 '24 06:07 apenella

I will close this issue as no further assistance is required.

apenella avatar Aug 16 '24 16:08 apenella