Can't specify Ansible verbosity as a molecule option
See original GitHub issueApologies if this is working as intended. I’ve tried to search for it but didn’t see anywhere that this was a deprecation change.
Specifying the vvv: true
option on the provider section of a molecule.yml
has no effect even when molecule
is ran with or without the --debug
flag.
The documentation, under the section which explains how to override playbook files, shows the following snippet:
provisioner:
name: ansible
options:
vvv: True
playbooks:
create: create.yml
converge: converge.yml
destroy: destroy.yml
Using vvv: True
has no effect. Using vvv: true
also has no effect. This used to work on previous molecule versions (3.0.x if I recall correctly).
I’m aware that there are alternatives, such as:
- Pass the desired verbosity to the
molecule
command (molecule -vvv converge ...
). - Pass the desired verbosity as an Ansible argument to molecule (
molecule converge -- -vvv
). - Specify the desired verbosity on an environment variable (
ANSIBLE_VERBOSITY: '3'
).
I’m opening this issue just to clarify wether this is an intentional change or not. In case it is I guess that that documentation should be fixed.
Issue Type
- Bug report
Molecule and Ansible details
ansible [core 2.11.1]
config file = None
configured module search path = ['/home/hector/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/hector/.local/lib/python3.8/site-packages/ansible
ansible collection location = /home/hector/.ansible/collections:/usr/share/ansible/collections
executable location = /home/hector/.local/bin/ansible
python version = 3.8.5 (default, May 27 2021, 13:30:53) [GCC 9.3.0]
jinja version = 2.11.2
libyaml = True
molecule 3.3.4 using python 3.8
ansible:2.11.1
delegated:3.3.4 from molecule
docker:0.3.3 from molecule_docker
vagrant:0.6.1 from molecule_vagrant
Molecule installation method (one of):
- pip
Ansible installation method (one of):
- pip
Detail any linters or test runners used:
- yamllint
- ansible-lint
- gitlab-runner and on local development aswell
Desired Behavior
Either the documentation should not provide examples with the vv
option and say that option does not work or specifying the options v
, vv
or vvv
, … in the molecule file should pass the desired verbosity to the ansible-playbook
command.
Actual Behaviour
ansible-playbook
is ran without verbosity (the -vvv
parameter).
There’s a minimum complete verifiable example in this repo.
This is the output of a molecule --debug converge
with the vvv: true
option set (note that no -vvv
flag is passed to ansible-playbook
):
COMMAND: ansible-playbook --diff --inventory /home/hector/.cache/molecule/molecule_bug_vvv/default/inventory --skip-tags molecule-notest,notest /home/hector/repos/github/molecule/molecule_bug_vvv/molecule/default/converge.yml
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [python]
TASK [Include molecule_bug_vvv] ************************************************
TASK [molecule_bug_vvv : This is a command that shows some output] *************
changed: [python]
PLAY RECAP *********************************************************************
python : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:7 (4 by maintainers)
Also faced the same problem, passing env to
provisioner
seems to work fine:Hi @hluaces, I’m using
molecule test
instead ofmolecule converge
. The first option you proposed has the same effect as usingANSIBLE_VERBOSITY=3
while the second doesn’t work withmolecule test
.