Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Add debug mode and hide deprecation warnings by default #1563

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

oxyc
Copy link
Collaborator

@oxyc oxyc commented Sep 23, 2017

Issue #1553. I'm assuming you're not going to bump the version requirements of all your roles to 2.4.0. If you are we could drop the conditional ansible.cfg config.

  • ansible.cfg was never loaded with Vagrant. It would need to reside next to the Vagrantfile to do so.
  • control_path no longer needs to be set in ansible.cfg (read 633810a)
  • Hide Vagrant 2.0+ messages about ansible auto compatibility mode. @geerlingguy could you test this on vagrant < 2.0 to make sure it works? (read docs)
  • Add support for DRUPALVM_DEBUG environment variable to easily debug ansible tasks (see examples in 93abae9)
  • Hide deprecation warnings by default, unless DRUPALVM_DEBUG is truthy. I don't think users need to care about such things. This puts a bit more pressure on developers to stay up-to-date with ansible releases though but that shouldn't be a problem for @geerlingguy :) He has 1 or 2 other roles he maintains and learns about these things from. If you prefer I can drop this commit though.

@oxyc
Copy link
Collaborator Author

oxyc commented Sep 23, 2017

I especially like the ability to tell users in the issue queue to run DRUPALVM_DEBUG=v vagrant up

@geerlingguy
Copy link
Owner

My main question is what does the debug .cfg file provide over the normal one? It seems like it would just be the first few messages at the top of the Ansible playbook output—but is there any more? Maybe it's just my late-night read of the code...

@geerlingguy
Copy link
Owner

I do like the idea of hiding the deprecation warnings. Since 2.2, it seems like Ansible will be popping deprecation warnings for some commonly-used features that don't have a backwards-compatible fix, so either we live with the warnings, I break compatibility with Ansible < latest, or we do this.

Since Drupal VM is an end-user-oriented system, it shouldn't be showing these more playbook-developer-centric messages since the end user can't really do anything about it.

@oxyc
Copy link
Collaborator Author

oxyc commented Sep 26, 2017

My main question is what does the debug .cfg file provide over the normal one? It seems like it would just be the first few messages at the top of the Ansible playbook output—but is there any more?

No that's it but I wasn't aware of disabling depreciation notices any other way than with a config file. Is it possible somehow?

@oxyc
Copy link
Collaborator Author

oxyc commented Sep 26, 2017

Also as I'm fixing the bug where the ansible.cfg isn't taken into account at all currently, I thought it was better to introduce a new ansible.debug.cfg vs ansible.cfg setup so it's more clear. Let me know if you come up with something better.

@geerlingguy
Copy link
Owner

I'll take a second look soon since I finally had some time to finish up the 4.7.0 release.

@geerlingguy
Copy link
Owner

geerlingguy commented Apr 24, 2018

@oxyc - This looks great! One last suggestion—can we add something in the docs about setting DRUPALVM_DEBUG=v to enable debug mode?

@geerlingguy
Copy link
Owner

I'm closing PRs which have conflicts or are failing builds and are older than 6 months old, to tidy up the Drupal VM PR queue; please create a new PR against the latest master branch if you feel this is still an important fix or feature for Drupal VM. Thank you!

@geerlingguy
Copy link
Owner

(Note that I'm still for these changes, with the small addition of something about debugging with DRUPALVM_DEBUG=v.)

@oxyc
Copy link
Collaborator Author

oxyc commented Dec 29, 2018

I'll reopen this and work on the docs (soon!)

@oxyc oxyc reopened this Dec 29, 2018
@oxyc oxyc self-assigned this Dec 29, 2018
This defaults to a hashed string of the hostname, port and username. The
hash mitigates a common problem users found with long hostames and the
conventional %(directory)s/ansible-ssh-%%h-%%p-%%r format. In those
cases, a "too long for Unix domain socket" ssh error would occur.
Examples:

- DRUPALVM_DEBUG=1 vagrant provision (ansible-playbook -v)
- DRUPALVM_DEBUG=v vagrant provision (ansible-playbook -v)
- DRUPALVM_DEBUG=vvv vagrant provision (ansible-playbook -vvv)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants