From 2d0565b072943eccf81e2636d3d5adcc75bacd18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 28 Mar 2017 12:00:32 +0200 Subject: [PATCH] vagrant: add debug option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If debug is set to true in vagrant_variables.yml then during the vagrant provision phase Ansible will run with -vvvv option Signed-off-by: Sébastien Han --- Vagrantfile | 43 ++++++++++++++++++------------------ vagrant_variables.yml.sample | 3 +++ 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 3df65f4b9..fd1bfbedc 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,30 +5,29 @@ require 'yaml' require 'time' VAGRANTFILE_API_VERSION = '2' -DEBUG = false - config_file=File.expand_path(File.join(File.dirname(__FILE__), 'vagrant_variables.yml')) settings=YAML.load_file(config_file) -LABEL_PREFIX = settings['label_prefix'] ? settings['label_prefix'] + "-" : "" -NMONS = settings['mon_vms'] -NOSDS = settings['osd_vms'] -NMDSS = settings['mds_vms'] -NRGWS = settings['rgw_vms'] -NNFSS = settings['nfs_vms'] -RESTAPI = settings['restapi'] -NRBD_MIRRORS = settings['rbd_mirror_vms'] -CLIENTS = settings['client_vms'] -NISCSI_GWS = settings['iscsi_gw_vms'] -PUBLIC_SUBNET = settings['public_subnet'] -CLUSTER_SUBNET = settings['cluster_subnet'] -BOX = settings['vagrant_box'] -BOX_URL = settings['vagrant_box_url'] -SYNC_DIR = settings['vagrant_sync_dir'] -MEMORY = settings['memory'] -ETH = settings['eth'] -DOCKER = settings['docker'] -USER = settings['ssh_username'] +LABEL_PREFIX = settings['label_prefix'] ? settings['label_prefix'] + "-" : "" +NMONS = settings['mon_vms'] +NOSDS = settings['osd_vms'] +NMDSS = settings['mds_vms'] +NRGWS = settings['rgw_vms'] +NNFSS = settings['nfs_vms'] +RESTAPI = settings['restapi'] +NRBD_MIRRORS = settings['rbd_mirror_vms'] +CLIENTS = settings['client_vms'] +NISCSI_GWS = settings['iscsi_gw_vms'] +PUBLIC_SUBNET = settings['public_subnet'] +CLUSTER_SUBNET = settings['cluster_subnet'] +BOX = settings['vagrant_box'] +BOX_URL = settings['vagrant_box_url'] +SYNC_DIR = settings['vagrant_sync_dir'] +MEMORY = settings['memory'] +ETH = settings['eth'] +DOCKER = settings['docker'] +USER = settings['ssh_username'] +DEBUG = settings['debug'] ASSIGN_STATIC_IP = !(BOX == 'openstack' or BOX == 'linode') DISABLE_SYNCED_FOLDER = settings.fetch('vagrant_disable_synced_folder', false) @@ -111,7 +110,7 @@ ansible_provision = proc do |ansible| end if DEBUG then - ansible.verbose = '-vvv' + ansible.verbose = '-vvvv' end ansible.limit = 'all' end diff --git a/vagrant_variables.yml.sample b/vagrant_variables.yml.sample index 4d3963326..2f658624b 100644 --- a/vagrant_variables.yml.sample +++ b/vagrant_variables.yml.sample @@ -62,3 +62,6 @@ vagrant_sync_dir: /home/vagrant/sync os_tuning_params: - { name: kernel.pid_max, value: 4194303 } - { name: fs.file-max, value: 26234859 } + +# Debug mode, runs Ansible with -vvvv +debug: false