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,58 @@
|
|
1
|
+
{
|
2
|
+
"name": "selinux_policy",
|
3
|
+
"description": "Manages SELinux policy components",
|
4
|
+
"long_description": "# SELinux Policy Cookbook\n\nThis cookbook can be used to manage SELinux policies and components (rather than just enable / disable enforcing). I made it because I needed some SELinux settings done, and the `execute`s started to look annoying.\n\n## Requirements\n\nNeeds an SELinux policy active (so its values can be managed). Can work with a disabled SELinux system (see attribute `allow_disabled`), which will generate warnings and do nothing (but won't break the run). Also requires SELinux's management tools, namely `semanage`, `setsebool` and `getsebool`. Tools are installed by the `selinux_policy::install` recipe (for RHEL/Debian and the like).\n\n### Chef\n\n- Chef 12.1+\n\n### Platforms\n\n- rhel\n- fedora\n\n## Attributes\n\nThese attributes affect the way all of the LWRPs are behaving.\n\n- `node['selinux_policy']['allow_disabled']` - Whether to allow runs when SELinux is disabled. Will generate warnings, but the run won't fail. Defaults to `true`, set to `false` if you don't have any machines with disabled SELinux.\n\n## Usage\n\n- `selinux_policy::install` - Installs SELinux policy management tools\n\nThis cookbook's functionality is exposed via resources, so it should be called from a wrapper cookbook. Remember to add `depends 'selinux_policy'` to your `metadata.rb`.\n\n### boolean\n\nRepresents an SELinux [boolean](http://wiki.gentoo.org/wiki/SELinux/Tutorials/Using_SELinux_booleans). You can either `set` it, meaning it will be changed without persistence (it will revert to default in the next reboot), or `setpersist` it (default action), so it'll keep it value after rebooting. Using `setpersist` requires an active policy (so that the new value can be saved somewhere).\n\nAttributes:\n\n- `name`: boolean's name. Defaults to resource name.\n- `value`: Its new value (`true`/`false`).\n- `force`: Use `setsebool` even if the current value agrees with the requested one.\n\nExample usage:\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\nselinux_policy_boolean 'httpd_can_network_connect' do\n value true\n # Make sure nginx is started if this value was modified\n notifies :start,'service[nginx]', :immediate\nend\n```\n\n**Note**: Due to ruby interperting `0` as `true`, using `value 0` is unwise.\n\n### port\n\nAllows assigning a network port to a certain SELinux context. As explained [here](http://wiki.centos.org/HowTos/SELinux#head-ad837f60830442ae77a81aedd10c20305a811388), it can be useful for running Apache on a non-standard port.\n\nActions:\n\n- `addormodify` (default): Assigns the port to the right context, whether it's already listed another context or not at all.\n- `add`: Assigns the port to the right context it's if not listed (only uses `-a`).\n- `modify`: Changes the port's context if it's already listed (only uses `-m`).\n- `delete`: Removes the port's context if it's listed (uses `-d`).\n\nAttributes:\n\n- `port`: The port in question, defaults to resource name.\n- `protocol`: `tcp`/`udp`.\n- `secontext`: The SELinux context to assign the port to. Unnecessary when using `delete`.\n\nExample usage:\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\n# Allow nginx to bind to port 5678, by giving it the http_port_t context\nselinux_policy_port '5678' do\n protocol 'tcp'\n secontext 'http_port_t'\nend\n```\n\n### module\n\nManages SEModules\n\nActions:\n\n- `fetch`: Prepares the module's files for compilation. Allow `remote_directory`-like behavior\n- `compile`: Translates a module source directory into a `NAME.pp` file. Uses `make` logic for idempotence.\n- `install`: Adds a compiled module (`pp`) to the current policy. Only installs if the module was modified this run, `force` is enabled or it's missing from the current policy. **Note:** I wish I could compare the existing module to the one generated, but the `extract` capability was only added in [Aug 15](https://github.com/SELinuxProject/selinux/commit/65c6325271b54d3de9c17352a57d469dfbd12729). I'll be happy to see a better idea.\n- `deploy` (default): Runs `fetch`, `compile`, `install` in that order.\n- `remove`: Removes a module.\n\nAttributes:\n\n- `name`: The module name. Defaults to resource name.\n- `directory`: Directory where module is stored. Defaults to a directory inside the Chef cache.\n- `content`: The module content, can be extracted from `audit2allow -m NAME`. This can be used to create simple modules without using external files.\n- `directory_source`: Copies files cookbook to the module directory (uses `remote_directory`). Allows keeping all of the module's source files in the cookbook. **Note:** You can pre-create the module directory and populate it in any other way you'd choose.\n- `cookbook`: Modifies the source cookbook for the `remote_directory`.\n- `force`: Installs the module even if it seems fine. Ruins idempotence but should help solve some weird cases.\n\nExample usage:\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\n# Allow openvpn to write/delete in '/etc/openvpn'\nselinux_policy_module 'openvpn-googleauthenticator' do\n content <<-eos\n module dy-openvpn-googleauthenticator 1.0;\n\n require {\n type openvpn_t;\n type openvpn_etc_t;\n class file { write unlink };\n }\n\n\n #============= openvpn_t ==============\n allow openvpn_t openvpn_etc_t:file { write unlink };\n eos\n action :deploy\nend\n```\n\n### fcontext\n\nAllows managing the SELinux context of files. This can be used to grant SELinux-protected daemons access to additional / moved files.\n\nActions:\n\n- `addormodify` (default): Assigns the file regexp to the right context, whether it's already listed another context or not at all.\n- `add`: Assigns the file regexp to the right context it's if not listed (only uses -a).\n- `modify`: Changes the file regexp context if it's already listed (only uses -m).\n- `delete`: Removes the file regexp context if it's listed (uses -d).\n\nAttributes:\n\n- `file_spec`: This is the file regexp in question, defaults to resource name.\n- `secontext`: The SELinux context to assign the file regexp to. Not required for `:delete`\n- `file_type`: Restrict the fcontext to specific file types. See the table below for an overview. See also <https://en.wikipedia.org/wiki/Unix_file_types> for more info\n- **a** All files\n- **f** Regular files\n- **d** Directory\n- **c** Character device\n- **b** Block device\n- **s** Socket\n- **l** Symbolic link\n- **p** Namedpipe\n\nExample usage (see mysql cookbook for example daemons ):\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\n# Allow http servers (nginx/apache) to modify moodle files\nselinux_policy_fcontext '/var/www/moodle(/.*)?' do\n secontext 'httpd_sys_rw_content_t'\nend\n\n# Allow a custom mysql daemon to access its files.\n{'mysqld_etc_t' => \"/etc/mysql-#{service_name}(/.*)?\",\n'mysqld_etc_t' => \"/etc/mysql-#{service_name}/my\\.cnf\",\n'mysqld_log_t' => \"/var/log/mysql-#{service_name}(/.*)?\",\n'mysqld_db_t' => \"/opt/mysql_data_#{service_name}(/.*)?\",\n'mysqld_var_run_t' => \"/var/run/mysql-#{service_name}(/.*)?\",\n'mysqld_initrc_exec_t' => \"/etc/rc\\.d/init\\.d/mysql-#{service_name}\"}.each do |sc, f|\n selinux_policy_fcontext f do\n secontext sc\n end\nend\n\n# Adapt a symbolic link\nselinux_policy_fcontext '/var/www/symlink_to_webroot' do\n secontext 'httpd_sys_rw_content_t'\n filetype 'l'\nend\n```\n\n### permissive\n\nAllows some types to misbehave without stopping them. Not as good as specific policies, but better than disabling SELinux entirely.\n\nActions:\n\n- `add`: Adds a permissive, unless it's already added\n- `delete`: Deletes a permissive if it's listed\n\nExample usage:\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\n# Disable enforcement on Nginx\n# As described on http://nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/\n\nselinux_policy_permissive 'nginx' do\n notifies :restart, 'service[nginx]'\nend\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a named feature branch (like `add_component_x`)\n3. Write your change\n4. Write tests for your change (if applicable): If fixing a bug, please add regression tests for the RSpec (if possible) and the kitchen If adding a feature, please create basic tests for it, in both RSpec and kitchen\n5. Run the tests, ensuring they all pass, using `rake testing:user`\n6. Submit a Pull Request using Github Please **attach the test results** using a gist\n\n## License and Authors\n\n- Licensed [GPL v2](http://choosealicense.com/licenses/gpl-2.0/)\n- Author:: [Nitzan Raz](https://github.com/BackSlasher) ([backslasher](http://backslasher.net))\n- Maintainer Community:: Sous Chefs [help@sous-chefs.org](mailto:help@sous-chefs.org)\n",
|
5
|
+
"maintainer": "Sous Chefs",
|
6
|
+
"maintainer_email": "help@sous-chefs.org",
|
7
|
+
"license": "GPL v2",
|
8
|
+
"platforms": {
|
9
|
+
"redhat": ">= 0.0.0",
|
10
|
+
"centos": ">= 0.0.0",
|
11
|
+
"fedora": ">= 0.0.0",
|
12
|
+
"ubuntu": ">= 0.0.0",
|
13
|
+
"debian": ">= 0.0.0",
|
14
|
+
"amazon": ">= 0.0.0"
|
15
|
+
},
|
16
|
+
"dependencies": {
|
17
|
+
"compat_resource": ">= 12.16.3"
|
18
|
+
},
|
19
|
+
"recommendations": {
|
20
|
+
|
21
|
+
},
|
22
|
+
"suggestions": {
|
23
|
+
|
24
|
+
},
|
25
|
+
"conflicting": {
|
26
|
+
|
27
|
+
},
|
28
|
+
"providing": {
|
29
|
+
|
30
|
+
},
|
31
|
+
"replacing": {
|
32
|
+
|
33
|
+
},
|
34
|
+
"attributes": {
|
35
|
+
|
36
|
+
},
|
37
|
+
"groupings": {
|
38
|
+
|
39
|
+
},
|
40
|
+
"recipes": {
|
41
|
+
|
42
|
+
},
|
43
|
+
"version": "2.0.1",
|
44
|
+
"source_url": "https://github.com/sous-chefs/selinux_policy",
|
45
|
+
"issues_url": "https://github.com/sous-chefs/selinux_policy/issues",
|
46
|
+
"privacy": false,
|
47
|
+
"chef_versions": [
|
48
|
+
[
|
49
|
+
">= 12.1"
|
50
|
+
]
|
51
|
+
],
|
52
|
+
"ohai_versions": [
|
53
|
+
|
54
|
+
],
|
55
|
+
"gems": [
|
56
|
+
|
57
|
+
]
|
58
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name 'selinux_policy'
|
2
|
+
maintainer 'Sous Chefs'
|
3
|
+
maintainer_email 'help@sous-chefs.org'
|
4
|
+
license 'GPL v2'
|
5
|
+
description 'Manages SELinux policy components'
|
6
|
+
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
7
|
+
version '2.0.1'
|
8
|
+
|
9
|
+
supports 'redhat'
|
10
|
+
supports 'centos'
|
11
|
+
supports 'fedora'
|
12
|
+
supports 'ubuntu'
|
13
|
+
supports 'debian'
|
14
|
+
supports 'amazon'
|
15
|
+
|
16
|
+
depends 'compat_resource', '>= 12.16.3'
|
17
|
+
|
18
|
+
source_url 'https://github.com/sous-chefs/selinux_policy'
|
19
|
+
issues_url 'https://github.com/sous-chefs/selinux_policy/issues'
|
20
|
+
chef_version '>= 12.1' if respond_to?(:chef_version)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
include Chef::SELinuxPolicy::Helpers
|
2
|
+
|
3
|
+
# Support whyrun
|
4
|
+
def whyrun_supported?
|
5
|
+
true
|
6
|
+
end
|
7
|
+
|
8
|
+
use_inline_resources
|
9
|
+
|
10
|
+
# Set for now, without persisting
|
11
|
+
action :set do
|
12
|
+
sebool(false)
|
13
|
+
end
|
14
|
+
|
15
|
+
# Set and persist
|
16
|
+
action :setpersist do
|
17
|
+
sebool(true)
|
18
|
+
end
|
19
|
+
|
20
|
+
def sebool(persist = false)
|
21
|
+
persist_string = persist ? '-P ' : ''
|
22
|
+
new_value = new_resource.value ? 'on' : 'off'
|
23
|
+
execute "selinux-setbool-#{new_resource.name}-#{new_value}" do
|
24
|
+
command "/usr/sbin/setsebool #{persist_string} #{new_resource.name} #{new_value}"
|
25
|
+
not_if "/usr/sbin/getsebool #{new_resource.name} | grep '#{new_value}$' >/dev/null" unless new_resource.force
|
26
|
+
only_if { use_selinux }
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
include Chef::SELinuxPolicy::Helpers
|
2
|
+
|
3
|
+
# Support whyrun
|
4
|
+
def whyrun_supported?
|
5
|
+
true
|
6
|
+
end
|
7
|
+
|
8
|
+
def fcontext_defined(file_spec, file_type, label = nil)
|
9
|
+
file_hash = {
|
10
|
+
'a' => 'all files',
|
11
|
+
'f' => 'regular file',
|
12
|
+
'd' => 'directory',
|
13
|
+
'c' => 'character device',
|
14
|
+
'b' => 'block device',
|
15
|
+
's' => 'socket',
|
16
|
+
'l' => 'symbolic link',
|
17
|
+
'p' => 'named pipe',
|
18
|
+
}
|
19
|
+
|
20
|
+
label_matcher = label ? "system_u:object_r:#{Regexp.escape(label)}:s0\\s*$" : ''
|
21
|
+
"semanage fcontext -l | grep -qP '^#{Regexp.escape(file_spec)}\\s+#{Regexp.escape(file_hash[file_type])}\\s+#{label_matcher}'"
|
22
|
+
end
|
23
|
+
|
24
|
+
def semanage_options(file_type)
|
25
|
+
# Set options for file_type
|
26
|
+
if node['platform_family'].include?('rhel') && Chef::VersionConstraint.new('< 7.0').include?(node['platform_version'])
|
27
|
+
case file_type
|
28
|
+
when 'a' then '-f ""'
|
29
|
+
when 'f' then '-f --'
|
30
|
+
else; "-f -#{file_type}"
|
31
|
+
end
|
32
|
+
else
|
33
|
+
"-f #{file_type}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
use_inline_resources
|
38
|
+
|
39
|
+
# Run restorecon to fix label
|
40
|
+
action :relabel do
|
41
|
+
res = shell_out!('find', '/', '-regextype', 'posix-egrep', '-regex', new_resource.file_spec, '-execdir', 'restorecon', '-iRv', '{}', ';')
|
42
|
+
new_resource.updated_by_last_action(true) unless res.stdout.empty?
|
43
|
+
end
|
44
|
+
|
45
|
+
# Create if doesn't exist, do not touch if fcontext is already registered
|
46
|
+
action :add do
|
47
|
+
execute "selinux-fcontext-#{new_resource.secontext}-add" do
|
48
|
+
command "/usr/sbin/semanage fcontext -a #{semanage_options(new_resource.file_type)} -t #{new_resource.secontext} '#{new_resource.file_spec}'"
|
49
|
+
not_if fcontext_defined(new_resource.file_spec, new_resource.file_type)
|
50
|
+
only_if { use_selinux }
|
51
|
+
notifies :relabel, new_resource, :immediate
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Delete if exists
|
56
|
+
action :delete do
|
57
|
+
execute "selinux-fcontext-#{new_resource.secontext}-delete" do
|
58
|
+
command "/usr/sbin/semanage fcontext #{semanage_options(new_resource.file_type)} -d '#{new_resource.file_spec}'"
|
59
|
+
only_if fcontext_defined(new_resource.file_spec, new_resource.file_type, new_resource.secontext)
|
60
|
+
only_if { use_selinux }
|
61
|
+
notifies :relabel, new_resource, :immediate
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
action :modify do
|
66
|
+
execute "selinux-fcontext-#{new_resource.secontext}-modify" do
|
67
|
+
command "/usr/sbin/semanage fcontext -m #{semanage_options(new_resource.file_type)} -t #{new_resource.secontext} '#{new_resource.file_spec}'"
|
68
|
+
only_if { use_selinux }
|
69
|
+
only_if fcontext_defined(new_resource.file_spec, new_resource.file_type)
|
70
|
+
not_if fcontext_defined(new_resource.file_spec, new_resource.file_type, new_resource.secontext)
|
71
|
+
notifies :relabel, new_resource, :immediate
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
action :addormodify do
|
76
|
+
run_action(:add)
|
77
|
+
run_action(:modify)
|
78
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
include Chef::SELinuxPolicy::Helpers
|
2
|
+
|
3
|
+
# Support whyrun
|
4
|
+
def whyrun_supported?
|
5
|
+
true
|
6
|
+
end
|
7
|
+
|
8
|
+
def module_defined(name)
|
9
|
+
"/usr/sbin/semodule -l | grep -w '^#{name}'"
|
10
|
+
end
|
11
|
+
|
12
|
+
def shell_boolean(expression)
|
13
|
+
expression ? 'true' : 'false'
|
14
|
+
end
|
15
|
+
|
16
|
+
use_inline_resources
|
17
|
+
|
18
|
+
# Get all the components in the right place
|
19
|
+
action :fetch do
|
20
|
+
directory new_resource.directory do
|
21
|
+
only_if { use_selinux }
|
22
|
+
end
|
23
|
+
|
24
|
+
raise 'dont specify both directory_source and content' if new_resource.directory_source && new_resource.content
|
25
|
+
|
26
|
+
if new_resource.directory_source # ~FC023
|
27
|
+
remote_directory new_resource.directory do
|
28
|
+
source new_resource.directory_source
|
29
|
+
cookbook new_resource.cookbook
|
30
|
+
only_if { use_selinux }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
if new_resource.content
|
35
|
+
file "#{new_resource.directory}/#{new_resource.module_name}.te" do
|
36
|
+
content new_resource.content
|
37
|
+
only_if { use_selinux }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# compile the module
|
43
|
+
# XXX allow modifyable path
|
44
|
+
action :compile do
|
45
|
+
make_command = "/usr/bin/make -f /usr/share/selinux/devel/Makefile #{new_resource.module_name}.pp"
|
46
|
+
execute "semodule-compile-#{new_resource.module_name}" do
|
47
|
+
command make_command
|
48
|
+
not_if "#{make_command} -q", cwd: new_resource.directory # $? = 1 means make wants to execute http://www.gnu.org/software/make/manual/html_node/Running.html
|
49
|
+
only_if { use_selinux }
|
50
|
+
cwd new_resource.directory
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# deploy / upgrade module
|
55
|
+
# XXX this looks ugly AF because CentOS 6.X doesn't support extracting
|
56
|
+
# SELinux modules from the current policy, which I planned on comparing
|
57
|
+
# to my compiled file. I'll be happy to see anything else (that works).
|
58
|
+
action :install do
|
59
|
+
filename = "#{new_resource.directory}/#{new_resource.module_name}.pp"
|
60
|
+
execute "semodule-install-#{new_resource.module_name}" do
|
61
|
+
command "/usr/sbin/semodule -i #{filename}"
|
62
|
+
only_if "#{shell_boolean(new_resource.updated_by_last_action? || new_resource.force)} || ! (#{module_defined(new_resource.module_name)}) "
|
63
|
+
only_if { use_selinux }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# deploy should do all three, as it used to do
|
68
|
+
action :deploy do
|
69
|
+
run_action(:fetch)
|
70
|
+
run_action(:compile)
|
71
|
+
run_action(:install)
|
72
|
+
end
|
73
|
+
|
74
|
+
# remove module
|
75
|
+
action :remove do
|
76
|
+
execute "semodule-remove-#{new_resource.module_name}" do
|
77
|
+
command "/usr/sbin/semodule -r #{new_resource.module_name}"
|
78
|
+
only_if module_defined(new_resource.module_name)
|
79
|
+
only_if { use_selinux }
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
include Chef::SELinuxPolicy::Helpers
|
2
|
+
|
3
|
+
# Support whyrun
|
4
|
+
def whyrun_supported?
|
5
|
+
true
|
6
|
+
end
|
7
|
+
|
8
|
+
use_inline_resources
|
9
|
+
|
10
|
+
# Create if doesn't exist, do not touch if port is already registered (even under different type)
|
11
|
+
action :add do
|
12
|
+
execute "selinux-permissive-#{new_resource.name}-add" do
|
13
|
+
command "/usr/sbin/semanage permissive -a '#{new_resource.name}'"
|
14
|
+
not_if "/usr/sbin/semanage permissive -l | grep '^#{new_resource.name}$'"
|
15
|
+
only_if { use_selinux }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# Delete if exists
|
20
|
+
action :delete do
|
21
|
+
execute "selinux-port-#{new_resource.name}-delete" do
|
22
|
+
command "/usr/sbin/semanage permissive -d '#{new_resource.name}'"
|
23
|
+
not_if "/usr/sbin/semanage permissive -l | grep '^#{new_resource.name}$'"
|
24
|
+
only_if { use_selinux }
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
include Chef::SELinuxPolicy::Helpers
|
2
|
+
|
3
|
+
# Support whyrun
|
4
|
+
def whyrun_supported?
|
5
|
+
true
|
6
|
+
end
|
7
|
+
|
8
|
+
def port_defined(protocol, port, label = nil)
|
9
|
+
base_command = "seinfo --protocol=#{protocol} --portcon=#{port} | awk -F: '$(NF-1) !~ /reserved_port_t$/ {print $(NF-1)}'"
|
10
|
+
grep = if label
|
11
|
+
"grep -P '#{Regexp.escape(label)}'"
|
12
|
+
else
|
13
|
+
'grep -q ^'
|
14
|
+
end
|
15
|
+
"#{base_command} | #{grep}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def validate_port(port)
|
19
|
+
raise ArgumentError, "port value: #{port} is invalid." unless port.to_s =~ /^\d+$/
|
20
|
+
end
|
21
|
+
|
22
|
+
use_inline_resources
|
23
|
+
|
24
|
+
# Create if doesn't exist, do not touch if port is already registered (even under different type)
|
25
|
+
action :add do
|
26
|
+
validate_port(new_resource.port)
|
27
|
+
execute "selinux-port-#{new_resource.port}-add" do
|
28
|
+
command "/usr/sbin/semanage port -a -t #{new_resource.secontext} -p #{new_resource.protocol} #{new_resource.port}"
|
29
|
+
not_if port_defined(new_resource.protocol, new_resource.port)
|
30
|
+
only_if { use_selinux }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Delete if exists
|
35
|
+
action :delete do
|
36
|
+
validate_port(new_resource.port)
|
37
|
+
execute "selinux-port-#{new_resource.port}-delete" do
|
38
|
+
command "/usr/sbin/semanage port -d -p #{new_resource.protocol} #{new_resource.port}"
|
39
|
+
only_if port_defined(new_resource.protocol, new_resource.port)
|
40
|
+
only_if { use_selinux }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
action :modify do
|
45
|
+
execute "selinux-port-#{new_resource.port}-modify" do
|
46
|
+
command "/usr/sbin/semanage port -m -t #{new_resource.secontext} -p #{new_resource.protocol} #{new_resource.port}"
|
47
|
+
only_if port_defined(new_resource.protocol, new_resource.port)
|
48
|
+
not_if port_defined(new_resource.protocol, new_resource.port, new_resource.secontext)
|
49
|
+
only_if { use_selinux }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
action :addormodify do
|
54
|
+
# Try to add new port
|
55
|
+
run_action(:add)
|
56
|
+
# Try to modify existing port
|
57
|
+
run_action(:modify)
|
58
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: selinux_policy
|
3
|
+
# Recipe:: install
|
4
|
+
#
|
5
|
+
# Copyright 2014, BackSlasher
|
6
|
+
#
|
7
|
+
# GPLv2
|
8
|
+
#
|
9
|
+
case node['platform_family']
|
10
|
+
when 'debian'
|
11
|
+
raise 'Install SELinux manually on Ubuntu. See https://wiki.ubuntu.com/SELinux' if node['platform'] == 'ubuntu'
|
12
|
+
pkgs = ['policycoreutils', 'selinux-policy-dev', 'setools', 'make']
|
13
|
+
when 'rhel'
|
14
|
+
case node['platform_version'].to_i
|
15
|
+
when 5
|
16
|
+
# policycoreutils-python does not exist in RHEL5
|
17
|
+
pkgs = ['policycoreutils', 'selinux-policy-devel', 'setools-console', 'make']
|
18
|
+
when 6
|
19
|
+
# selinux-policy-devel does not exist in RHEL6
|
20
|
+
pkgs = ['policycoreutils-python', 'selinux-policy', 'setools-console', 'make']
|
21
|
+
when 7
|
22
|
+
pkgs = ['policycoreutils-python', 'selinux-policy-devel', 'setools-console', 'make']
|
23
|
+
else
|
24
|
+
raise 'Unknown version of RHEL/derivative, cannot determine required package names'
|
25
|
+
end
|
26
|
+
when 'fedora'
|
27
|
+
pkgs = ['policycoreutils-python', 'selinux-policy-devel', 'setools-console', 'make']
|
28
|
+
else
|
29
|
+
raise 'Unknown distro, cannot determine required package names'
|
30
|
+
end
|
31
|
+
|
32
|
+
pkgs.each { |p| package p }
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# A resource for managing SELinux Booleans
|
2
|
+
|
3
|
+
actions :set, :setpersist
|
4
|
+
default_action :setpersist
|
5
|
+
|
6
|
+
attribute :name, kind_of: String, name_attribute: true
|
7
|
+
attribute :value, kind_of: [TrueClass, FalseClass]
|
8
|
+
attribute :force, kind_of: [TrueClass, FalseClass], default: false
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Manages file specs in SELinux
|
2
|
+
# See http://docs.fedoraproject.org/en-US/Fedora/13/html/SELinux_FAQ/index.html#id3715134
|
3
|
+
|
4
|
+
actions :add, :delete, :modify, :addormodify, :relabel
|
5
|
+
default_action :addormodify
|
6
|
+
attribute :file_spec, kind_of: String, name_attribute: true
|
7
|
+
attribute :secontext, kind_of: String
|
8
|
+
attribute :file_type, kind_of: String, default: 'a', equal_to: %w(a f d c b s l p)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# A resource for managing SE modules
|
2
|
+
|
3
|
+
actions :deploy, :fetch, :compile, :install, :remove
|
4
|
+
default_action :deploy
|
5
|
+
|
6
|
+
attribute :module_name, kind_of: String, name_attribute: true
|
7
|
+
attribute :force, kind_of: [TrueClass, FalseClass], default: false
|
8
|
+
|
9
|
+
attribute :directory, kind_of: String, default: nil # content to work with. Defaults to autogenerated name in the Chef cache. Can be provided and pre-populated
|
10
|
+
def directory(arg = nil)
|
11
|
+
if arg || @directory
|
12
|
+
set_or_return(:directory, arg, kind_of: String)
|
13
|
+
else
|
14
|
+
"#{Chef::Config[:file_cache_path]}/#{module_name}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# Content options:
|
19
|
+
attribute :content, kind_of: String, default: nil # provide a 'te' file directly. Optional
|
20
|
+
attribute :directory_source, kind_of: String, default: nil # Source directory for module source code. If specified, will use "remote_directory" on the directory specified as `directory`
|
21
|
+
attribute :cookbook, kind_of: String, default: nil # Related to directory
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Manages a port assignment in SELinux
|
2
|
+
# See http://docs.fedoraproject.org/en-US/Fedora/13/html/SELinux_FAQ/index.html#id3715134
|
3
|
+
|
4
|
+
actions :add, :delete, :modify, :addormodify
|
5
|
+
default_action :addormodify
|
6
|
+
|
7
|
+
attribute :port, kind_of: [Integer, String], name_attribute: true
|
8
|
+
attribute :protocol, kind_of: String, equal_to: %w(tcp udp)
|
9
|
+
attribute :secontext, kind_of: String
|
@@ -0,0 +1,30 @@
|
|
1
|
+
seven_zip Cookbook CHANGELOG
|
2
|
+
========================
|
3
|
+
This file is used to list changes made in each version of the seven_zip cookbook.
|
4
|
+
|
5
|
+
v2.0.2
|
6
|
+
------
|
7
|
+
- Add timeout to extract action on seven\_zip resource and configurable default\_extract_timeout attribute.
|
8
|
+
|
9
|
+
v2.0.1
|
10
|
+
------
|
11
|
+
- [GH Issue 21 - NoMethodError: Undefined method or attribute `kernel' on `node'](https://github.com/daptiv/seven_zip/issues/21).
|
12
|
+
|
13
|
+
v2.0.0
|
14
|
+
------
|
15
|
+
- [Upgrade to 7-Zip 15.14](https://github.com/daptiv/seven_zip/pull/9).
|
16
|
+
- [7-Zip now installed to the default MSI location by default](https://github.com/daptiv/seven_zip/pull/11).
|
17
|
+
- [7z.exe is located using the Windows registry unless the home attribute is explicitly set](https://github.com/daptiv/seven_zip/pull/10).
|
18
|
+
- [7-Zip is only added to the Windows PATH if the syspath attribute is set](https://github.com/daptiv/seven_zip/pull/11).
|
19
|
+
- [Installation idempotence check was fixed](https://github.com/daptiv/seven_zip/pull/14), package name was corrected.
|
20
|
+
- [TravisCI build added](https://github.com/daptiv/seven_zip/pull/12).
|
21
|
+
- [ServerSpec tests added](https://github.com/daptiv/seven_zip/pull/9)
|
22
|
+
- [Document Archive LRWP](https://github.com/daptiv/seven_zip/pull/6)
|
23
|
+
|
24
|
+
v1.0.2
|
25
|
+
------
|
26
|
+
- [COOK-3476 - Upgrade to 7-zip 9.22](https://tickets.opscode.com/browse/COOK-3476)
|
27
|
+
|
28
|
+
1.0.0
|
29
|
+
-----
|
30
|
+
- initial release
|
@@ -0,0 +1,108 @@
|
|
1
|
+
[](https://supermarket.chef.io/cookbooks/seven_zip)
|
2
|
+
[](https://ci.appveyor.com/project/ChefWindowsCookbooks65871/seven-zip/branch/master)
|
3
|
+
|
4
|
+
# seven_zip Cookbook
|
5
|
+
[7-Zip](http://www.7-zip.org/) is a file archiver with a high compression ratio. This cookbook installs the full 7-zip suite of tools (GUI and CLI). This cookbook replaces the older [7-zip cookbook](https://github.com/sneal/7-zip).
|
6
|
+
|
7
|
+
# Requirements
|
8
|
+
## Platforms
|
9
|
+
- Windows XP
|
10
|
+
- Windows Vista
|
11
|
+
- Windows 7
|
12
|
+
- Windows 8, 8.1
|
13
|
+
- Windows 10
|
14
|
+
- Windows Server 2003 R2
|
15
|
+
- Windows Server 2008 (R1, R2)
|
16
|
+
- Windows Server 2012 (R1, R2)
|
17
|
+
|
18
|
+
## Chef
|
19
|
+
- Chef >= 11.6
|
20
|
+
|
21
|
+
## Cookbooks
|
22
|
+
- windows
|
23
|
+
|
24
|
+
# Attributes
|
25
|
+
## Optional
|
26
|
+
<table>
|
27
|
+
<tr>
|
28
|
+
<th>Key</th>
|
29
|
+
<th>Type</th>
|
30
|
+
<th>Description</th>
|
31
|
+
<th>Default</th>
|
32
|
+
</tr>
|
33
|
+
<tr>
|
34
|
+
<td><code>['seven_zip']['home']</code></td>
|
35
|
+
<td>String</td>
|
36
|
+
<td>7-Zip installation directory.</td>
|
37
|
+
<td></td>
|
38
|
+
</tr>
|
39
|
+
<tr>
|
40
|
+
<td><code>['seven_zip']['syspath']</code></td>
|
41
|
+
<td>Boolean</td>
|
42
|
+
<td>If true, adds 7-zip directory to system PATH environment variable.</td>
|
43
|
+
<td></td>
|
44
|
+
</tr>
|
45
|
+
<tr>
|
46
|
+
<td><code>['seven_zip']['default_extract_timeout']</code></td>
|
47
|
+
<td>Integer</td>
|
48
|
+
<td>The default timeout for an extract operation in seconds. This can be overridden by a resource attribute.</td>
|
49
|
+
<td>600</td>
|
50
|
+
</tr>
|
51
|
+
</table>
|
52
|
+
|
53
|
+
# Usage
|
54
|
+
## default
|
55
|
+
|
56
|
+
Add `seven_zip::default` to your run\_list which will download and install 7-zip for the current Windows platform.
|
57
|
+
|
58
|
+
# Resource/Provider
|
59
|
+
## seven_zip_archive
|
60
|
+
Extracts a 7-zip compatible archive (iso, zip, 7z etc) to the specified destination directory.
|
61
|
+
|
62
|
+
#### Actions
|
63
|
+
- `:extract` - Extract a 7-zip compatible archive
|
64
|
+
|
65
|
+
#### Attribute Parameters
|
66
|
+
- `path` - Name attribute. The destination to extract to.
|
67
|
+
- `source` - The file path to the archive to extract.
|
68
|
+
- `overwrite` - Defaults to false. If true, the destination files will be overwritten.
|
69
|
+
- `checksum` - The archive file checksum.
|
70
|
+
- `timeout` - The extract action timeout in seconds, defaults to `node['seven_zip']['default_extract_timeout']`.
|
71
|
+
|
72
|
+
#### Examples
|
73
|
+
Extract 7-zip source files to `C:\seven_zip_source`.
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
seven_zip_archive 'seven_zip_source' do
|
77
|
+
path 'C:\seven_zip_source'
|
78
|
+
source 'http://www.7-zip.org/a/7z1514-src.7z'
|
79
|
+
overwrite true
|
80
|
+
checksum '3713aed72728eae8f6649e4803eba0b3676785200c76df6269034c520df4bbd5'
|
81
|
+
timeout 30
|
82
|
+
end
|
83
|
+
```
|
84
|
+
|
85
|
+
# Recipes
|
86
|
+
## default
|
87
|
+
|
88
|
+
Installs 7-zip and adds it to your system PATH.
|
89
|
+
|
90
|
+
# License & Authors
|
91
|
+
- Author:: Seth Chisamore (<schisamo@chef.io>)
|
92
|
+
- Author:: Shawn Neal (<sneal@sneal.net>)
|
93
|
+
|
94
|
+
```text
|
95
|
+
Copyright:: 2011-2016, Chef Software, Inc.
|
96
|
+
|
97
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
98
|
+
you may not use this file except in compliance with the License.
|
99
|
+
You may obtain a copy of the License at
|
100
|
+
|
101
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
102
|
+
|
103
|
+
Unless required by applicable law or agreed to in writing, software
|
104
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
105
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
106
|
+
See the License for the specific language governing permissions and
|
107
|
+
limitations under the License.
|
108
|
+
```
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Cookbook Name:: seven_zip
|
4
|
+
# Attribute:: default
|
5
|
+
#
|
6
|
+
# Copyright:: Copyright (c) 2011-2016 Chef Software, Inc.
|
7
|
+
#
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
# you may not use this file except in compliance with the License.
|
10
|
+
# You may obtain a copy of the License at
|
11
|
+
#
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
#
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
|
21
|
+
if node['kernel']['machine'] == 'x86_64'
|
22
|
+
default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514-x64.msi'
|
23
|
+
default['seven_zip']['checksum'] = 'cefe1a9092d8a6be68468c33910d6206b40e934fb63cab686c5cccf369fbf712'
|
24
|
+
default['seven_zip']['package_name'] = '7-Zip 15.14 (x64 edition)'
|
25
|
+
else
|
26
|
+
default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514.msi'
|
27
|
+
default['seven_zip']['checksum'] = 'eaf58e29941d8ca95045946949d75d9b5455fac167df979a7f8e4a6bf2d39680'
|
28
|
+
default['seven_zip']['package_name'] = '7-Zip 15.14'
|
29
|
+
end
|
30
|
+
|
31
|
+
default['seven_zip']['default_extract_timeout'] = 600
|