From 0289ab986c053f7d3bc825142c82a07bcf0ae3ec Mon Sep 17 00:00:00 2001 From: Tim O'Guin Date: Wed, 4 Mar 2015 15:05:24 -0700 Subject: [PATCH 1/2] Salt Provisioner: Added a 'custom' option to install_type to allow more flexibility in passing arguments to the bootstrap script. Updated the docs. --- plugins/provisioners/salt/provisioner.rb | 6 +++++- website/docs/source/v2/provisioning/salt.html.md | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index 87af7cc7d..497acd6ba 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -135,7 +135,11 @@ module VagrantPlugins end if @config.install_type - options = "%s %s" % [options, @config.install_type] + # Allow passing install_args as an arbitrary string rather + # than trying to format it based on known options + if @config.install_type != "custom" + options = "%s %s" % [options, @config.install_type] + end end if @config.install_args diff --git a/website/docs/source/v2/provisioning/salt.html.md b/website/docs/source/v2/provisioning/salt.html.md index 4e832fb8e..3c403b9ef 100644 --- a/website/docs/source/v2/provisioning/salt.html.md +++ b/website/docs/source/v2/provisioning/salt.html.md @@ -55,17 +55,20 @@ on this machine. Not supported on Windows. * `install_syndic` (boolean) - Install the salt-syndic, default `false`. Not supported on Windows. -* `install_type` (stable | git | daily | testing) - Whether to install from a +* `install_type` (stable | git | daily | testing | custom) - Whether to install from a distribution's stable package manager, git tree-ish, daily ppa, or testing repository. +The custom type allows passing an arbitrary string of arguments via `install_args` +rather than formatting the arguments based on known install types. Not supported on Windows. * `install_args` (develop) - When performing a git install, -you can specify a branch, tag, or any treeish. Not supported on Windows. +you can specify a branch, tag, or any treeish. If using the `custom` install type, +you can also specify a different repository to install from. +Not supported on Windows. * `always_install` (boolean) - Installs salt binaries even if they are already detected, default `false` - * `bootstrap_options` (string) - Additional command-line options to pass to the bootstrap script. From 72e63767ac5807277dfe7f2202d3ab25804fe0df Mon Sep 17 00:00:00 2001 From: Tim O'Guin Date: Mon, 1 Jun 2015 10:37:41 -0500 Subject: [PATCH 2/2] Salt Provisioner: refactor custom install_type option to add install_command instead --- plugins/provisioners/salt/provisioner.rb | 13 ++++++++----- website/docs/source/v2/provisioning/salt.html.md | 8 +++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index 6ec099f1e..118997752 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -136,17 +136,20 @@ module VagrantPlugins end if @config.install_type - # Allow passing install_args as an arbitrary string rather - # than trying to format it based on known options - if @config.install_type != "custom" - options = "%s %s" % [options, @config.install_type] - end + options = "%s %s" % [options, @config.install_type] end if @config.install_args options = "%s %s" % [options, @config.install_args] end + if @config.install_command + # If this is defined, we will ignore both install_type and + # install_args and use this instead. Every necessary command option + # will need to be specified by the user. + options = @config.install_command + end + if @config.verbose @machine.env.ui.info "Using Bootstrap Options: %s" % options end diff --git a/website/docs/source/v2/provisioning/salt.html.md b/website/docs/source/v2/provisioning/salt.html.md index 50bc47656..7dbd9777f 100644 --- a/website/docs/source/v2/provisioning/salt.html.md +++ b/website/docs/source/v2/provisioning/salt.html.md @@ -55,10 +55,8 @@ on this machine. Not supported on Windows. * `install_syndic` (boolean) - Install the salt-syndic, default `false`. Not supported on Windows. -* `install_type` (stable | git | daily | testing | custom) - Whether to install from a +* `install_type` (stable | git | daily | testing) - Whether to install from a distribution's stable package manager, git tree-ish, daily ppa, or testing repository. -The custom type allows passing an arbitrary string of arguments via `install_args` -rather than formatting the arguments based on known install types. Not supported on Windows. * `install_args` (develop) - When performing a git install, @@ -66,6 +64,10 @@ you can specify a branch, tag, or any treeish. If using the `custom` install typ you can also specify a different repository to install from. Not supported on Windows. +* `install_command` (string) - Allow specifying an arbitrary string of arguments +to the bootstrap script. This will completely ignore `install_type` and `install_args` +to allow more flexibility with the bootstrap process. + * `always_install` (boolean) - Installs salt binaries even if they are already detected, default `false`