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

Do not pass ansible tags to non-converge playbooks #2187

Closed
z0mbix opened this issue Jul 29, 2019 · 4 comments
Closed

Do not pass ansible tags to non-converge playbooks #2187

z0mbix opened this issue Jul 29, 2019 · 4 comments

Comments

@z0mbix
Copy link

z0mbix commented Jul 29, 2019

Issue Type

  • Feature request

Molecule and Ansible details

ansible --version && molecule --version
ansible 2.6.3
  config file = None
  configured module search path = ['/Users/z0mbix/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/z0mbix/.local/share/virtualenvs/ansible-pZbkGz2G/lib/python3.6/site-packages/ansible
  executable location = /Users/z0mbix/.local/share/virtualenvs/ansible-pZbkGz2G/bin/ansible
  python version = 3.6.8 (default, Jul 16 2019, 16:54:51) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)]
molecule, version 2.20.2

Molecule installation method (one of):

  • pip

Ansible installation method (one of):

  • pip

Desired Behavior

Currently, when setting an ansible tag, this is applied to all playbooks

DEBUG: COMMAND
/Users/z0mbix/.local/share/virtualenvs/ansible-pZbkGz2G/bin/ansible-playbook --skip-tags=molecule-notest,notest --diff --tags=build --inventory=/var/folders/tg/6c4d_rj10vnb_lb2p6nw72_m0000gn/T/molecule/newrelic/build/inventory /Users/z0mbix/Work/b2c2/ansible/roles/newrelic/molecule/build/prepare.yml -vvv

    ansible-playbook 2.6.3
      config file = /var/folders/tg/6c4d_rj10vnb_lb2p6nw72_m0000gn/T/molecule/newrelic/build/ansible.cfg
      configured module search path = ['/Users/z0mbix/.local/share/virtualenvs/ansible-pZbkGz2G/lib/python3.6/site-packages/molecule/provisioner/ansible/plugins/libraries', '/var/folders/tg/6c4d_rj10vnb_lb2p6nw72_m0000gn/T/molecule/newrelic/build/library', '/Users/z0mbix/Work/b2c2/ansible/roles/newrelic/library']
      ansible python module location = /Users/z0mbix/.local/share/virtualenvs/ansible-pZbkGz2G/lib/python3.6/site-packages/ansible
      executable location = /Users/z0mbix/.local/share/virtualenvs/ansible-pZbkGz2G/bin/ansible-playbook
      python version = 3.6.8 (default, Jul 16 2019, 16:54:51) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)]
    Using /var/folders/tg/6c4d_rj10vnb_lb2p6nw72_m0000gn/T/molecule/newrelic/build/ansible.cfg as config file
    Parsed /var/folders/tg/6c4d_rj10vnb_lb2p6nw72_m0000gn/T/molecule/newrelic/build/inventory/ansible_inventory.yml inventory source with yaml plugin

    PLAYBOOK: prepare.yml **********************************************************
    1 plays in /Users/z0mbix/Work/b2c2/ansible/roles/newrelic/molecule/build/prepare.yml

    PLAY [Prepare] *****************************************************************
    META: ran handlers
    META: ran handlers
    META: ran handlers

    PLAY RECAP *********************************************************************```

This then breaks molecule in a number of ways:

  • It does not install dependencies from meta/main.yml
  • It will not apply tasks from the prepare playbook which I always want to run

Ideally, tags should only be applied to the converge stage.

I have tried setting the tag in molecule.yml and on the cli with:

molecule --debug converge -s build -- --tags build
@ssbarnea
Copy link
Member

What is the problem with current behavior? Can you give an example that motivates a change in that area?

@z0mbix
Copy link
Author

z0mbix commented Jul 29, 2019

@ssbarnea I've updated the description above.

@dericcrago
Copy link

@z0mbix - the opposite was needed on at least destroy before #1906

@z0mbix
Copy link
Author

z0mbix commented Aug 1, 2019

I'll close this, as I've hacked my way around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants