vagrant-clone 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.idea/.rakeTasks +7 -0
- data/.idea/inspectionProfiles/Project_Default.xml +6 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/runConfigurations/clone.xml +21 -0
- data/.idea/runConfigurations/libvirt.xml +21 -0
- data/.idea/vagrant-clone.iml +114 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +948 -0
- data/Gemfile +9 -3
- data/Gemfile.lock +123 -37
- data/Rakefile +2 -1
- data/Vagrantfile +9 -0
- data/cookbooks/apt/CHANGELOG.md +321 -0
- data/cookbooks/apt/CONTRIBUTING.md +2 -0
- data/cookbooks/apt/MAINTAINERS.md +15 -0
- data/cookbooks/apt/README.md +250 -0
- data/cookbooks/apt/attributes/default.rb +57 -0
- data/cookbooks/apt/files/15update-stamp +1 -0
- data/cookbooks/apt/files/apt-proxy-v2.conf +50 -0
- data/cookbooks/apt/libraries/helpers.rb +49 -0
- data/cookbooks/apt/libraries/matchers.rb +16 -0
- data/cookbooks/apt/metadata.json +1 -0
- data/cookbooks/apt/recipes/cacher-client.rb +52 -0
- data/cookbooks/apt/recipes/cacher-ng.rb +39 -0
- data/cookbooks/apt/recipes/default.rb +93 -0
- data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
- data/cookbooks/apt/resources/preference.rb +90 -0
- data/cookbooks/apt/templates/01proxy.erb +11 -0
- data/cookbooks/apt/templates/10dpkg-options.erb +8 -0
- data/cookbooks/apt/templates/10recommends.erb +3 -0
- data/cookbooks/apt/templates/20auto-upgrades.erb +5 -0
- data/cookbooks/apt/templates/50unattended-upgrades.erb +75 -0
- data/cookbooks/apt/templates/acng.conf.erb +275 -0
- data/cookbooks/apt/templates/unattended-upgrades.seed.erb +1 -0
- data/cookbooks/build-essential/.foodcritic +1 -0
- data/cookbooks/build-essential/CHANGELOG.md +257 -0
- data/cookbooks/build-essential/CONTRIBUTING.md +2 -0
- data/cookbooks/build-essential/MAINTAINERS.md +15 -0
- data/cookbooks/build-essential/README.md +134 -0
- data/cookbooks/build-essential/attributes/default.rb +21 -0
- data/cookbooks/build-essential/libraries/matchers.rb +9 -0
- data/cookbooks/build-essential/metadata.json +1 -0
- data/cookbooks/build-essential/recipes/_windows.rb +53 -0
- data/cookbooks/build-essential/recipes/default.rb +24 -0
- data/cookbooks/build-essential/resources/build_essential.rb +106 -0
- data/cookbooks/build-essential/resources/xcode_command_line_tools.rb +61 -0
- data/cookbooks/compat_resource/CHANGELOG.md +53 -0
- data/cookbooks/compat_resource/CONTRIBUTING.md +2 -0
- data/cookbooks/compat_resource/MAINTAINERS.md +16 -0
- data/cookbooks/compat_resource/README.md +60 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/constants.rb +47 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/delayed_evaluator.rb +40 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/core.rb +73 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/declare_resource.rb +315 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/platform_introspection.rb +292 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/recipe.rb +37 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/universal.rb +70 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/lazy_module_include.rb +98 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/notifying_block.rb +74 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/params_validate.rb +510 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/powershell_out.rb +117 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb +328 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb +713 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_repository.rb +269 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_update.rb +105 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/noop.rb +56 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/support/yum_repo.erb +132 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/systemd_unit.rb +253 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/yum_repository.rb +136 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb +164 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/action_class.rb +114 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_repository.rb +65 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_update.rb +52 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/systemd_unit.rb +81 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/yum_repository.rb +97 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource.rb +214 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource_builder.rb +174 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef.rb +29 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/mixin/properties.rb +8 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/exceptions.rb +10 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/log.rb +30 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb +17 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/node.rb +9 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/property.rb +15 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb +65 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe.rb +118 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe_hook.rb +20 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb +60 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource.rb +156 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb +167 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_list.rb +49 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_set.rb +49 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection.rb +103 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb +691 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb +153 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef.rb +33 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches.rb +41 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/property.rb +6 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/recipe.rb +8 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/resource/lwrp_base.rb +44 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/resource.rb +56 -0
- data/cookbooks/compat_resource/files/lib/chef_upstream_version.rb +3 -0
- data/cookbooks/compat_resource/files/lib/compat_resource.rb +35 -0
- data/cookbooks/compat_resource/libraries/autoload.rb +31 -0
- data/cookbooks/compat_resource/metadata.json +1 -0
- data/cookbooks/inifile_chef_gem/CHANGELOG.md +11 -0
- data/cookbooks/inifile_chef_gem/README.md +46 -0
- data/cookbooks/inifile_chef_gem/metadata.json +51 -0
- data/cookbooks/inifile_chef_gem/metadata.rb +11 -0
- data/cookbooks/inifile_chef_gem/resources/default.rb +28 -0
- data/cookbooks/mariadb/CHANGELOG.md +332 -0
- data/cookbooks/mariadb/README.md +225 -0
- data/cookbooks/mariadb/attributes/default.rb +199 -0
- data/cookbooks/mariadb/libraries/mariadb_conn_helper.rb +53 -0
- data/cookbooks/mariadb/libraries/mariadb_helper.rb +216 -0
- data/cookbooks/mariadb/libraries/matchers.rb +21 -0
- data/cookbooks/mariadb/metadata.json +1 -0
- data/cookbooks/mariadb/providers/configuration.rb +39 -0
- data/cookbooks/mariadb/recipes/_audit_plugin.rb +63 -0
- data/cookbooks/mariadb/recipes/_debian_galera.rb +62 -0
- data/cookbooks/mariadb/recipes/_debian_server.rb +78 -0
- data/cookbooks/mariadb/recipes/_mariadb_repository.rb +29 -0
- data/cookbooks/mariadb/recipes/_redhat_client.rb +27 -0
- data/cookbooks/mariadb/recipes/_redhat_galera.rb +55 -0
- data/cookbooks/mariadb/recipes/_redhat_server.rb +58 -0
- data/cookbooks/mariadb/recipes/client.rb +47 -0
- data/cookbooks/mariadb/recipes/config.rb +115 -0
- data/cookbooks/mariadb/recipes/default.rb +46 -0
- data/cookbooks/mariadb/recipes/devel.rb +41 -0
- data/cookbooks/mariadb/recipes/galera.rb +324 -0
- data/cookbooks/mariadb/recipes/plugins.rb +3 -0
- data/cookbooks/mariadb/recipes/repository.rb +45 -0
- data/cookbooks/mariadb/recipes/server.rb +157 -0
- data/cookbooks/mariadb/resources/configuration.rb +13 -0
- data/cookbooks/mariadb/resources/mysql2_gem.rb +25 -0
- data/cookbooks/mariadb/resources/replication.rb +192 -0
- data/cookbooks/mariadb/templates/default/conf.d.generic.erb +19 -0
- data/cookbooks/mariadb/templates/default/debian.cnf.erb +12 -0
- data/cookbooks/mariadb/templates/default/mariadb-server.seed.erb +13 -0
- data/cookbooks/mariadb/templates/default/mariadb_grants.erb +42 -0
- data/cookbooks/mariadb/templates/default/my.cnf.erb +210 -0
- data/cookbooks/mariadb/templates/default/root.cnf.erb +5 -0
- data/cookbooks/mingw/.foodcritic +1 -0
- data/cookbooks/mingw/CHANGELOG.md +50 -0
- data/cookbooks/mingw/CONTRIBUTING.md +2 -0
- data/cookbooks/mingw/MAINTAINERS.md +14 -0
- data/cookbooks/mingw/README.md +133 -0
- data/cookbooks/mingw/files/default/bash.bat +17 -0
- data/cookbooks/mingw/files/default/custom-upgrade.sh +23 -0
- data/cookbooks/mingw/files/default/custom_prefix.sh +13 -0
- data/cookbooks/mingw/files/default/pthread.h +719 -0
- data/cookbooks/mingw/files/default/time.h +297 -0
- data/cookbooks/mingw/libraries/_helper.rb +38 -0
- data/cookbooks/mingw/metadata.json +1 -0
- data/cookbooks/mingw/recipes/default.rb +19 -0
- data/cookbooks/mingw/resources/get.rb +56 -0
- data/cookbooks/mingw/resources/msys2_package.rb +139 -0
- data/cookbooks/mingw/resources/tdm_gcc.rb +114 -0
- data/cookbooks/ohai/.foodcritic +2 -0
- data/cookbooks/ohai/CHANGELOG.md +166 -0
- data/cookbooks/ohai/CONTRIBUTING.md +2 -0
- data/cookbooks/ohai/MAINTAINERS.md +15 -0
- data/cookbooks/ohai/README.md +134 -0
- data/cookbooks/ohai/libraries/matchers.rb +41 -0
- data/cookbooks/ohai/metadata.json +1 -0
- data/cookbooks/ohai/recipes/default.rb +20 -0
- data/cookbooks/ohai/resources/hint.rb +55 -0
- data/cookbooks/ohai/resources/plugin.rb +117 -0
- data/cookbooks/selinux_policy/.gitignore +51 -0
- data/cookbooks/selinux_policy/.kitchen.yml +25 -0
- data/cookbooks/selinux_policy/.rubocop.yml +2 -0
- data/cookbooks/selinux_policy/.travis.yml +26 -0
- data/cookbooks/selinux_policy/Berksfile +8 -0
- data/cookbooks/selinux_policy/CHANGELOG.md +155 -0
- data/cookbooks/selinux_policy/LICENSE +13 -0
- data/cookbooks/selinux_policy/README.md +217 -0
- data/cookbooks/selinux_policy/Rakefile +68 -0
- data/cookbooks/selinux_policy/TESTING.md +2 -0
- data/cookbooks/selinux_policy/Thorfile +12 -0
- data/cookbooks/selinux_policy/attributes/default.rb +5 -0
- data/cookbooks/selinux_policy/chefignore +102 -0
- data/cookbooks/selinux_policy/libraries/helper-disabled.rb +29 -0
- data/cookbooks/selinux_policy/libraries/matchers.rb +57 -0
- data/cookbooks/selinux_policy/metadata.json +58 -0
- data/cookbooks/selinux_policy/metadata.rb +20 -0
- data/cookbooks/selinux_policy/providers/boolean.rb +28 -0
- data/cookbooks/selinux_policy/providers/fcontext.rb +78 -0
- data/cookbooks/selinux_policy/providers/module.rb +81 -0
- data/cookbooks/selinux_policy/providers/permissive.rb +26 -0
- data/cookbooks/selinux_policy/providers/port.rb +58 -0
- data/cookbooks/selinux_policy/recipes/default.rb +9 -0
- data/cookbooks/selinux_policy/recipes/install.rb +32 -0
- data/cookbooks/selinux_policy/resources/boolean.rb +8 -0
- data/cookbooks/selinux_policy/resources/fcontext.rb +8 -0
- data/cookbooks/selinux_policy/resources/module.rb +21 -0
- data/cookbooks/selinux_policy/resources/permissive.rb +6 -0
- data/cookbooks/selinux_policy/resources/port.rb +9 -0
- data/cookbooks/seven_zip/CHANGELOG.md +30 -0
- data/cookbooks/seven_zip/README.md +108 -0
- data/cookbooks/seven_zip/attributes/default.rb +31 -0
- data/cookbooks/seven_zip/libraries/matchers.rb +33 -0
- data/cookbooks/seven_zip/metadata.json +1 -0
- data/cookbooks/seven_zip/providers/archive.rb +68 -0
- data/cookbooks/seven_zip/recipes/default.rb +41 -0
- data/cookbooks/seven_zip/resources/archive.rb +29 -0
- data/cookbooks/windows/.foodcritic +2 -0
- data/cookbooks/windows/CHANGELOG.md +528 -0
- data/cookbooks/windows/CONTRIBUTING.md +2 -0
- data/cookbooks/windows/MAINTAINERS.md +21 -0
- data/cookbooks/windows/README.md +803 -0
- data/cookbooks/windows/attributes/default.rb +21 -0
- data/cookbooks/windows/files/dism_features.rb +45 -0
- data/cookbooks/windows/libraries/matchers.rb +586 -0
- data/cookbooks/windows/libraries/powershell_helper.rb +53 -0
- data/cookbooks/windows/libraries/registry_helper.rb +356 -0
- data/cookbooks/windows/libraries/version.rb +207 -0
- data/cookbooks/windows/libraries/version_helper.rb +79 -0
- data/cookbooks/windows/libraries/windows_helper.rb +174 -0
- data/cookbooks/windows/libraries/windows_privileged.rb +103 -0
- data/cookbooks/windows/libraries/wmi_helper.rb +32 -0
- data/cookbooks/windows/metadata.json +1 -0
- data/cookbooks/windows/recipes/default.rb +21 -0
- data/cookbooks/windows/resources/auto_run.rb +46 -0
- data/cookbooks/windows/resources/certificate.rb +166 -0
- data/cookbooks/windows/resources/certificate_binding.rb +128 -0
- data/cookbooks/windows/resources/feature.rb +82 -0
- data/cookbooks/windows/resources/feature_dism.rb +108 -0
- data/cookbooks/windows/resources/feature_powershell.rb +70 -0
- data/cookbooks/windows/resources/feature_servermanagercmd.rb +76 -0
- data/cookbooks/windows/resources/font.rb +80 -0
- data/cookbooks/windows/resources/http_acl.rb +110 -0
- data/cookbooks/windows/resources/pagefile.rb +152 -0
- data/cookbooks/windows/resources/path.rb +54 -0
- data/cookbooks/windows/resources/printer.rb +103 -0
- data/cookbooks/windows/resources/printer_port.rb +101 -0
- data/cookbooks/windows/resources/share.rb +291 -0
- data/cookbooks/windows/resources/shortcut.rb +53 -0
- data/cookbooks/windows/resources/task.rb +384 -0
- data/cookbooks/windows/resources/zipfile.rb +125 -0
- data/cookbooks/yum/.foodcritic +1 -0
- data/cookbooks/yum/CHANGELOG.md +351 -0
- data/cookbooks/yum/CONTRIBUTING.md +2 -0
- data/cookbooks/yum/MAINTAINERS.md +16 -0
- data/cookbooks/yum/README.md +125 -0
- data/cookbooks/yum/attributes/main.rb +103 -0
- data/cookbooks/yum/libraries/matchers.rb +9 -0
- data/cookbooks/yum/metadata.json +1 -0
- data/cookbooks/yum/recipes/default.rb +26 -0
- data/cookbooks/yum/recipes/dnf_yum_compat.rb +29 -0
- data/cookbooks/yum/resources/globalconfig.rb +119 -0
- data/cookbooks/yum/templates/.DS_Store +0 -0
- data/cookbooks/yum/templates/main.erb +276 -0
- data/cookbooks/yum-epel/CHANGELOG.md +138 -0
- data/cookbooks/yum-epel/CONTRIBUTING.md +2 -0
- data/cookbooks/yum-epel/MAINTAINERS.md +19 -0
- data/cookbooks/yum-epel/README.md +172 -0
- data/cookbooks/yum-epel/attributes/default.rb +8 -0
- data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-source.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing-source.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel.rb +21 -0
- data/cookbooks/yum-epel/metadata.json +1 -0
- data/cookbooks/yum-epel/recipes/default.rb +27 -0
- data/cookbooks/yum-scl/.kitchen.dokken.yml +24 -0
- data/cookbooks/yum-scl/.kitchen.yml +24 -0
- data/cookbooks/yum-scl/.rubocop.yml +6 -0
- data/cookbooks/yum-scl/.travis.yml +28 -0
- data/cookbooks/yum-scl/Berksfile +3 -0
- data/cookbooks/yum-scl/Berksfile.lock +25 -0
- data/cookbooks/yum-scl/CHANGELOG.md +11 -0
- data/cookbooks/yum-scl/Gemfile +46 -0
- data/cookbooks/yum-scl/README.md +76 -0
- data/cookbooks/yum-scl/attributes/centos.rb +83 -0
- data/cookbooks/yum-scl/attributes/default.rb +15 -0
- data/cookbooks/yum-scl/attributes/scientific.rb +1 -0
- data/cookbooks/yum-scl/files/default/RPM-GPG-KEY-CentOS-SIG-SCLo +20 -0
- data/cookbooks/yum-scl/libraries/yum_scl_helper.rb +33 -0
- data/cookbooks/yum-scl/metadata.json +42 -0
- data/cookbooks/yum-scl/metadata.rb +12 -0
- data/cookbooks/yum-scl/recipes/chef_install.rb +52 -0
- data/cookbooks/yum-scl/recipes/default.rb +17 -0
- data/cookbooks/yum-scl/recipes/native_install.rb +35 -0
- data/lib/vagrant-clone/command/clone.rb +66 -61
- data/lib/vagrant-clone/errors.rb +61 -0
- data/lib/vagrant-clone/util/clone_manager_base.rb +69 -0
- data/lib/vagrant-clone/util/clone_managers/docker.rb +31 -0
- data/lib/vagrant-clone/util/clone_managers/libvirt.rb +254 -0
- data/lib/vagrant-clone/util/vagrantfile_managers/docker.rb +154 -0
- data/lib/vagrant-clone/util/vagrantfile_managers/libvirt.rb +159 -0
- data/lib/vagrant-clone/version.rb +2 -2
- data/lib/vagrant-clone.rb +6 -6
- data/libvirt.txt +7 -0
- data/performance_testing.rb +165 -0
- data/results.txt +45 -0
- data/scripts/create_box.sh +134 -0
- data/test.rb +92 -0
- data/tools/create_box.sh +130 -0
- data/vagrant-clone.gemspec +7 -7
- metadata +296 -5
- data/lib/vagrant-clone/command/errors.rb +0 -16
- data/lib/vagrant-clone/command/provider/docker.rb +0 -13
- data/lib/vagrant-clone/utils/vagrantfile_manager.rb +0 -47
@@ -0,0 +1,269 @@
|
|
1
|
+
#
|
2
|
+
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
3
|
+
#
|
4
|
+
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
|
5
|
+
#
|
6
|
+
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
7
|
+
#
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'chef/provider/apt_repository'
|
11
|
+
rescue LoadError; end
|
12
|
+
|
13
|
+
require 'chef_compat/copied_from_chef'
|
14
|
+
class Chef
|
15
|
+
module ::ChefCompat
|
16
|
+
module CopiedFromChef
|
17
|
+
#
|
18
|
+
# Author:: Thom May (<thom@chef.io>)
|
19
|
+
# Copyright:: Copyright (c) 2016 Chef Software, Inc.
|
20
|
+
# License:: Apache License, Version 2.0
|
21
|
+
#
|
22
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
23
|
+
# you may not use this file except in compliance with the License.
|
24
|
+
# You may obtain a copy of the License at
|
25
|
+
#
|
26
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
27
|
+
#
|
28
|
+
# Unless required by applicable law or agreed to in writing, software
|
29
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
30
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
31
|
+
# See the License for the specific language governing permissions and
|
32
|
+
# limitations under the License.
|
33
|
+
#
|
34
|
+
|
35
|
+
require "chef_compat/copied_from_chef/chef/resource"
|
36
|
+
require "chef_compat/copied_from_chef/chef/dsl/declare_resource"
|
37
|
+
require "chef_compat/copied_from_chef/chef/provider/noop"
|
38
|
+
|
39
|
+
class Chef < (defined?(::Chef) ? ::Chef : Object)
|
40
|
+
class Provider < (defined?(::Chef::Provider) ? ::Chef::Provider : Object)
|
41
|
+
class AptRepository < (defined?(::Chef::Provider::AptRepository) ? ::Chef::Provider::AptRepository : Chef::Provider)
|
42
|
+
use_inline_resources
|
43
|
+
|
44
|
+
include Chef::Mixin::ShellOut
|
45
|
+
extend Chef::Mixin::Which
|
46
|
+
|
47
|
+
provides :apt_repository do
|
48
|
+
which("apt-get")
|
49
|
+
end
|
50
|
+
|
51
|
+
def whyrun_supported?
|
52
|
+
true
|
53
|
+
end
|
54
|
+
|
55
|
+
def load_current_resource
|
56
|
+
end
|
57
|
+
|
58
|
+
action :add do
|
59
|
+
unless new_resource.key.nil?
|
60
|
+
if is_key_id?(new_resource.key) && !has_cookbook_file?(new_resource.key)
|
61
|
+
install_key_from_keyserver
|
62
|
+
else
|
63
|
+
install_key_from_uri
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
declare_resource(:execute, "apt-cache gencaches") do
|
68
|
+
ignore_failure true
|
69
|
+
action :nothing
|
70
|
+
end
|
71
|
+
|
72
|
+
declare_resource(:apt_update, new_resource.name) do
|
73
|
+
ignore_failure true
|
74
|
+
action :nothing
|
75
|
+
end
|
76
|
+
|
77
|
+
components = if is_ppa_url?(new_resource.uri) && new_resource.components.empty?
|
78
|
+
"main"
|
79
|
+
else
|
80
|
+
new_resource.components
|
81
|
+
end
|
82
|
+
|
83
|
+
repo = build_repo(
|
84
|
+
new_resource.uri,
|
85
|
+
new_resource.distribution,
|
86
|
+
components,
|
87
|
+
new_resource.trusted,
|
88
|
+
new_resource.arch,
|
89
|
+
new_resource.deb_src
|
90
|
+
)
|
91
|
+
|
92
|
+
declare_resource(:file, "/etc/apt/sources.list.d/#{new_resource.name}.list") do
|
93
|
+
owner "root"
|
94
|
+
group "root"
|
95
|
+
mode "0644"
|
96
|
+
content repo
|
97
|
+
sensitive new_resource.sensitive
|
98
|
+
action :create
|
99
|
+
notifies :run, "execute[apt-cache gencaches]", :immediately
|
100
|
+
notifies :update, "apt_update[#{new_resource.name}]", :immediately if new_resource.cache_rebuild
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
action :remove do
|
105
|
+
if ::File.exist?("/etc/apt/sources.list.d/#{new_resource.name}.list")
|
106
|
+
converge_by "Removing #{new_resource.name} repository from /etc/apt/sources.list.d/" do
|
107
|
+
declare_resource(:file, "/etc/apt/sources.list.d/#{new_resource.name}.list") do
|
108
|
+
sensitive new_resource.sensitive
|
109
|
+
action :delete
|
110
|
+
notifies :update, "apt_update[#{new_resource.name}]", :immediately if new_resource.cache_rebuild
|
111
|
+
end
|
112
|
+
|
113
|
+
declare_resource(:apt_update, new_resource.name) do
|
114
|
+
ignore_failure true
|
115
|
+
action :nothing
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def is_key_id?(id)
|
123
|
+
id = id[2..-1] if id.start_with?("0x")
|
124
|
+
id =~ /^\h+$/ && [8, 16, 40].include?(id.length)
|
125
|
+
end
|
126
|
+
|
127
|
+
def extract_fingerprints_from_cmd(cmd)
|
128
|
+
so = shell_out(cmd)
|
129
|
+
so.run_command
|
130
|
+
so.stdout.split(/\n/).map do |t|
|
131
|
+
if z = t.match(/^ +Key fingerprint = ([0-9A-F ]+)/)
|
132
|
+
z[1].split.join
|
133
|
+
end
|
134
|
+
end.compact
|
135
|
+
end
|
136
|
+
|
137
|
+
def key_is_valid?(cmd, key)
|
138
|
+
valid = true
|
139
|
+
|
140
|
+
so = shell_out(cmd)
|
141
|
+
so.run_command
|
142
|
+
so.stdout.split(/\n/).map do |t|
|
143
|
+
if t =~ %r{^\/#{key}.*\[expired: .*\]$}
|
144
|
+
Chef::Log.debug "Found expired key: #{t}"
|
145
|
+
valid = false
|
146
|
+
break
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
Chef::Log.debug "key #{key} #{valid ? "is valid" : "is not valid"}"
|
151
|
+
valid
|
152
|
+
end
|
153
|
+
|
154
|
+
def cookbook_name
|
155
|
+
new_resource.cookbook || new_resource.cookbook_name
|
156
|
+
end
|
157
|
+
|
158
|
+
def has_cookbook_file?(fn)
|
159
|
+
run_context.has_cookbook_file_in_cookbook?(cookbook_name, fn)
|
160
|
+
end
|
161
|
+
|
162
|
+
def no_new_keys?(file)
|
163
|
+
installed_keys = extract_fingerprints_from_cmd("apt-key finger")
|
164
|
+
proposed_keys = extract_fingerprints_from_cmd("gpg --with-fingerprint #{file}")
|
165
|
+
(installed_keys & proposed_keys).sort == proposed_keys.sort
|
166
|
+
end
|
167
|
+
|
168
|
+
def install_key_from_uri
|
169
|
+
key_name = new_resource.key.gsub(/[^0-9A-Za-z\-]/, "_")
|
170
|
+
cached_keyfile = ::File.join(Chef::Config[:file_cache_path], key_name)
|
171
|
+
type = if new_resource.key.start_with?("http")
|
172
|
+
:remote_file
|
173
|
+
elsif has_cookbook_file?(new_resource.key)
|
174
|
+
:cookbook_file
|
175
|
+
else
|
176
|
+
raise Chef::Exceptions::FileNotFound, "Cannot locate key file"
|
177
|
+
end
|
178
|
+
|
179
|
+
declare_resource(type, cached_keyfile) do
|
180
|
+
source new_resource.key
|
181
|
+
mode "0644"
|
182
|
+
sensitive new_resource.sensitive
|
183
|
+
action :create
|
184
|
+
end
|
185
|
+
|
186
|
+
raise "The key #{cached_keyfile} is invalid and cannot be used to verify an apt repository." unless key_is_valid?("gpg #{cached_keyfile}", "")
|
187
|
+
|
188
|
+
declare_resource(:execute, "apt-key add #{cached_keyfile}") do
|
189
|
+
sensitive new_resource.sensitive
|
190
|
+
action :run
|
191
|
+
not_if do
|
192
|
+
no_new_keys?(cached_keyfile)
|
193
|
+
end
|
194
|
+
notifies :run, "execute[apt-cache gencaches]", :immediately
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
def install_key_from_keyserver(key = new_resource.key, keyserver = new_resource.keyserver)
|
199
|
+
cmd = "apt-key adv --recv"
|
200
|
+
cmd << " --keyserver-options http-proxy=#{new_resource.key_proxy}" if new_resource.key_proxy
|
201
|
+
cmd << " --keyserver "
|
202
|
+
cmd << if keyserver.start_with?("hkp://")
|
203
|
+
keyserver
|
204
|
+
else
|
205
|
+
"hkp://#{keyserver}:80"
|
206
|
+
end
|
207
|
+
|
208
|
+
cmd << " #{key}"
|
209
|
+
|
210
|
+
declare_resource(:execute, "install-key #{key}") do
|
211
|
+
command cmd
|
212
|
+
sensitive new_resource.sensitive
|
213
|
+
not_if do
|
214
|
+
present = extract_fingerprints_from_cmd("apt-key finger").any? do |fp|
|
215
|
+
fp.end_with? key.upcase
|
216
|
+
end
|
217
|
+
present && key_is_valid?("apt-key list", key.upcase)
|
218
|
+
end
|
219
|
+
notifies :run, "execute[apt-cache gencaches]", :immediately
|
220
|
+
end
|
221
|
+
|
222
|
+
raise "The key #{key} is invalid and cannot be used to verify an apt repository." unless key_is_valid?("apt-key list", key.upcase)
|
223
|
+
end
|
224
|
+
|
225
|
+
def install_ppa_key(owner, repo)
|
226
|
+
url = "https://launchpad.net/api/1.0/~#{owner}/+archive/#{repo}"
|
227
|
+
key_id = Chef::HTTP::Simple.new(url).get("signing_key_fingerprint").delete('"')
|
228
|
+
install_key_from_keyserver(key_id, "keyserver.ubuntu.com")
|
229
|
+
rescue Net::HTTPServerException => e
|
230
|
+
raise "Could not access Launchpad ppa API: #{e.message}"
|
231
|
+
end
|
232
|
+
|
233
|
+
def is_ppa_url?(url)
|
234
|
+
url.start_with?("ppa:")
|
235
|
+
end
|
236
|
+
|
237
|
+
def make_ppa_url(ppa)
|
238
|
+
return unless is_ppa_url?(ppa)
|
239
|
+
owner, repo = ppa[4..-1].split("/")
|
240
|
+
repo ||= "ppa"
|
241
|
+
|
242
|
+
install_ppa_key(owner, repo)
|
243
|
+
"http://ppa.launchpad.net/#{owner}/#{repo}/ubuntu"
|
244
|
+
end
|
245
|
+
|
246
|
+
def build_repo(uri, distribution, components, trusted, arch, add_src = false)
|
247
|
+
uri = make_ppa_url(uri) if is_ppa_url?(uri)
|
248
|
+
|
249
|
+
uri = '"' + uri + '"' unless uri.start_with?("'", '"')
|
250
|
+
components = Array(components).join(" ")
|
251
|
+
options = []
|
252
|
+
options << "arch=#{arch}" if arch
|
253
|
+
options << "trusted=yes" if trusted
|
254
|
+
optstr = unless options.empty?
|
255
|
+
"[" + options.join(" ") + "]"
|
256
|
+
end
|
257
|
+
info = [ optstr, uri, distribution, components ].compact.join(" ")
|
258
|
+
repo = "deb #{info}\n"
|
259
|
+
repo << "deb-src #{info}\n" if add_src
|
260
|
+
repo
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
Chef::Provider::Noop.provides :apt_repository
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_update.rb
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
#
|
2
|
+
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
3
|
+
#
|
4
|
+
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
|
5
|
+
#
|
6
|
+
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
7
|
+
#
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'chef/provider/apt_update'
|
11
|
+
rescue LoadError; end
|
12
|
+
|
13
|
+
require 'chef_compat/copied_from_chef'
|
14
|
+
class Chef
|
15
|
+
module ::ChefCompat
|
16
|
+
module CopiedFromChef
|
17
|
+
#
|
18
|
+
# Author:: Thom May (<thom@chef.io>)
|
19
|
+
# Copyright:: Copyright (c) 2016 Chef Software, Inc.
|
20
|
+
# License:: Apache License, Version 2.0
|
21
|
+
#
|
22
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
23
|
+
# you may not use this file except in compliance with the License.
|
24
|
+
# You may obtain a copy of the License at
|
25
|
+
#
|
26
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
27
|
+
#
|
28
|
+
# Unless required by applicable law or agreed to in writing, software
|
29
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
30
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
31
|
+
# See the License for the specific language governing permissions and
|
32
|
+
# limitations under the License.
|
33
|
+
#
|
34
|
+
|
35
|
+
require "chef_compat/copied_from_chef/chef/provider"
|
36
|
+
require "chef_compat/copied_from_chef/chef/provider/noop"
|
37
|
+
|
38
|
+
class Chef < (defined?(::Chef) ? ::Chef : Object)
|
39
|
+
class Provider < (defined?(::Chef::Provider) ? ::Chef::Provider : Object)
|
40
|
+
class AptUpdate < (defined?(::Chef::Provider::AptUpdate) ? ::Chef::Provider::AptUpdate : Chef::Provider)
|
41
|
+
use_inline_resources
|
42
|
+
|
43
|
+
extend Chef::Mixin::Which
|
44
|
+
|
45
|
+
provides :apt_update do
|
46
|
+
which("apt-get")
|
47
|
+
end
|
48
|
+
|
49
|
+
APT_CONF_DIR = "/etc/apt/apt.conf.d"
|
50
|
+
STAMP_DIR = "/var/lib/apt/periodic"
|
51
|
+
|
52
|
+
def whyrun_supported?
|
53
|
+
true
|
54
|
+
end
|
55
|
+
|
56
|
+
def load_current_resource
|
57
|
+
end
|
58
|
+
|
59
|
+
action :periodic do
|
60
|
+
if !apt_up_to_date?
|
61
|
+
converge_by "update new lists of packages" do
|
62
|
+
do_update
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
action :update do
|
68
|
+
converge_by "force update new lists of packages" do
|
69
|
+
do_update
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
# Determines whether we need to run `apt-get update`
|
76
|
+
#
|
77
|
+
# @return [Boolean]
|
78
|
+
def apt_up_to_date?
|
79
|
+
::File.exist?("#{STAMP_DIR}/update-success-stamp") &&
|
80
|
+
::File.mtime("#{STAMP_DIR}/update-success-stamp") > Time.now - new_resource.frequency
|
81
|
+
end
|
82
|
+
|
83
|
+
def do_update
|
84
|
+
[STAMP_DIR, APT_CONF_DIR].each do |d|
|
85
|
+
declare_resource(:directory, d) do
|
86
|
+
recursive true
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
declare_resource(:file, "#{APT_CONF_DIR}/15update-stamp") do
|
91
|
+
content "APT::Update::Post-Invoke-Success {\"touch #{STAMP_DIR}/update-success-stamp 2>/dev/null || true\";};\n"
|
92
|
+
action :create_if_missing
|
93
|
+
end
|
94
|
+
|
95
|
+
declare_resource(:execute, "apt-get -q update")
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
Chef::Provider::Noop.provides :apt_update
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
#
|
2
|
+
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
3
|
+
#
|
4
|
+
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
|
5
|
+
#
|
6
|
+
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
7
|
+
#
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'chef/provider/noop'
|
11
|
+
rescue LoadError; end
|
12
|
+
|
13
|
+
require 'chef_compat/copied_from_chef'
|
14
|
+
class Chef
|
15
|
+
module ::ChefCompat
|
16
|
+
module CopiedFromChef
|
17
|
+
#
|
18
|
+
# Author:: Thom May (<thom@chef.io>)
|
19
|
+
# Copyright:: Copyright (c) 2016 Chef Software, Inc.
|
20
|
+
# License:: Apache License, Version 2.0
|
21
|
+
#
|
22
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
23
|
+
# you may not use this file except in compliance with the License.
|
24
|
+
# You may obtain a copy of the License at
|
25
|
+
#
|
26
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
27
|
+
#
|
28
|
+
# Unless required by applicable law or agreed to in writing, software
|
29
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
30
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
31
|
+
# See the License for the specific language governing permissions and
|
32
|
+
# limitations under the License.
|
33
|
+
#
|
34
|
+
|
35
|
+
class Chef < (defined?(::Chef) ? ::Chef : Object)
|
36
|
+
class Provider < (defined?(::Chef::Provider) ? ::Chef::Provider : Object)
|
37
|
+
class Noop < (defined?(::Chef::Provider::Noop) ? ::Chef::Provider::Noop : Chef::Provider)
|
38
|
+
def load_current_resource; end
|
39
|
+
|
40
|
+
def respond_to_missing?(method_sym, include_private = false)
|
41
|
+
method_sym.to_s.start_with?("action_") || super
|
42
|
+
end
|
43
|
+
|
44
|
+
def method_missing(method_sym, *arguments, &block)
|
45
|
+
if method_sym.to_s =~ /^action_/
|
46
|
+
Chef::Log.debug("NoOp-ing for #{method_sym}")
|
47
|
+
else
|
48
|
+
super
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# This file was generated by Chef
|
2
|
+
# Do NOT modify this file by hand.
|
3
|
+
|
4
|
+
[<%= @config.repositoryid %>]
|
5
|
+
name=<%= @config.description %>
|
6
|
+
<% if @config.baseurl %>
|
7
|
+
baseurl=<%= case @config.baseurl
|
8
|
+
when Array
|
9
|
+
@config.baseurl.join("\n")
|
10
|
+
else
|
11
|
+
@config.baseurl
|
12
|
+
end %>
|
13
|
+
<% end -%>
|
14
|
+
<% if @config.cost %>
|
15
|
+
cost=<%= @config.cost %>
|
16
|
+
<% end %>
|
17
|
+
<% if @config.enabled %>
|
18
|
+
enabled=1
|
19
|
+
<% else %>
|
20
|
+
enabled=0
|
21
|
+
<% end %>
|
22
|
+
<% if @config.enablegroups %>
|
23
|
+
enablegroups=1
|
24
|
+
<% end %>
|
25
|
+
<% if @config.exclude %>
|
26
|
+
exclude=<%= @config.exclude %>
|
27
|
+
<% end %>
|
28
|
+
<% if @config.failovermethod %>
|
29
|
+
failovermethod=<%= @config.failovermethod %>
|
30
|
+
<% end %>
|
31
|
+
<% if @config.fastestmirror_enabled %>
|
32
|
+
fastestmirror_enabled=1
|
33
|
+
<% else %>
|
34
|
+
fastestmirror_enabled=0
|
35
|
+
<% end %>
|
36
|
+
<% if @config.gpgcheck %>
|
37
|
+
gpgcheck=1
|
38
|
+
<% else %>
|
39
|
+
gpgcheck=0
|
40
|
+
<% end %>
|
41
|
+
<% if @config.gpgkey %>
|
42
|
+
gpgkey=<%= case @config.gpgkey
|
43
|
+
when Array
|
44
|
+
@config.gpgkey.join("\n ")
|
45
|
+
else
|
46
|
+
@config.gpgkey
|
47
|
+
end %>
|
48
|
+
<% end -%>
|
49
|
+
<% if @config.http_caching %>
|
50
|
+
http_caching=<%= @config.http_caching %>
|
51
|
+
<% end %>
|
52
|
+
<% if @config.include_config %>
|
53
|
+
include=<%= @config.include_config %>
|
54
|
+
<% end %>
|
55
|
+
<% if @config.includepkgs %>
|
56
|
+
includepkgs=<%= @config.includepkgs %>
|
57
|
+
<% end %>
|
58
|
+
<% if @config.keepalive %>
|
59
|
+
keepalive=1
|
60
|
+
<% end %>
|
61
|
+
<% if @config.metadata_expire %>
|
62
|
+
metadata_expire=<%= @config.metadata_expire %>
|
63
|
+
<% end %>
|
64
|
+
<% if @config.mirrorlist %>
|
65
|
+
mirrorlist=<%= @config.mirrorlist %>
|
66
|
+
<% end %>
|
67
|
+
<% if @config.mirror_expire %>
|
68
|
+
mirror_expire=<%= @config.mirror_expire %>
|
69
|
+
<% end %>
|
70
|
+
<% if @config.mirrorlist_expire %>
|
71
|
+
mirrorlist_expire=<%= @config.mirrorlist_expire %>
|
72
|
+
<% end %>
|
73
|
+
<% if @config.priority %>
|
74
|
+
priority=<%= @config.priority %>
|
75
|
+
<% end %>
|
76
|
+
<% if @config.proxy %>
|
77
|
+
proxy=<%= @config.proxy %>
|
78
|
+
<% end %>
|
79
|
+
<% if @config.proxy_username %>
|
80
|
+
proxy_username=<%= @config.proxy_username %>
|
81
|
+
<% end %>
|
82
|
+
<% if @config.proxy_password %>
|
83
|
+
proxy_password=<%= @config.proxy_password %>
|
84
|
+
<% end %>
|
85
|
+
<% if @config.username %>
|
86
|
+
username=<%= @config.username %>
|
87
|
+
<% end %>
|
88
|
+
<% if @config.password %>
|
89
|
+
password=<%= @config.password %>
|
90
|
+
<% end %>
|
91
|
+
<% if @config.repo_gpgcheck %>
|
92
|
+
repo_gpgcheck=1
|
93
|
+
<% end %>
|
94
|
+
<% if @config.max_retries %>
|
95
|
+
retries=<%= @config.max_retries %>
|
96
|
+
<% end %>
|
97
|
+
<% if @config.report_instanceid %>
|
98
|
+
report_instanceid=<%= @config.report_instanceid %>
|
99
|
+
<% end %>
|
100
|
+
<% if @config.skip_if_unavailable %>
|
101
|
+
skip_if_unavailable=1
|
102
|
+
<% end %>
|
103
|
+
<% if @config.sslcacert %>
|
104
|
+
sslcacert=<%= @config.sslcacert %>
|
105
|
+
<% end %>
|
106
|
+
<% if @config.sslclientcert %>
|
107
|
+
sslclientcert=<%= @config.sslclientcert %>
|
108
|
+
<% end %>
|
109
|
+
<% if @config.sslclientkey %>
|
110
|
+
sslclientkey=<%= @config.sslclientkey %>
|
111
|
+
<% end %>
|
112
|
+
<% unless @config.sslverify.nil? %>
|
113
|
+
sslverify=<%= ( @config.sslverify ) ? 'true' : 'false' %>
|
114
|
+
<% end %>
|
115
|
+
<% if @config.timeout %>
|
116
|
+
timeout=<%= @config.timeout %>
|
117
|
+
<% end %>
|
118
|
+
<% if @config.options -%>
|
119
|
+
<% @config.options.each do |key, value| -%>
|
120
|
+
<%= key %>=<%=
|
121
|
+
case value
|
122
|
+
when Array
|
123
|
+
value.join("\n ")
|
124
|
+
when TrueClass
|
125
|
+
'1'
|
126
|
+
when FalseClass
|
127
|
+
'0'
|
128
|
+
else
|
129
|
+
value
|
130
|
+
end %>
|
131
|
+
<% end -%>
|
132
|
+
<% end -%>
|