Move puppet version to puppet.sh
This commit is contained in:
Родитель
e9b1b37944
Коммит
5daa1e7461
|
@ -48,8 +48,4 @@ This is an explanation of the [existing scripts supplied by octocatalog-diff](/s
|
|||
|
||||
- [`puppet.sh`](/scripts/puppet)
|
||||
|
||||
Runs puppet (with additional command line arguments), generally used to compile a catalog.
|
||||
|
||||
- [`puppet-version.sh`](/scripts/puppet-version)
|
||||
|
||||
Runs `puppet --version` to determine the version of Puppet being used.
|
||||
Runs puppet (with additional command line arguments), generally used to compile a catalog or determine the Puppet version.
|
||||
|
|
|
@ -18,9 +18,11 @@ module OctocatalogDiff
|
|||
raise ArgumentError, 'Puppet binary was not supplied' if puppet.nil?
|
||||
raise Errno::ENOENT, "Puppet binary #{puppet} doesn't exist" unless File.file?(puppet)
|
||||
|
||||
logger = options[:logger] || Logger.new(StringIO.new)
|
||||
|
||||
sr_opts = {
|
||||
logger: Logger.new(StringIO.new),
|
||||
default_script: 'puppet-version/puppet-version.sh',
|
||||
logger: logger,
|
||||
default_script: 'puppet/puppet.sh',
|
||||
override_script_path: options[:override_script_path]
|
||||
}
|
||||
|
||||
|
@ -29,6 +31,7 @@ module OctocatalogDiff
|
|||
sr_run_opts = {
|
||||
:working_dir => File.dirname(puppet),
|
||||
:pass_env_vars => options[:pass_env_vars],
|
||||
:argv => '--version',
|
||||
'OCD_PUPPET_BINARY' => puppet
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script to determine the Puppet version.
|
||||
|
||||
if [ -z "$OCD_PUPPET_BINARY" ]; then
|
||||
echo "Error: PUPPET_BINARY must be set"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
"$OCD_PUPPET_BINARY" --version
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script to run Puppet. The default implementation here is simply to pass
|
||||
# through the command line arguments (which are likely to be numerous when
|
||||
# compiling a catalog).
|
||||
|
||||
if [ -z "$OCD_PUPPET_BINARY" ]; then
|
||||
echo "Error: PUPPET_BINARY must be set"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
"$OCD_PUPPET_BINARY" "$@"
|
Загрузка…
Ссылка в новой задаче