Showing with 483 additions and 8,395 deletions.
  1. +14 −0 .editorconfig
  2. +0 −1 .fixtures.yml
  3. +78 −18 .github/CONTRIBUTING.md
  4. +5 −5 .github/PULL_REQUEST_TEMPLATE.md
  5. +1 −1 .msync.yml
  6. +1 −0 .pmtignore
  7. +20 −0 .sync.yml
  8. +7 −9 .travis.yml
  9. +22 −0 CHANGELOG.md
  10. +21 −0 Dockerfile
  11. +13 −12 Gemfile
  12. +2 −2 README.md
  13. +30 −184 REFERENCE.md
  14. +24 −34 Rakefile
  15. +0 −270 docs/_index.html
  16. +0 −8 docs/css/common.css
  17. +0 −58 docs/css/full_list.css
  18. +0 −499 docs/css/style.css
  19. +0 −285 docs/file.README.html
  20. +0 −17 docs/frames.html
  21. +0 −285 docs/index.html
  22. +0 −248 docs/js/app.js
  23. +0 −216 docs/js/full_list.js
  24. +0 −4 docs/js/jquery.js
  25. +0 −90 docs/puppet_class_list.html
  26. +0 −491 docs/puppet_classes/selinux.html
  27. +0 −434 docs/puppet_classes/selinux_3A_3Aconfig.html
  28. +0 −171 docs/puppet_classes/selinux_3A_3Apackage.html
  29. +0 −262 docs/puppet_classes/selinux_3A_3Aparams.html
  30. +0 −176 docs/puppet_classes/selinux_3A_3Arefpolicy_package.html
  31. +0 −104 docs/puppet_defined_type_list.html
  32. +0 −222 docs/puppet_defined_types/selinux_3A_3Aboolean.html
  33. +0 −284 docs/puppet_defined_types/selinux_3A_3Aexec_restorecon.html
  34. +0 −300 docs/puppet_defined_types/selinux_3A_3Afcontext.html
  35. +0 −220 docs/puppet_defined_types/selinux_3A_3Afcontext_3A_3Aequivalence.html
  36. +0 −497 docs/puppet_defined_types/selinux_3A_3Amodule.html
  37. +0 −198 docs/puppet_defined_types/selinux_3A_3Apermissive.html
  38. +0 −303 docs/puppet_defined_types/selinux_3A_3Aport.html
  39. +0 −87 docs/puppet_provider_list.html
  40. +0 −134 docs/puppet_providers_selinux_fcontext/semanage.html
  41. +0 −134 docs/puppet_providers_selinux_fcontext_equivalence/semanage.html
  42. +0 −134 docs/puppet_providers_selinux_permissive/semanage.html
  43. +0 −136 docs/puppet_providers_selinux_port/semanage.html
  44. +0 −83 docs/puppet_type_list.html
  45. +0 −315 docs/puppet_types/selinux_fcontext.html
  46. +0 −178 docs/puppet_types/selinux_fcontext_equivalence.html
  47. +0 −195 docs/puppet_types/selinux_permissive.html
  48. +0 −268 docs/puppet_types/selinux_port.html
  49. +0 −32 docs/resource-ordering.plantuml
  50. +0 −98 docs/top-level-namespace.html
  51. +1 −1 examples/disable.pp
  52. +1 −1 examples/enable.pp
  53. +1 −1 examples/enable_and_targeted.pp
  54. +1 −1 examples/minimal.pp
  55. +1 −1 examples/mls.pp
  56. +1 −1 examples/targeted.pp
  57. +2 −4 manifests/boolean.pp
  58. +63 −0 manifests/build.pp
  59. +8 −69 manifests/config.pp
  60. +3 −5 manifests/exec_restorecon.pp
  61. +8 −7 manifests/fcontext.pp
  62. +2 −4 manifests/fcontext/equivalence.pp
  63. +8 −18 manifests/init.pp
  64. +13 −10 manifests/module.pp
  65. +3 −8 manifests/package.pp
  66. +12 −65 manifests/params.pp
  67. +2 −4 manifests/permissive.pp
  68. +3 −3 manifests/port.pp
  69. +4 −9 manifests/refpolicy_package.pp
  70. +13 −4 metadata.json
  71. +16 −0 spec/acceptance/class_spec.rb
  72. +0 −13 spec/acceptance/nodesets/archlinux-2-x64.yml
  73. +0 −15 spec/acceptance/nodesets/centos-511-x64.yml
  74. +0 −15 spec/acceptance/nodesets/centos-6-x64.yml
  75. +0 −17 spec/acceptance/nodesets/centos-66-x64-pe.yml
  76. +0 −15 spec/acceptance/nodesets/centos-66-x64.yml
  77. +0 −15 spec/acceptance/nodesets/centos-7-x64.yml
  78. +0 −15 spec/acceptance/nodesets/centos-72-x64.yml
  79. +0 −15 spec/acceptance/nodesets/debian-78-x64.yml
  80. +0 −15 spec/acceptance/nodesets/debian-82-x64.yml
  81. +0 −31 spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml
  82. +0 −34 spec/acceptance/nodesets/ec2/image_templates.yaml
  83. +0 −29 spec/acceptance/nodesets/ec2/rhel-73-x64.yml
  84. +0 −29 spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml
  85. +0 −29 spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml
  86. +0 −29 spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml
  87. +0 −16 spec/acceptance/nodesets/fedora-25-x64.yml
  88. +0 −16 spec/acceptance/nodesets/fedora-26-x64.yml
  89. +0 −18 spec/acceptance/nodesets/fedora-27-x64.yml
  90. +0 −15 spec/acceptance/nodesets/ubuntu-server-1204-x64.yml
  91. +0 −15 spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
  92. +0 −15 spec/acceptance/nodesets/ubuntu-server-1604-x64.yml
  93. +16 −0 spec/acceptance/selinux_module_refpolicy_spec.rb
  94. +16 −0 spec/acceptance/selinux_permissive_spec.rb
  95. +0 −4 spec/classes/coverage_spec.rb
  96. +12 −0 spec/classes/selinux_build_spec.rb
  97. +1 −8 spec/classes/selinux_config_mode_spec.rb
  98. +1 −17 spec/classes/selinux_config_type_spec.rb
  99. +8 −4 spec/classes/selinux_package_spec.rb
  100. +0 −14 spec/default_facts.yml
  101. +0 −6 spec/default_module_facts.yml
  102. +5 −1 spec/defines/selinux_exec_restorecon_spec.rb
  103. +1 −0 spec/defines/selinux_module_spec.rb
  104. +19 −12 spec/spec_helper.rb
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# editorconfig.org

# MANAGED BY MODULESYNC

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
tab_width = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 0 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
fixtures:
repositories:
concat: https://github.com/puppetlabs/puppetlabs-concat.git
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
selinux_core:
repo: https://github.com/puppetlabs/puppetlabs-selinux_core.git
Expand Down
96 changes: 78 additions & 18 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ By participating in this project you agree to abide by its terms.

1. Create a separate branch for your change.

1. Run the tests. We only take pull requests with passing tests, and
documentation.
1. We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org)
runs the tests for us. You can also execute them locally. This is explained
in a later section.

1. Checkout [our docs](https://voxpupuli.org/docs/#reviewing-a-module-pr) we
use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html).
They provide some guidance for new code that might help you before you submit a pull request.

1. Add a test for your change. Only refactoring and documentation
changes require no new tests. If you are adding functionality
or fixing a bug, please add a test.

1. Squash your commits down into logical components. Make sure to rebase
against the current master.
against our current master.

1. Push the branch to your fork and submit a pull request.

Expand All @@ -38,25 +43,27 @@ By default the tests use a baseline version of Puppet.
If you have Ruby 2.x or want a specific version of Puppet,
you must set an environment variable such as:

export PUPPET_VERSION="~> 4.2.0"
```sh
export PUPPET_VERSION="~> 5.5.6"
```

You can install all needed gems for spec tests into the modules directory by
running:

```sh
bundle install --path .vendor/ --without development --without system_tests --without release
bundle install --path .vendor/ --without development system_tests release
```

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release
bundle install --path .vendor/ --with system_tests --without development release
```

Our all in one solution if you don't know if you need to install or update gems:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release; bundle update; bundle clean
bundle install --path .vendor/ --with system_tests --without development release; bundle update; bundle clean
```

## Syntax and style
Expand All @@ -65,13 +72,17 @@ The test suite will run [Puppet Lint](http://puppet-lint.com/) and
[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
check various syntax and style things. You can run these locally with:

bundle exec rake lint
bundle exec rake validate
```sh
bundle exec rake lint
bundle exec rake validate
```

It will also run some [Rubocop](http://batsov.com/rubocop/) tests
against it. You can run those locally ahead of time with:

bundle exec rake rubocop
```sh
bundle exec rake rubocop
```

## Running the unit tests

Expand All @@ -82,15 +93,36 @@ about how best to test your new feature.

To run the linter, the syntax checker and the unit tests:

bundle exec rake test
```sh
bundle exec rake test
```

To run your all the unit tests

bundle exec rake spec SPEC_OPTS='--format documentation'
```sh
bundle exec rake spec
```

To run a specific spec test set the `SPEC` variable:

bundle exec rake spec SPEC=spec/foo_spec.rb
```sh
bundle exec rake spec SPEC=spec/foo_spec.rb
```

### Unit tests in docker

Some people don't want to run the dependencies locally or don't want to install
ruby. We ship a Dockerfile that enables you to run all unit tests and linting.
You only need to run:

```sh
docker build .
```

Please ensure that a docker daemon is running and that your user has the
permission to talk to it. You can specify a remote docker host by setting the
`DOCKER_HOST` environment variable. it will copy the content of the module into
the docker image. So it will not work if a Gemfile.lock exists.

## Integration tests

Expand All @@ -102,23 +134,51 @@ This fires up a new virtual machine (using vagrant) and runs a series of
simple tests against it after applying the module. You can run this
with:

bundle exec rake acceptance
```sh
bundle exec rake acceptance
```

This will run the tests on the module's default nodeset. You can override the
nodeset used, e.g.,

BEAKER_set=centos-7-x64 bundle exec rake acceptance
```sh
BEAKER_set=centos-7-x64 bundle exec rake acceptance
```

There are default rake tasks for the various acceptance test modules, e.g.,

bundle exec rake beaker:centos-7-x64
bundle exec rake beaker:ssh:centos-7-x64
```sh
bundle exec rake beaker:centos-7-x64
bundle exec rake beaker:ssh:centos-7-x64
```

If you don't want to have to recreate the virtual machine every time you can
use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
created virtual machines will be in `.vagrant/beaker_vagrant_files`.

Beaker also supports docker containers. We also use that in our automated CI
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:

```
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
```

You can replace the string `debian9` with any common operating system.
The following strings are known to work:

* ubuntu1604
* ubuntu1804
* debian8
* debian9
* centos6
* centos7

The easiest way to debug in a docker container is to open a shell:

docker exec -it -u root ${container_id_or_name} bash
```sh
docker exec -it -u root ${container_id_or_name} bash
```

The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb)
repository.
10 changes: 5 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Thank you for contributing to this project!
-->
#### Pull Request (PR) description
<!--
Replace this comment with a description of your pull request.
Replace this comment with a description of your pull request.
-->

#### This Pull Request (PR) fixes the following issues
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.1.0'
modulesync_config_version: '2.7.0'
1 change: 1 addition & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Puppetfile.lock
*.iml
.*.sw?
.yardoc/
Dockerfile
20 changes: 20 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
---
.travis.yml:
secure: "r7NI3OHbyMs/w351LkmkTFFLriDDyWKvgyZt+XYPw7jbaWmqnV4+NSJMQSkXgTS+tq2jNPLOWY1UuPuFJKkyd1m7LteOb2yZ6HJs5BL7QJjJWC2vUjkY60kl2xHn81D6SEXOXoVseGWiimlTlWJM3pKljNgZOZlOMw96vgnd6/I="
Gemfile:
optional:
':system_tests':
- gem: beaker-vagrant
spec/spec_helper.rb:
mock_with: ':mocha'
spec/acceptance/nodesets/archlinux-2-x64.yml:
delete: true
spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml:
delete: true
spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml:
delete: true
spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml:
delete: true
spec/acceptance/nodesets/ec2/image_templates.yaml:
delete: true
spec/acceptance/nodesets/ec2/rhel-73-x64.yml:
delete: true
spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml:
delete: true
16 changes: 7 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
---
sudo: false
dist: trusty
dist: xenial
language: ruby
cache: bundler
before_install:
- rm -f Gemfile.lock
- gem update --system
- gem update bundler
- bundle --version
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
- rvm: 2.4.4
- rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=rubocop
- rvm: 2.5.1
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v2.0.0](https://github.com/voxpupuli/puppet-selinux/tree/v2.0.0) (2019-05-15)

[Full Changelog](https://github.com/voxpupuli/puppet-selinux/compare/v1.6.1...v2.0.0)

**Breaking changes:**

- modulesync 2.5.1 and drop Puppet 4 [\#282](https://github.com/voxpupuli/puppet-selinux/pull/282) ([bastelfreak](https://github.com/bastelfreak))

**Implemented enhancements:**

- Allow `puppetlabs/stdlib` 6.x [\#284](https://github.com/voxpupuli/puppet-selinux/pull/284) ([alexjfisher](https://github.com/alexjfisher))
- Builder improvements and acceptance tests [\#281](https://github.com/voxpupuli/puppet-selinux/pull/281) ([ekohl](https://github.com/ekohl))
- Simplify parameter handling [\#280](https://github.com/voxpupuli/puppet-selinux/pull/280) ([ekohl](https://github.com/ekohl))

**Fixed bugs:**

- fix syntax of config\_mode fact example [\#275](https://github.com/voxpupuli/puppet-selinux/pull/275) ([evgeni](https://github.com/evgeni))

**Merged pull requests:**

- Update puppet strings and use assert\_private [\#279](https://github.com/voxpupuli/puppet-selinux/pull/279) ([ekohl](https://github.com/ekohl))

## [v1.6.1](https://github.com/voxpupuli/puppet-selinux/tree/v1.6.1) (2018-10-05)

[Full Changelog](https://github.com/voxpupuli/puppet-selinux/compare/v1.6.0...v1.6.1)
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM ruby:2.5.3

WORKDIR /opt/puppet

# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39
RUN mkdir -p /etc/sv

ARG PUPPET_VERSION="~> 6.0"
ARG PARALLEL_TEST_PROCESSORS=4

# Cache gems
COPY Gemfile .
RUN bundle install --without system_tests development release --path=${BUNDLE_PATH:-vendor/bundle}

COPY . .

RUN bundle install
RUN bundle exec release_checks

# Container should not saved
RUN exit 1
Loading