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

Feature request, setting no_log from playbook.yml #1346

Closed
rgarrigue opened this issue Jun 26, 2018 · 10 comments
Closed

Feature request, setting no_log from playbook.yml #1346

rgarrigue opened this issue Jun 26, 2018 · 10 comments

Comments

@rgarrigue
Copy link
Contributor

rgarrigue commented Jun 26, 2018

Issue Type

  • Feature request

Molecule and Ansible details

ansible 2.5.5
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/gitlab-runner/builds/54a89bc8/0/r.garrigue.ext/ansible-role-webenv/virtenv/lib/python3.6/site-packages/ansible
  executable location = /home/gitlab-runner/builds/54a89bc8/0/r.garrigue.ext/ansible-role-webenv/virtenv/bin/ansible
  python version = 3.6.5 (default, Apr 10 2018, 17:08:37) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

molecule, version 2.15.0

Molecule installation method (one of):

  • pip

Ansible installation method (one of):

  • pip

Desired Behavior

I'ld like to be able to set no_log: false from molecule/default/playbook.yml. Debug is way too verbose for me, I just wan't to see the censored message

image

@retr0h
Copy link
Contributor

retr0h commented Jun 26, 2018

You are free to modify your create/destroy playbooks as you choose. However, this isn't a default we will be setting. Again, you are free to change your own setup how you see fit.

@retr0h retr0h closed this as completed Jun 26, 2018
@retr0h retr0h added the invalid label Jun 26, 2018
@rgarrigue
Copy link
Contributor Author

@retr0h I don't have the above mentionned playbooks in the 2.15.0 generated default scenario

image

Your soft, your call, though if there's no way to adjust verbosity I'm curious to know how you spot the issues in a debug output. As for me I can't run molecule on my windows workstation, I only have the log shown by Gitlab CI without coloration, I'm looking for "error" with firefox's Ctrl-F... not exactly efficient :-/

@retr0h
Copy link
Contributor

retr0h commented Jun 27, 2018

Let me think about this more.

@retr0h
Copy link
Contributor

retr0h commented Jul 16, 2018

I don't have the cycles to implement this. Curious if anyone else does.

retr0h added a commit to retr0h/molecule that referenced this issue Jul 24, 2018
Provisioner will take a log option to enable/disable Ansible
log output.

Fixes: ansible#1346
@retr0h retr0h added the v2.17 label Jul 24, 2018
@retr0h
Copy link
Contributor

retr0h commented Jul 24, 2018

@rgarrigue when 2.17 lands you can use this feature. Update your molecule.yml's provisioner section with:

provisioner:
  name: ansible
  log: true

retr0h added a commit that referenced this issue Jul 24, 2018
Provisioner will take a log option to enable/disable Ansible
log output.

Fixes: #1346
@rgarrigue
Copy link
Contributor Author

rgarrigue commented Jul 26, 2018 via email

@rgarrigue
Copy link
Contributor Author

@retr0h I tried this right now. All good for me, though I saw one glitch

    TASK [Create Dockerfiles from image names] *************************************
    failed: [localhost] (item={'name': 'molecule-skeleton-rhel6', 'image': 'registry.access.redhat.com/rhel6:6.9'}) => {"changed": f                                                alse, "checksum": "1c9e5daeefc9b01c5e2faca80af7a70ff6c18602", "item": {"image": "registry.access.redhat.com/rhel6:6.9", "name": "mol                                                ecule-skeleton-rhel6"}, "msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"}
    failed: [localhost] (item={'name': 'molecule-skeleton-rhel7', 'image': 'registry.access.redhat.com/rhel7:7.4', 'privileged': Tru                                                e, 'volumes': ['/sys/fs/cgroup:/sys/fs/cgroup:ro'], 'command': '/usr/sbin/init'}) => {"changed": false, "checksum": "5a1c7daa39a0aea                                                43d343372c1e6f2e280cb4c74", "item": {"command": "/usr/sbin/init", "image": "registry.access.redhat.com/rhel7:7.4", "name": "molecule                                                -skeleton-rhel7", "privileged": true, "volumes": ["/sys/fs/cgroup:/sys/fs/cgroup:ro"]}, "msg": "Aborting, target uses selinux but py                                                thon bindings (libselinux-python) aren't installed!"}
    failed: [localhost] (item={'name': 'molecule-skeleton-centos7', 'image': 'centos:7', 'privileged': True, 'volumes': ['/sys/fs/cg                                                roup:/sys/fs/cgroup:ro'], 'command': '/usr/sbin/init'}) => {"changed": false, "checksum": "909beb3571163bdae16f6b9eb998b0a17d67fbab"                                                , "item": {"command": "/usr/sbin/init", "image": "centos:7", "name": "molecule-skeleton-centos7", "privileged": true, "volumes": ["/                                                sys/fs/cgroup:/sys/fs/cgroup:ro"]}, "msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"                                                }
    fatal: [localhost]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for th                                                is result", "changed": false}

The last message shouldn't be here, though I dunno if it's a task not taking in account the no_log or something else.

@retr0h
Copy link
Contributor

retr0h commented Aug 20, 2018

Not sure thats something Molecule controls... Everywhere that references no_log has been changed.

[jodewey:~/git/molecule_2] [molecule2-env-2.7.13] master+ ± ag no_log: | grep -v molecule_yml.provisioner.log
[jodewey:~/git/molecule_2] [molecule2-env-2.7.13] master+ 1 ±

@ssbarnea
Copy link
Member

ssbarnea commented Jun 7, 2019

To my surprise, only discovered that adding log: true to root level in molecule does not also activates it for the provisioner. I am not sure if this is by design or a bug, but I clearly find it confusing, especially as docker provisioning failures are very common with ansible.

@x473673
Copy link

x473673 commented Feb 4, 2020

What about turning no_log: "{{ molecule_no_log }}" to no_log: "false" in create.yml file? Worked for me

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

4 participants