question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't specify Ansible verbosity as a molecule option

See original GitHub issue

Apologies 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:open
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
it-sovacommented, Jul 12, 2022

Also faced the same problem, passing env to provisioner seems to work fine:

...
provisioner:
  name: ansible
  env:
    ANSIBLE_VERBOSITY: 3
...
1reaction
jrgoldfinemiddletoncommented, Jul 8, 2021

Hi @hluaces, I’m using molecule test instead of molecule converge. The first option you proposed has the same effect as using ANSIBLE_VERBOSITY=3 while the second doesn’t work with molecule test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mastering Molecule - Sorin Sbarnea's Crib
Controlling verbosity Few things you may need to master quickly while working with molecule scenarios: how to control verbosity of different ...
Read more >
ansible.posix.synchronize module – A wrapper around rsync ...
Specify additional rsync options by passing in an array. ... Inspect the verbose output to validate the destination user/host/path are what was expected....
Read more >
Can I make ansible no_log default based on ansible verbosity ...
You can template the no_log option based on the verbosity level (which is exposed in ansible_verbosity , at least as of 2.9).
Read more >
Common Ansible Options - Vagrant - HashiCorp Developer
By default this option is set to "auto" . If Vagrant is not able to detect any supported Ansible version, it will fall...
Read more >
1866261 – Need to indicate the intentional behavior for ...
Description of problem: Failed to run the Ansible operator by using the `make run`. Version-Release number of selected component (if applicable): ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found