From e5a2f1e8b71c64fc8ebb23560f95c0b21af5c384 Mon Sep 17 00:00:00 2001 From: Matthew Johnson Date: Fri, 4 Oct 2013 02:58:49 -0400 Subject: [PATCH] fix ansible-playbook runs when verbosity is not specified --- plugins/provisioners/ansible/provisioner.rb | 7 ++----- website/docs/source/v2/provisioning/ansible.html.md | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/provisioners/ansible/provisioner.rb b/plugins/provisioners/ansible/provisioner.rb index d2e27f8a6..ecaca7419 100644 --- a/plugins/provisioners/ansible/provisioner.rb +++ b/plugins/provisioners/ansible/provisioner.rb @@ -27,7 +27,7 @@ module VagrantPlugins options << "--inventory-file=#{self.setup_inventory_file}" options << "--sudo" if config.sudo options << "--sudo-user=#{config.sudo_user}" if config.sudo_user - options << "#{self.get_verbosity_argument}" + options << "#{self.get_verbosity_argument}" if config.verbose options << "--ask-sudo-pass" if config.ask_sudo_pass options << "--tags=#{as_list_argument(config.tags)}" if config.tags options << "--skip-tags=#{as_list_argument(config.skip_tags)}" if config.skip_tags @@ -85,13 +85,10 @@ module VagrantPlugins def get_verbosity_argument if config.verbose.to_s =~ /^v+$/ - # Hopefully ansible-playbook accepts "silly" arguments like '-vvvvv', as '-vvv' + # ansible-playbook accepts "silly" arguments like '-vvvvv' as '-vvvv' for now return "-#{config.verbose}" elsif config.verbose.to_s == 'extra' return '-vvv' - else - # fall back to default verbosity (which is no verbosity) - return '' end end diff --git a/website/docs/source/v2/provisioning/ansible.html.md b/website/docs/source/v2/provisioning/ansible.html.md index e72588e33..feaf7eb20 100644 --- a/website/docs/source/v2/provisioning/ansible.html.md +++ b/website/docs/source/v2/provisioning/ansible.html.md @@ -132,9 +132,11 @@ These variables take the highest precedence over any other variables. by the sudo command. * `ansible.ask_sudo_pass` can be set to `true` to require Ansible to prompt for a sudo password. * `ansible.limit` can be set to a string or an array of machines or groups from the inventory file to further narrow down which hosts are affected. -* `ansible.verbose` can be set to increase Ansible's verbosity to obtain full detailed logging. By default, Vagrant uses Ansible default verbosity (`--verbose` or `-v`). By enabling this option following higher verbosity can be activated: +* `ansible.verbose` can be set to increase Ansible's verbosity to obtain detailed logging: + * `'v'`, verbose mode * `'vv'` - * `'vvv'`, also aliased as `'extra'` + * `'vvv'`, more (aliased as `'extra'`) + * `'vvvv'`, connection debugging * `ansible.tags` can be set to a string or an array of tags. Only plays, roles and tasks tagged with these values will be executed. * `ansible.skip_tags` can be set to a string or an array of tags. Only plays, roles and tasks that *do not match* these values will be executed. * `ansible.start_at_task` can be set to a string corresponding to the task name where the playbook provision will start.