├── .editorconfig ├── .fixtures.yml ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── labeler.yml ├── release.yml └── workflows │ ├── ci.yml │ ├── labeler.yml │ ├── prepare_release.yml │ └── release.yml ├── .gitignore ├── .msync.yml ├── .overcommit.yml ├── .pmtignore ├── .puppet-lint.rc ├── .rubocop.yml ├── .rubocop_todo.yml ├── .sync.yml ├── CHANGELOG.md ├── Gemfile ├── LICENSE ├── README.md ├── REFERENCE.md ├── Rakefile ├── data ├── common.yaml ├── os │ ├── RedHat.yaml │ └── RedHat │ │ ├── AlmaLinux │ │ ├── 8.yaml │ │ └── 9.yaml │ │ ├── Amazon.yaml │ │ ├── CentOS.yaml │ │ ├── CentOS │ │ └── 9.yaml │ │ ├── Fedora.yaml │ │ ├── RedHat.yaml │ │ └── Rocky.yaml ├── package_provider │ └── dnf.yaml └── repos │ ├── RedHat │ ├── 8.yaml │ └── 9.yaml │ └── repos.yaml ├── examples ├── gpgkey.pp ├── group.pp ├── install.pp ├── plugin.pp └── versionlock.pp ├── functions └── bool2num_hash_recursive.pp ├── hiera.yaml ├── lib ├── facter │ ├── yum_reboot_required.rb │ └── yum_updates.rb └── puppet │ ├── provider │ └── dnf_module_stream │ │ └── dnf_module_stream.rb │ └── type │ └── dnf_module_stream.rb ├── manifests ├── clean.pp ├── config.pp ├── copr.pp ├── gpgkey.pp ├── group.pp ├── init.pp ├── install.pp ├── plugin.pp ├── plugin │ ├── post_transaction_actions.pp │ └── versionlock.pp ├── post_transaction_action.pp ├── settings.pp └── versionlock.pp ├── metadata.json ├── spec ├── acceptance │ ├── class_spec.rb │ ├── copr_spec.rb │ ├── define_group_spec.rb │ ├── define_versionlock_spec.rb │ ├── post_transaction_actions_spec.rb │ ├── yum_config_install_limit_2_spec.rb │ └── yum_config_variable_false_spec.rb ├── classes │ ├── init_spec.rb │ ├── plugin_post_transaction_actions_spec.rb │ └── plugin_versionlock_spec.rb ├── defines │ ├── config_spec.rb │ ├── copr_spec.rb │ ├── gpgkey_spec.rb │ ├── group_spec.rb │ ├── plugin_spec.rb │ ├── post_transaction_action_spec.rb │ └── versionlock_spec.rb ├── functions │ └── bool2num_hash_recursive_spec.rb ├── spec_helper.rb ├── spec_helper_acceptance.rb ├── type_aliases │ ├── yum_rpmarch_spec.rb │ ├── yum_rpmname_spec.rb │ ├── yum_rpmnameglob_spec.rb │ ├── yum_rpmrelease_spec.rb │ └── yum_rpmversion_spec.rb └── unit │ ├── facter │ └── yum_package_updates_spec.rb │ └── puppet │ ├── provider │ └── dnf_module_stream │ │ └── dnf_module_stream_spec.rb │ └── type │ └── dnf_module_stream_spec.rb ├── tasks ├── init.json └── init.rb └── types ├── rpmarch.pp ├── rpmname.pp ├── rpmnameglob.pp ├── rpmrelease.pp ├── rpmversion.pp └── versionlockstring.pp /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | # Managed by modulesync - DO NOT EDIT 4 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 5 | 6 | root = true 7 | 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | indent_size = 2 12 | tab_width = 2 13 | indent_style = space 14 | insert_final_newline = true 15 | trim_trailing_whitespace = true 16 | -------------------------------------------------------------------------------- /.fixtures.yml: -------------------------------------------------------------------------------- 1 | fixtures: 2 | repositories: 3 | stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git 4 | concat: https://github.com/puppetlabs/puppetlabs-concat.git 5 | augeas_core: https://github.com/puppetlabs/puppetlabs-augeas_core.git 6 | yumrepo_core: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git 7 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution guidelines 2 | 3 | ## Table of contents 4 | 5 | * [Contributing](#contributing) 6 | * [Writing proper commits - short version](#writing-proper-commits-short-version) 7 | * [Writing proper commits - long version](#writing-proper-commits-long-version) 8 | * [Dependencies](#dependencies) 9 | * [Note for OS X users](#note-for-os-x-users) 10 | * [The test matrix](#the-test-matrix) 11 | * [Syntax and style](#syntax-and-style) 12 | * [Running the unit tests](#running-the-unit-tests) 13 | * [Unit tests in docker](#unit-tests-in-docker) 14 | * [Integration tests](#integration-tests) 15 | 16 | This module has grown over time based on a range of contributions from 17 | people using it. If you follow these contributing guidelines your patch 18 | will likely make it into a release a little more quickly. 19 | 20 | ## Contributing 21 | 22 | Please note that this project is released with a Contributor Code of Conduct. 23 | By participating in this project you agree to abide by its terms. 24 | [Contributor Code of Conduct](https://voxpupuli.org/coc/). 25 | 26 | * Fork the repo. 27 | * Create a separate branch for your change. 28 | * We only take pull requests with passing tests, and documentation. [GitHub Actions](https://docs.github.com/en/actions) run the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix). 29 | * Checkout [our docs](https://voxpupuli.org/docs/reviewing_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. 30 | * 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. 31 | * Squash your commits down into logical components. Make sure to rebase against our current master. 32 | * Push the branch to your fork and submit a pull request. 33 | 34 | Please be prepared to repeat some of these steps as our contributors review your code. 35 | 36 | Also consider sending in your profile code that calls this component module as an acceptance test or provide it via an issue. This helps reviewers a lot to test your use case and prevents future regressions! 37 | 38 | ## Writing proper commits - short version 39 | 40 | * Make commits of logical units. 41 | * Check for unnecessary whitespace with "git diff --check" before committing. 42 | * Commit using Unix line endings (check the settings around "crlf" in git-config(1)). 43 | * Do not check in commented out code or unneeded files. 44 | * The first line of the commit message should be a short description (50 characters is the soft limit, excluding ticket number(s)), and should skip the full stop. 45 | * Associate the issue in the message. The first line should include the issue number in the form "(#XXXX) Rest of message". 46 | * The body should provide a meaningful commit message, which: 47 | *uses the imperative, present tense: `change`, not `changed` or `changes`. 48 | * includes motivation for the change, and contrasts its implementation with the previous behavior. 49 | * Make sure that you have tests for the bug you are fixing, or feature you are adding. 50 | * Make sure the test suites passes after your commit: 51 | * When introducing a new feature, make sure it is properly documented in the README.md 52 | 53 | ## Writing proper commits - long version 54 | 55 | 1. Make separate commits for logically separate changes. 56 | 57 | Please break your commits down into logically consistent units 58 | which include new or changed tests relevant to the rest of the 59 | change. The goal of doing this is to make the diff easier to 60 | read for whoever is reviewing your code. In general, the easier 61 | your diff is to read, the more likely someone will be happy to 62 | review it and get it into the code base. 63 | 64 | If you are going to refactor a piece of code, please do so as a 65 | separate commit from your feature or bug fix changes. 66 | 67 | We also really appreciate changes that include tests to make 68 | sure the bug is not re-introduced, and that the feature is not 69 | accidentally broken. 70 | 71 | Describe the technical detail of the change(s). If your 72 | description starts to get too long, that is a good sign that you 73 | probably need to split up your commit into more finely grained 74 | pieces. 75 | 76 | Commits which plainly describe the things which help 77 | reviewers check the patch and future developers understand the 78 | code are much more likely to be merged in with a minimum of 79 | bike-shedding or requested changes. Ideally, the commit message 80 | would include information, and be in a form suitable for 81 | inclusion in the release notes for the version of Puppet that 82 | includes them. 83 | 84 | Please also check that you are not introducing any trailing 85 | whitespace or other "whitespace errors". You can do this by 86 | running "git diff --check" on your changes before you commit. 87 | 88 | 2. Sending your patches 89 | 90 | To submit your changes via a GitHub pull request, we _highly_ 91 | recommend that you have them on a topic branch, instead of 92 | directly on `master`. 93 | It makes things much easier to keep track of, especially if 94 | you decide to work on another thing before your first change 95 | is merged in. 96 | 97 | GitHub has some pretty good 98 | [general documentation](http://help.github.com/) on using 99 | their site. They also have documentation on 100 | [creating pull requests](http://help.github.com/send-pull-requests/). 101 | 102 | In general, after pushing your topic branch up to your 103 | repository on GitHub, you can switch to the branch in the 104 | GitHub UI and click "Pull Request" towards the top of the page 105 | in order to open a pull request. 106 | 107 | 108 | 3. Update the related GitHub issue. 109 | 110 | If there is a GitHub issue associated with the change you 111 | submitted, then you should update the ticket to include the 112 | location of your branch, along with any other commentary you 113 | may wish to make. 114 | 115 | ## Dependencies 116 | 117 | The testing and development tools have a bunch of dependencies, 118 | all managed by [bundler](http://bundler.io/) according to the 119 | [Puppet support matrix](http://docs.puppetlabs.com/guides/platforms.html#ruby-versions). 120 | 121 | By default the tests use a baseline version of Puppet. 122 | 123 | If you have Ruby 2.x or want a specific version of Puppet, 124 | you must set an environment variable such as: 125 | 126 | ```sh 127 | export PUPPET_GEM_VERSION="~> 6.1.0" 128 | ``` 129 | 130 | You can install all needed gems for spec tests into the modules directory by 131 | running: 132 | 133 | ```sh 134 | bundle config set --local path '.vendor/' 135 | bundle config set --local without 'development system_tests release' 136 | bundle install --jobs "$(nproc)" 137 | ``` 138 | 139 | If you also want to run acceptance tests: 140 | 141 | ```sh 142 | bundle config set --local path '.vendor/' 143 | bundle config set --local without 'development release' 144 | bundle config set --local with 'system_tests' 145 | bundle install --jobs "$(nproc)" 146 | ``` 147 | 148 | Our all in one solution if you don't know if you need to install or update gems: 149 | 150 | ```sh 151 | bundle config set --local path '.vendor/' 152 | bundle config set --local without 'development release' 153 | bundle config set --local with 'system_tests' 154 | bundle install --jobs "$(nproc)" 155 | bundle update 156 | bundle clean 157 | ``` 158 | 159 | As an alternative to the `--jobs "$(nproc)` parameter, you can set an 160 | environment variable: 161 | 162 | ```sh 163 | BUNDLE_JOBS="$(nproc)" 164 | ``` 165 | 166 | ### Note for OS X users 167 | 168 | `nproc` isn't a valid command under OS x. As an alternative, you can do: 169 | 170 | ```sh 171 | --jobs "$(sysctl -n hw.ncpu)" 172 | ``` 173 | 174 | ## The test matrix 175 | 176 | ### Syntax and style 177 | 178 | The test suite will run [Puppet Lint](http://puppet-lint.com/) and 179 | [Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to 180 | check various syntax and style things. You can run these locally with: 181 | 182 | ```sh 183 | bundle exec rake lint 184 | bundle exec rake validate 185 | ``` 186 | 187 | It will also run some [Rubocop](http://batsov.com/rubocop/) tests 188 | against it. You can run those locally ahead of time with: 189 | 190 | ```sh 191 | bundle exec rake rubocop 192 | ``` 193 | 194 | ### Running the unit tests 195 | 196 | The unit test suite covers most of the code, as mentioned above please 197 | add tests if you're adding new functionality. If you've not used 198 | [rspec-puppet](http://rspec-puppet.com/) before then feel free to ask 199 | about how best to test your new feature. 200 | 201 | To run the linter, the syntax checker and the unit tests: 202 | 203 | ```sh 204 | bundle exec rake test 205 | ``` 206 | 207 | To run your all the unit tests 208 | 209 | ```sh 210 | bundle exec rake spec 211 | ``` 212 | 213 | To run a specific spec test set the `SPEC` variable: 214 | 215 | ```sh 216 | bundle exec rake spec SPEC=spec/foo_spec.rb 217 | ``` 218 | 219 | #### Unit tests in docker 220 | 221 | Some people don't want to run the dependencies locally or don't want to install 222 | ruby. We ship a Dockerfile that enables you to run all unit tests and linting. 223 | You only need to run: 224 | 225 | ```sh 226 | docker build . 227 | ``` 228 | 229 | Please ensure that a docker daemon is running and that your user has the 230 | permission to talk to it. You can specify a remote docker host by setting the 231 | `DOCKER_HOST` environment variable. it will copy the content of the module into 232 | the docker image. So it will not work if a Gemfile.lock exists. 233 | 234 | ### Integration tests 235 | 236 | The unit tests just check the code runs, not that it does exactly what 237 | we want on a real machine. For that we're using 238 | [beaker](https://github.com/puppetlabs/beaker). 239 | 240 | This fires up a new virtual machine (using vagrant) and runs a series of 241 | simple tests against it after applying the module. You can run this 242 | with: 243 | 244 | ```sh 245 | BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker 246 | ``` 247 | 248 | or 249 | 250 | ```sh 251 | BEAKER_PUPPET_COLLECTION=none BEAKER_setfile=archlinux-64 bundle exec rake beaker 252 | ``` 253 | 254 | This latter example will use the distribution's own version of Puppet. 255 | 256 | You can replace the string `debian11` with any common operating system. 257 | The following strings are known to work: 258 | 259 | * ubuntu2004 260 | * ubuntu2204 261 | * debian11 262 | * debian12 263 | * centos9 264 | * archlinux 265 | * almalinux8 266 | * almalinux9 267 | * fedora36 268 | 269 | For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests). 270 | 271 | The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb) 272 | repository. 273 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 10 | 11 | ## Affected Puppet, Ruby, OS and module versions/distributions 12 | 13 | - Puppet: 14 | - Ruby: 15 | - Distribution: 16 | - Module version: 17 | 18 | ## How to reproduce (e.g Puppet code you use) 19 | 20 | ## What are you seeing 21 | 22 | ## What behaviour did you expect instead 23 | 24 | ## Output log 25 | 26 | ## Any additional information you'd like to impart 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 9 | #### Pull Request (PR) description 10 | 13 | 14 | #### This Pull Request (PR) fixes the following issues 15 | 21 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Managed by modulesync - DO NOT EDIT 3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 4 | 5 | skip-changelog: 6 | - head-branch: ['^release-*', 'release'] 7 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Managed by modulesync - DO NOT EDIT 3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 4 | 5 | # https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes 6 | 7 | changelog: 8 | exclude: 9 | labels: 10 | - duplicate 11 | - invalid 12 | - modulesync 13 | - question 14 | - skip-changelog 15 | - wont-fix 16 | - wontfix 17 | 18 | categories: 19 | - title: Breaking Changes 🛠 20 | labels: 21 | - backwards-incompatible 22 | 23 | - title: New Features 🎉 24 | labels: 25 | - enhancement 26 | 27 | - title: Bug Fixes 🐛 28 | labels: 29 | - bug 30 | 31 | - title: Documentation Updates 📚 32 | labels: 33 | - documentation 34 | - docs 35 | 36 | - title: Dependency Updates ⬆️ 37 | labels: 38 | - dependencies 39 | 40 | - title: Other Changes 41 | labels: 42 | - "*" 43 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Managed by modulesync - DO NOT EDIT 3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 4 | 5 | name: CI 6 | 7 | # yamllint disable-line rule:truthy 8 | on: 9 | pull_request: {} 10 | push: 11 | branches: 12 | - main 13 | - master 14 | 15 | concurrency: 16 | group: ${{ github.ref_name }} 17 | cancel-in-progress: true 18 | 19 | jobs: 20 | puppet: 21 | name: Puppet 22 | uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3 23 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Managed by modulesync - DO NOT EDIT 3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 4 | 5 | name: "Pull Request Labeler" 6 | 7 | # yamllint disable-line rule:truthy 8 | on: 9 | pull_request_target: {} 10 | 11 | jobs: 12 | labeler: 13 | permissions: 14 | contents: read 15 | pull-requests: write 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/labeler@v5 19 | -------------------------------------------------------------------------------- /.github/workflows/prepare_release.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Managed by modulesync - DO NOT EDIT 3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 4 | 5 | name: 'Prepare Release' 6 | 7 | on: 8 | workflow_dispatch: 9 | inputs: 10 | version: 11 | description: 'Module version to be released. Must be a valid semver string without leading v. (1.2.3)' 12 | required: false 13 | 14 | jobs: 15 | release_prep: 16 | uses: 'voxpupuli/gha-puppet/.github/workflows/prepare_release.yml@v3' 17 | with: 18 | version: ${{ github.event.inputs.version }} 19 | allowed_owner: 'voxpupuli' 20 | secrets: 21 | # Configure secrets here: 22 | # https://docs.github.com/en/actions/security-guides/encrypted-secrets 23 | github_pat: '${{ secrets.PCCI_PAT_RELEASE_PREP }}' 24 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Managed by modulesync - DO NOT EDIT 3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 4 | 5 | name: Release 6 | 7 | # yamllint disable-line rule:truthy 8 | on: 9 | push: 10 | tags: 11 | - '*' 12 | 13 | jobs: 14 | release: 15 | name: Release 16 | uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v3 17 | with: 18 | allowed_owner: 'voxpupuli' 19 | secrets: 20 | # Configure secrets here: 21 | # https://docs.github.com/en/actions/security-guides/encrypted-secrets 22 | username: ${{ secrets.PUPPET_FORGE_USERNAME }} 23 | api_key: ${{ secrets.PUPPET_FORGE_API_KEY }} 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Managed by modulesync - DO NOT EDIT 2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 3 | 4 | /pkg/ 5 | /Gemfile.lock 6 | /Gemfile.local 7 | /vendor/ 8 | /.vendor/ 9 | /spec/fixtures/manifests/ 10 | /spec/fixtures/modules/ 11 | /.vagrant/ 12 | /.bundle/ 13 | /.ruby-version 14 | /coverage/ 15 | /log/ 16 | /.idea/ 17 | /.dependencies/ 18 | /.librarian/ 19 | /Puppetfile.lock 20 | *.iml 21 | .*.sw? 22 | /.yardoc/ 23 | /Guardfile 24 | bolt-debug.log 25 | .rerun.json 26 | -------------------------------------------------------------------------------- /.msync.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Managed by modulesync - DO NOT EDIT 3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 4 | 5 | modulesync_config_version: '9.7.0' 6 | -------------------------------------------------------------------------------- /.overcommit.yml: -------------------------------------------------------------------------------- 1 | # Managed by modulesync - DO NOT EDIT 2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 3 | # 4 | # Hooks are only enabled if you take action. 5 | # 6 | # To enable the hooks run: 7 | # 8 | # ``` 9 | # bundle exec overcommit --install 10 | # # ensure .overcommit.yml does not harm to you and then 11 | # bundle exec overcommit --sign 12 | # ``` 13 | # 14 | # (it will manage the .git/hooks directory): 15 | # 16 | # Examples howto skip a test for a commit or push: 17 | # 18 | # ``` 19 | # SKIP=RuboCop git commit 20 | # SKIP=PuppetLint git commit 21 | # SKIP=RakeTask git push 22 | # ``` 23 | # 24 | # Don't invoke overcommit at all: 25 | # 26 | # ``` 27 | # OVERCOMMIT_DISABLE=1 git commit 28 | # ``` 29 | # 30 | # Read more about overcommit: https://github.com/brigade/overcommit 31 | # 32 | # To manage this config yourself in your module add 33 | # 34 | # ``` 35 | # .overcommit.yml: 36 | # unmanaged: true 37 | # ``` 38 | # 39 | # to your modules .sync.yml config 40 | --- 41 | PreCommit: 42 | RuboCop: 43 | enabled: true 44 | description: 'Runs rubocop on modified files only' 45 | command: ['bundle', 'exec', 'rubocop'] 46 | RakeTarget: 47 | enabled: true 48 | description: 'Runs lint on modified files only' 49 | targets: 50 | - 'lint' 51 | command: ['bundle', 'exec', 'rake'] 52 | YamlSyntax: 53 | enabled: true 54 | JsonSyntax: 55 | enabled: true 56 | TrailingWhitespace: 57 | enabled: true 58 | 59 | PrePush: 60 | RakeTarget: 61 | enabled: true 62 | description: 'Run rake targets' 63 | targets: 64 | - 'validate' 65 | - 'test' 66 | - 'rubocop' 67 | command: ['bundle', 'exec', 'rake'] 68 | -------------------------------------------------------------------------------- /.pmtignore: -------------------------------------------------------------------------------- 1 | # Managed by modulesync - DO NOT EDIT 2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 3 | 4 | /docs/ 5 | /pkg/ 6 | /Gemfile 7 | /Gemfile.lock 8 | /Gemfile.local 9 | /vendor/ 10 | /.vendor/ 11 | /spec/ 12 | /Rakefile 13 | /.vagrant/ 14 | /.bundle/ 15 | /.ruby-version 16 | /coverage/ 17 | /log/ 18 | /.idea/ 19 | /.dependencies/ 20 | /.github/ 21 | /.librarian/ 22 | /Puppetfile.lock 23 | /Puppetfile 24 | *.iml 25 | /.editorconfig 26 | /.fixtures.yml 27 | /.gitignore 28 | /.msync.yml 29 | /.overcommit.yml 30 | /.pmtignore 31 | /.rspec 32 | /.rspec_parallel 33 | /.rubocop.yml 34 | /.sync.yml 35 | .*.sw? 36 | /.yardoc/ 37 | /.yardopts 38 | /Dockerfile 39 | /HISTORY.md 40 | -------------------------------------------------------------------------------- /.puppet-lint.rc: -------------------------------------------------------------------------------- 1 | # Managed by modulesync - DO NOT EDIT 2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 3 | 4 | --fail-on-warnings 5 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Managed by modulesync - DO NOT EDIT 3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 4 | 5 | inherit_from: .rubocop_todo.yml 6 | inherit_gem: 7 | voxpupuli-test: rubocop.yml 8 | -------------------------------------------------------------------------------- /.rubocop_todo.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/voxpupuli/puppet-yum/81201a358dc4e5c3d321e2d0c38b431352c4f7ee/.rubocop_todo.yml -------------------------------------------------------------------------------- /.sync.yml: -------------------------------------------------------------------------------- 1 | --- 2 | spec/spec_helper_acceptance.rb: 3 | unmanaged: false 4 | .puppet-lint.rc: 5 | enabled_lint_checks: 6 | - parameter_documentation 7 | - parameter_types 8 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # Managed by modulesync - DO NOT EDIT 2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 3 | 4 | source ENV['GEM_SOURCE'] || 'https://rubygems.org' 5 | 6 | group :test do 7 | gem 'voxpupuli-test', '~> 10.0', :require => false 8 | gem 'puppet_metadata', '~> 5.0', :require => false 9 | end 10 | 11 | group :development do 12 | gem 'guard-rake', :require => false 13 | gem 'overcommit', '>= 0.39.1', :require => false 14 | end 15 | 16 | group :system_tests do 17 | gem 'voxpupuli-acceptance', '~> 3.5', :require => false 18 | end 19 | 20 | group :release do 21 | gem 'voxpupuli-release', '~> 3.0', :require => false 22 | end 23 | 24 | gem 'rake', :require => false 25 | gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test] 26 | 27 | puppetversion = ENV['PUPPET_GEM_VERSION'] || [">= 7.24", "< 9"] 28 | gem 'puppet', puppetversion, :require => false, :groups => [:test] 29 | 30 | # vim: syntax=ruby 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-16 Institute of Computer Science, Masaryk University 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Managed by modulesync - DO NOT EDIT 2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 3 | 4 | # Attempt to load voxpupuli-test (which pulls in puppetlabs_spec_helper), 5 | # otherwise attempt to load it directly. 6 | begin 7 | require 'voxpupuli/test/rake' 8 | rescue LoadError 9 | begin 10 | require 'puppetlabs_spec_helper/rake_tasks' 11 | rescue LoadError 12 | end 13 | end 14 | 15 | # load optional tasks for acceptance 16 | # only available if gem group releases is installed 17 | begin 18 | require 'voxpupuli/acceptance/rake' 19 | rescue LoadError 20 | end 21 | 22 | # load optional tasks for releases 23 | # only available if gem group releases is installed 24 | begin 25 | require 'voxpupuli/release/rake_tasks' 26 | rescue LoadError 27 | # voxpupuli-release not present 28 | else 29 | GCGConfig.user = 'voxpupuli' 30 | GCGConfig.project = 'puppet-yum' 31 | end 32 | 33 | desc "Run main 'test' task and report merged results to coveralls" 34 | task test_with_coveralls: [:test] do 35 | if Dir.exist?(File.expand_path('../lib', __FILE__)) 36 | require 'coveralls/rake/task' 37 | Coveralls::RakeTask.new 38 | Rake::Task['coveralls:push'].invoke 39 | else 40 | puts 'Skipping reporting to coveralls. Module has no lib dir' 41 | end 42 | end 43 | 44 | # vim: syntax=ruby 45 | -------------------------------------------------------------------------------- /data/common.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | lookup_options: 3 | yum::config_options: 4 | merge: 'hash' 5 | yum::repos: 6 | merge: 7 | strategy: 'deep' 8 | knockout_prefix: '--' 9 | merge_hash_arrays: true 10 | yum::gpgkeys: 11 | merge: 12 | strategy: 'deep' 13 | merge_hash_arrays: true 14 | yum::managed_repos: 15 | merge: 'unique' 16 | yum::os_default_repos: 17 | merge: 'unique' 18 | yum::repo_exclusions: 19 | merge: 'unique' 20 | 21 | # Default is currently yum path 22 | yum::plugin::versionlock::path: /etc/yum/pluginconf.d/versionlock.list 23 | yum::settings::mainconf: /etc/yum.conf 24 | -------------------------------------------------------------------------------- /data/os/RedHat.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | ## osfamily: RedHat 3 | 4 | yum::gpgkeys: 5 | /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6: # https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 6 | content: | 7 | -----BEGIN PGP PUBLIC KEY BLOCK----- 8 | Version: GnuPG v1.4.5 (GNU/Linux) 9 | 10 | mQINBEvSKUIBEADLGnUj24ZVKW7liFN/JA5CgtzlNnKs7sBg7fVbNWryiE3URbn1 11 | JXvrdwHtkKyY96/ifZ1Ld3lE2gOF61bGZ2CWwJNee76Sp9Z+isP8RQXbG5jwj/4B 12 | M9HK7phktqFVJ8VbY2jfTjcfxRvGM8YBwXF8hx0CDZURAjvf1xRSQJ7iAo58qcHn 13 | XtxOAvQmAbR9z6Q/h/D+Y/PhoIJp1OV4VNHCbCs9M7HUVBpgC53PDcTUQuwcgeY6 14 | pQgo9eT1eLNSZVrJ5Bctivl1UcD6P6CIGkkeT2gNhqindRPngUXGXW7Qzoefe+fV 15 | QqJSm7Tq2q9oqVZ46J964waCRItRySpuW5dxZO34WM6wsw2BP2MlACbH4l3luqtp 16 | Xo3Bvfnk+HAFH3HcMuwdaulxv7zYKXCfNoSfgrpEfo2Ex4Im/I3WdtwME/Gbnwdq 17 | 3VJzgAxLVFhczDHwNkjmIdPAlNJ9/ixRjip4dgZtW8VcBCrNoL+LhDrIfjvnLdRu 18 | vBHy9P3sCF7FZycaHlMWP6RiLtHnEMGcbZ8QpQHi2dReU1wyr9QgguGU+jqSXYar 19 | 1yEcsdRGasppNIZ8+Qawbm/a4doT10TEtPArhSoHlwbvqTDYjtfV92lC/2iwgO6g 20 | YgG9XrO4V8dV39Ffm7oLFfvTbg5mv4Q/E6AWo/gkjmtxkculbyAvjFtYAQARAQAB 21 | tCFFUEVMICg2KSA8ZXBlbEBmZWRvcmFwcm9qZWN0Lm9yZz6JAjYEEwECACAFAkvS 22 | KUICGw8GCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRA7Sd8qBgi4lR/GD/wLGPv9 23 | qO39eyb9NlrwfKdUEo1tHxKdrhNz+XYrO4yVDTBZRPSuvL2yaoeSIhQOKhNPfEgT 24 | 9mdsbsgcfmoHxmGVcn+lbheWsSvcgrXuz0gLt8TGGKGGROAoLXpuUsb1HNtKEOwP 25 | Q4z1uQ2nOz5hLRyDOV0I2LwYV8BjGIjBKUMFEUxFTsL7XOZkrAg/WbTH2PW3hrfS 26 | WtcRA7EYonI3B80d39ffws7SmyKbS5PmZjqOPuTvV2F0tMhKIhncBwoojWZPExft 27 | HpKhzKVh8fdDO/3P1y1Fk3Cin8UbCO9MWMFNR27fVzCANlEPljsHA+3Ez4F7uboF 28 | p0OOEov4Yyi4BEbgqZnthTG4ub9nyiupIZ3ckPHr3nVcDUGcL6lQD/nkmNVIeLYP 29 | x1uHPOSlWfuojAYgzRH6LL7Idg4FHHBA0to7FW8dQXFIOyNiJFAOT2j8P5+tVdq8 30 | wB0PDSH8yRpn4HdJ9RYquau4OkjluxOWf0uRaS//SUcCZh+1/KBEOmcvBHYRZA5J 31 | l/nakCgxGb2paQOzqqpOcHKvlyLuzO5uybMXaipLExTGJXBlXrbbASfXa/yGYSAG 32 | iVrGz9CE6676dMlm8F+s3XXE13QZrXmjloc6jwOljnfAkjTGXjiB7OULESed96MR 33 | XtfLk0W5Ab9pd7tKDR6QHI7rgHXfCopRnZ2VVQ== 34 | =V/6I 35 | -----END PGP PUBLIC KEY BLOCK----- 36 | 37 | /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7: # https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 38 | content: | 39 | -----BEGIN PGP PUBLIC KEY BLOCK----- 40 | Version: GnuPG v1.4.11 (GNU/Linux) 41 | 42 | mQINBFKuaIQBEAC1UphXwMqCAarPUH/ZsOFslabeTVO2pDk5YnO96f+rgZB7xArB 43 | OSeQk7B90iqSJ85/c72OAn4OXYvT63gfCeXpJs5M7emXkPsNQWWSju99lW+AqSNm 44 | jYWhmRlLRGl0OO7gIwj776dIXvcMNFlzSPj00N2xAqjMbjlnV2n2abAE5gq6VpqP 45 | vFXVyfrVa/ualogDVmf6h2t4Rdpifq8qTHsHFU3xpCz+T6/dGWKGQ42ZQfTaLnDM 46 | jToAsmY0AyevkIbX6iZVtzGvanYpPcWW4X0RDPcpqfFNZk643xI4lsZ+Y2Er9Yu5 47 | S/8x0ly+tmmIokaE0wwbdUu740YTZjCesroYWiRg5zuQ2xfKxJoV5E+Eh+tYwGDJ 48 | n6HfWhRgnudRRwvuJ45ztYVtKulKw8QQpd2STWrcQQDJaRWmnMooX/PATTjCBExB 49 | 9dkz38Druvk7IkHMtsIqlkAOQMdsX1d3Tov6BE2XDjIG0zFxLduJGbVwc/6rIc95 50 | T055j36Ez0HrjxdpTGOOHxRqMK5m9flFbaxxtDnS7w77WqzW7HjFrD0VeTx2vnjj 51 | GqchHEQpfDpFOzb8LTFhgYidyRNUflQY35WLOzLNV+pV3eQ3Jg11UFwelSNLqfQf 52 | uFRGc+zcwkNjHh5yPvm9odR1BIfqJ6sKGPGbtPNXo7ERMRypWyRz0zi0twARAQAB 53 | tChGZWRvcmEgRVBFTCAoNykgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB 54 | AgAiBQJSrmiEAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBqL66iNSxk 55 | 5cfGD/4spqpsTjtDM7qpytKLHKruZtvuWiqt5RfvT9ww9GUUFMZ4ZZGX4nUXg49q 56 | ixDLayWR8ddG/s5kyOi3C0uX/6inzaYyRg+Bh70brqKUK14F1BrrPi29eaKfG+Gu 57 | MFtXdBG2a7OtPmw3yuKmq9Epv6B0mP6E5KSdvSRSqJWtGcA6wRS/wDzXJENHp5re 58 | 9Ism3CYydpy0GLRA5wo4fPB5uLdUhLEUDvh2KK//fMjja3o0L+SNz8N0aDZyn5Ax 59 | CU9RB3EHcTecFgoy5umRj99BZrebR1NO+4gBrivIfdvD4fJNfNBHXwhSH9ACGCNv 60 | HnXVjHQF9iHWApKkRIeh8Fr2n5dtfJEF7SEX8GbX7FbsWo29kXMrVgNqHNyDnfAB 61 | VoPubgQdtJZJkVZAkaHrMu8AytwT62Q4eNqmJI1aWbZQNI5jWYqc6RKuCK6/F99q 62 | thFT9gJO17+yRuL6Uv2/vgzVR1RGdwVLKwlUjGPAjYflpCQwWMAASxiv9uPyYPHc 63 | ErSrbRG0wjIfAR3vus1OSOx3xZHZpXFfmQTsDP7zVROLzV98R3JwFAxJ4/xqeON4 64 | vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt 65 | RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw== 66 | =hdPa 67 | -----END PGP PUBLIC KEY BLOCK----- 68 | 69 | /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8: # https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8 70 | content: | 71 | -----BEGIN PGP PUBLIC KEY BLOCK----- 72 | 73 | mQINBFz3zvsBEADJOIIWllGudxnpvJnkxQz2CtoWI7godVnoclrdl83kVjqSQp+2 74 | dgxuG5mUiADUfYHaRQzxKw8efuQnwxzU9kZ70ngCxtmbQWGmUmfSThiapOz00018 75 | +eo5MFabd2vdiGo1y+51m2sRDpN8qdCaqXko65cyMuLXrojJHIuvRA/x7iqOrRfy 76 | a8x3OxC4PEgl5pgDnP8pVK0lLYncDEQCN76D9ubhZQWhISF/zJI+e806V71hzfyL 77 | /Mt3mQm/li+lRKU25Usk9dWaf4NH/wZHMIPAkVJ4uD4H/uS49wqWnyiTYGT7hUbi 78 | ecF7crhLCmlRzvJR8mkRP6/4T/F3tNDPWZeDNEDVFUkTFHNU6/h2+O398MNY/fOh 79 | yKaNK3nnE0g6QJ1dOH31lXHARlpFOtWt3VmZU0JnWLeYdvap4Eff9qTWZJhI7Cq0 80 | Wm8DgLUpXgNlkmquvE7P2W5EAr2E5AqKQoDbfw/GiWdRvHWKeNGMRLnGI3QuoX3U 81 | pAlXD7v13VdZxNydvpeypbf/AfRyrHRKhkUj3cU1pYkM3DNZE77C5JUe6/0nxbt4 82 | ETUZBTgLgYJGP8c7PbkVnO6I/KgL1jw+7MW6Az8Ox+RXZLyGMVmbW/TMc8haJfKL 83 | MoUo3TVk8nPiUhoOC0/kI7j9ilFrBxBU5dUtF4ITAWc8xnG6jJs/IsvRpQARAQAB 84 | tChGZWRvcmEgRVBFTCAoOCkgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB 85 | AgAiBQJc9877AhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAh6kWrL4bW 86 | oWagD/4xnLWws34GByVDQkjprk0fX7Iyhpm/U7BsIHKspHLL+Y46vAAGY/9vMvdE 87 | 0fcr9Ek2Zp7zE1RWmSCzzzUgTG6BFoTG1H4Fho/7Z8BXK/jybowXSZfqXnTOfhSF 88 | alwDdwlSJvfYNV9MbyvbxN8qZRU1z7PEWZrIzFDDToFRk0R71zHpnPTNIJ5/YXTw 89 | NqU9OxII8hMQj4ufF11040AJQZ7br3rzerlyBOB+Jd1zSPVrAPpeMyJppWFHSDAI 90 | WK6x+am13VIInXtqB/Cz4GBHLFK5d2/IYspVw47Solj8jiFEtnAq6+1Aq5WH3iB4 91 | bE2e6z00DSF93frwOyWN7WmPIoc2QsNRJhgfJC+isGQAwwq8xAbHEBeuyMG8GZjz 92 | xohg0H4bOSEujVLTjH1xbAG4DnhWO/1VXLX+LXELycO8ZQTcjj/4AQKuo4wvMPrv 93 | 9A169oETG+VwQlNd74VBPGCvhnzwGXNbTK/KH1+WRH0YSb+41flB3NKhMSU6dGI0 94 | SGtIxDSHhVVNmx2/6XiT9U/znrZsG5Kw8nIbbFz+9MGUUWgJMsd1Zl9R8gz7V9fp 95 | n7L7y5LhJ8HOCMsY/Z7/7HUs+t/A1MI4g7Q5g5UuSZdgi0zxukiWuCkLeAiAP4y7 96 | zKK4OjJ644NDcWCHa36znwVmkz3ixL8Q0auR15Oqq2BjR/fyog== 97 | =84m8 98 | -----END PGP PUBLIC KEY BLOCK----- 99 | 100 | /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9: # https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9 101 | content: | 102 | -----BEGIN PGP PUBLIC KEY BLOCK----- 103 | 104 | mQINBGE3mOsBEACsU+XwJWDJVkItBaugXhXIIkb9oe+7aadELuVo0kBmc3HXt/Yp 105 | CJW9hHEiGZ6z2jwgPqyJjZhCvcAWvgzKcvqE+9i0NItV1rzfxrBe2BtUtZmVcuE6 106 | 2b+SPfxQ2Hr8llaawRjt8BCFX/ZzM4/1Qk+EzlfTcEcpkMf6wdO7kD6ulBk/tbsW 107 | DHX2lNcxszTf+XP9HXHWJlA2xBfP+Dk4gl4DnO2Y1xR0OSywE/QtvEbN5cY94ieu 108 | n7CBy29AleMhmbnx9pw3NyxcFIAsEZHJoU4ZW9ulAJ/ogttSyAWeacW7eJGW31/Z 109 | 39cS+I4KXJgeGRI20RmpqfH0tuT+X5Da59YpjYxkbhSK3HYBVnNPhoJFUc2j5iKy 110 | XLgkapu1xRnEJhw05kr4LCbud0NTvfecqSqa+59kuVc+zWmfTnGTYc0PXZ6Oa3rK 111 | 44UOmE6eAT5zd/ToleDO0VesN+EO7CXfRsm7HWGpABF5wNK3vIEF2uRr2VJMvgqS 112 | 9eNwhJyOzoca4xFSwCkc6dACGGkV+CqhufdFBhmcAsUotSxe3zmrBjqA0B/nxIvH 113 | DVgOAMnVCe+Lmv8T0mFgqZSJdIUdKjnOLu/GRFhjDKIak4jeMBMTYpVnU+HhMHLq 114 | uDiZkNEvEEGhBQmZuI8J55F/a6UURnxUwT3piyi3Pmr2IFD7ahBxPzOBCQARAQAB 115 | tCdGZWRvcmEgKGVwZWw5KSA8ZXBlbEBmZWRvcmFwcm9qZWN0Lm9yZz6JAk4EEwEI 116 | ADgWIQT/itE0RZcQbs6BO5GKOHK/MihGfAUCYTeY6wIbDwULCQgHAgYVCgkICwIE 117 | FgIDAQIeAQIXgAAKCRCKOHK/MihGfFX/EACBPWv20+ttYu1A5WvtHJPzwbj0U4yF 118 | 3zTQpBglQ2UfkRpYdipTlT3Ih6j5h2VmgRPtINCc/ZE28adrWpBoeFIS2YAKOCLC 119 | nZYtHl2nCoLq1U7FSttUGsZ/t8uGCBgnugTfnIYcmlP1jKKA6RJAclK89evDQX5n 120 | R9ZD+Cq3CBMlttvSTCht0qQVlwycedH8iWyYgP/mF0W35BIn7NuuZwWhgR00n/VG 121 | 4nbKPOzTWbsP45awcmivdrS74P6mL84WfkghipdmcoyVb1B8ZP4Y/Ke0RXOnLhNe 122 | CfrXXvuW+Pvg2RTfwRDtehGQPAgXbmLmz2ZkV69RGIr54HJv84NDbqZovRTMr7gL 123 | 9k3ciCzXCiYQgM8yAyGHV0KEhFSQ1HV7gMnt9UmxbxBE2pGU7vu3CwjYga5DpwU7 124 | w5wu1TmM5KgZtZvuWOTDnqDLf0cKoIbW8FeeCOn24elcj32bnQDuF9DPey1mqcvT 125 | /yEo/Ushyz6CVYxN8DGgcy2M9JOsnmjDx02h6qgWGWDuKgb9jZrvRedpAQCeemEd 126 | fhEs6ihqVxRFl16HxC4EVijybhAL76SsM2nbtIqW1apBQJQpXWtQwwdvgTVpdEtE 127 | r4ArVJYX5LrswnWEQMOelugUG6S3ZjMfcyOa/O0364iY73vyVgaYK+2XtT2usMux 128 | VL469Kj5m13T6w== 129 | =Mjs/ 130 | -----END PGP PUBLIC KEY BLOCK----- 131 | -------------------------------------------------------------------------------- /data/os/RedHat/AlmaLinux/8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | yum::os_default_repos: 3 | - 'baseos' 4 | - 'appstream' 5 | - 'powertools' 6 | - 'extras' 7 | - 'ha' 8 | - 'plus' 9 | - 'resilientstorage' 10 | - 'baseos-source' 11 | - 'appstream-source' 12 | - 'powertools-source' 13 | - 'extras-source' 14 | - 'ha-source' 15 | - 'plus-source' 16 | - 'resilientstorage-source' 17 | - 'baseos-debuginfo' 18 | - 'appstream-debuginfo' 19 | - 'powertools-debuginfo' 20 | - 'extras-debuginfo' 21 | - 'ha-debuginfo' 22 | - 'plus-debuginfo' 23 | - 'resilientstorage-debuginfo' 24 | 25 | yum::repos: 26 | baseos: 27 | descr: 'AlmaLinux-$releasever - BaseOS' 28 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/baseos' 29 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/ 30 | enabled: true 31 | gpgcheck: true 32 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 33 | target: '/etc/yum.repos.d/almalinux.repo' 34 | 35 | appstream: 36 | descr: 'AlmaLinux $releasever - AppStream' 37 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/appstream' 38 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/AppStream/$basearch/os/ 39 | enabled: true 40 | gpgcheck: true 41 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux" 42 | target: '/etc/yum.repos.d/almalinux.repo' 43 | 44 | powertools: 45 | descr: 'AlmaLinux $releasever - PowerTools' 46 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/powertools' 47 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/PowerTools/$basearch/os/ 48 | enabled: true 49 | gpgcheck: true 50 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 51 | target: '/etc/yum.repos.d/almalinux-powertools.repo' 52 | 53 | extras: 54 | descr: 'AlmaLinux $releasever - Extras' 55 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/extras' 56 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/extras/$basearch/os/ 57 | enabled: true 58 | gpgcheck: true 59 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 60 | target: '/etc/yum.repos.d/almalinux.repo' 61 | 62 | ha: 63 | descr: 'AlmaLinux $releasever - HighAvailability' 64 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/ha' 65 | enabled: false 66 | gpgcheck: true 67 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 68 | target: '/etc/yum.repos.d/almalinux-ha.repo' 69 | 70 | plus: 71 | descr: 'AlmaLinux $releasever - Plus' 72 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/plus' 73 | enabled: false 74 | gpgcheck: true 75 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 76 | target: '/etc/yum.repos.d/almalinux-plus.repo' 77 | 78 | resilientstorage: 79 | descr: AlmaLinux $releasever - ResilientStorage 80 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage 81 | enabled: false 82 | gpgcheck: true 83 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 84 | target: '/etc/yum.repos.d/almalinux-resilientstorage.repo' 85 | 86 | baseos-source: 87 | descr: 'AlmaLinux $releasever - BaseOS Source' 88 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-source' 89 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/BaseOS/Source/ 90 | enabled: false 91 | gpgcheck: true 92 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 93 | target: '/etc/yum.repos.d/almalinux.repo' 94 | 95 | appstream-source: 96 | descr: 'AlmaLinux $releasever - AppStream Source' 97 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-source' 98 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/AppStream/Source/ 99 | enabled: false 100 | gpgcheck: true 101 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 102 | target: '/etc/yum.repos.d/almalinux.repo' 103 | 104 | powertools-source: 105 | descr: 'AlmaLinux $releasever - PowerTools Source' 106 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/powertools-source' 107 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/PowerTools/Source/ 108 | enabled: false 109 | gpgcheck: true 110 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 111 | target: '/etc/yum.repos.d/almalinux-powertools.repo' 112 | 113 | extras-source: 114 | descr: 'AlmaLinux $releasever - Extras Source' 115 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/extras-source' 116 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/extras/Source/ 117 | enabled: false 118 | gpgcheck: true 119 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 120 | target: '/etc/yum.repos.d/almalinux.repo' 121 | 122 | ha-source: 123 | descr: 'AlmaLinux $releasever - HighAvailability Source' 124 | enabled: false 125 | gpgcheck: true 126 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 127 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/ha-source' 128 | target: '/etc/yum.repos.d/almalinux-ha.repo' 129 | 130 | plus-source: 131 | descr: 'AlmaLinux $releasever - Plus Source' 132 | enabled: false 133 | gpgcheck: true 134 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 135 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/plus-source' 136 | target: '/etc/yum.repos.d/almalinux-plus.repo' 137 | 138 | resilientstorage-source: 139 | descr: 'AlmaLinux $releasever - ResilientStorage Source' 140 | enabled: false 141 | gpgcheck: true 142 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 143 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage-source' 144 | target: '/etc/yum.repos.d/almalinux-resilientstorage.repo' 145 | 146 | baseos-debuginfo: 147 | descr: 'AlmaLinux $releasever - BaseOS debuginfo' 148 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-debuginfo' 149 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/BaseOS/debug/$basearch/ 150 | enabled: false 151 | gpgcheck: true 152 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 153 | target: '/etc/yum.repos.d/almalinux.repo' 154 | 155 | appstream-debuginfo: 156 | descr: 'AlmaLinux $releasever - AppStream debuginfo' 157 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-debuginfo' 158 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/AppStream/debug/$basearch/ 159 | enabled: false 160 | gpgcheck: true 161 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 162 | target: '/etc/yum.repos.d/almalinux.repo' 163 | 164 | powertools-debuginfo: 165 | descr: 'AlmaLinux $releasever - PowerTools debuginfo' 166 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/powertools-debuginfo' 167 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/PowerTools/debug/$basearch/ 168 | enabled: false 169 | gpgcheck: true 170 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 171 | target: '/etc/yum.repos.d/almalinux-powertools.repo' 172 | 173 | extras-debuginfo: 174 | descr: 'AlmaLinux $releasever - Extras debuginfo' 175 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/extras-debuginfo' 176 | # baseurl: https://repo.almalinux.org/almalinux/$releasever/extras/debug/$basearch/ 177 | enabled: false 178 | gpgcheck: true 179 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 180 | target: '/etc/yum.repos.d/almalinux.repo' 181 | 182 | ha-debuginfo: 183 | descr: 'AlmaLinux $releasever - HighAvailability debuginfo' 184 | enabled: false 185 | gpgcheck: true 186 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 187 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/ha-debuginfo' 188 | target: '/etc/yum.repos.d/almalinux-ha.repo' 189 | 190 | plus-debuginfo: 191 | descr: 'AlmaLinux $releasever - Plus debuginfo' 192 | enabled: false 193 | gpgcheck: true 194 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 195 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/plus-debuginfo' 196 | target: '/etc/yum.repos.d/almalinux-plus.repo' 197 | 198 | resilientstorage-debuginfo: 199 | descr: 'AlmaLinux $releasever - ResilientStorage debuginfo' 200 | enabled: false 201 | gpgcheck: true 202 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' 203 | mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage-debuginfo' 204 | target: '/etc/yum.repos.d/almalinux-resilientstorage.repo' 205 | -------------------------------------------------------------------------------- /data/os/RedHat/AlmaLinux/9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | yum::os_default_repos: 3 | - appstream 4 | - appstream-debuginfo 5 | - appstream-source 6 | - plus 7 | - plus-debuginfo 8 | - plus-source 9 | - saphana 10 | - saphana-debuginfo 11 | - saphana-source 12 | - crb 13 | - crb-debuginfo 14 | - crb-source 15 | - baseos 16 | - baseos-debuginfo 17 | - baseos-source 18 | - highavailability 19 | - highavailability-debuginfo 20 | - highavailability-source 21 | - extras 22 | - extras-debuginfo 23 | - extras-source 24 | - nfv 25 | - nfv-debuginfo 26 | - nfv-source 27 | - resilientstorage 28 | - resilientstorage-debuginfo 29 | - resilientstorage-source 30 | - rt 31 | - rt-debuginfo 32 | - rt-source 33 | - sap 34 | - sap-debuginfo 35 | - sap-source 36 | yum::repos: 37 | appstream-debuginfo: 38 | descr: AlmaLinux $releasever - AppStream - Debug 39 | enabled: false 40 | gpgcheck: true 41 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 42 | metadata_expire: 86400 43 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-debug 44 | target: "/etc/yum.repos.d/almalinux-appstream.repo" 45 | appstream-source: 46 | descr: AlmaLinux $releasever - AppStream - Source 47 | enabled: false 48 | gpgcheck: true 49 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 50 | metadata_expire: 86400 51 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-source 52 | target: "/etc/yum.repos.d/almalinux-appstream.repo" 53 | appstream: 54 | descr: AlmaLinux $releasever - AppStream 55 | enabled: true 56 | gpgcheck: true 57 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 58 | metadata_expire: 86400 59 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/appstream 60 | target: "/etc/yum.repos.d/almalinux-appstream.repo" 61 | baseos-debuginfo: 62 | descr: AlmaLinux $releasever - BaseOS - Debug 63 | enabled: false 64 | gpgcheck: true 65 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 66 | metadata_expire: 86400 67 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-debug 68 | target: "/etc/yum.repos.d/almalinux-baseos.repo" 69 | baseos-source: 70 | descr: AlmaLinux $releasever - BaseOS - Source 71 | enabled: false 72 | gpgcheck: true 73 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 74 | metadata_expire: 86400 75 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-source 76 | target: "/etc/yum.repos.d/almalinux-baseos.repo" 77 | baseos: 78 | descr: AlmaLinux $releasever - BaseOS 79 | enabled: true 80 | gpgcheck: true 81 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 82 | metadata_expire: 86400 83 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/baseos 84 | target: "/etc/yum.repos.d/almalinux-baseos.repo" 85 | crb-debuginfo: 86 | descr: AlmaLinux $releasever - CRB - Debug 87 | enabled: false 88 | gpgcheck: true 89 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 90 | metadata_expire: 86400 91 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/crb-debug 92 | target: "/etc/yum.repos.d/almalinux-crb.repo" 93 | crb-source: 94 | descr: AlmaLinux $releasever - CRB - Source 95 | enabled: false 96 | gpgcheck: true 97 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 98 | metadata_expire: 86400 99 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/crb-source 100 | target: "/etc/yum.repos.d/almalinux-crb.repo" 101 | crb: 102 | descr: AlmaLinux $releasever - CRB 103 | enabled: false 104 | gpgcheck: true 105 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 106 | metadata_expire: 86400 107 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/crb 108 | target: "/etc/yum.repos.d/almalinux-crb.repo" 109 | extras-debuginfo: 110 | descr: AlmaLinux $releasever - Extras - Debug 111 | enabled: false 112 | gpgcheck: true 113 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 114 | metadata_expire: 86400 115 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/extras-debug 116 | target: "/etc/yum.repos.d/almalinux-extras.repo" 117 | extras-source: 118 | descr: AlmaLinux $releasever - Extras - Source 119 | enabled: false 120 | gpgcheck: true 121 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 122 | metadata_expire: 86400 123 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/extras-source 124 | target: "/etc/yum.repos.d/almalinux-extras.repo" 125 | extras: 126 | descr: AlmaLinux $releasever - Extras 127 | enabled: true 128 | gpgcheck: true 129 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 130 | metadata_expire: 86400 131 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/extras 132 | target: "/etc/yum.repos.d/almalinux-extras.repo" 133 | highavailability-debuginfo: 134 | descr: AlmaLinux $releasever - HighAvailability - Debug 135 | enabled: false 136 | gpgcheck: true 137 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 138 | metadata_expire: 86400 139 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability-debug 140 | target: "/etc/yum.repos.d/almalinux-highavailability.repo" 141 | highavailability-source: 142 | descr: AlmaLinux $releasever - HighAvailability - Source 143 | enabled: false 144 | gpgcheck: true 145 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 146 | metadata_expire: 86400 147 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability-source 148 | target: "/etc/yum.repos.d/almalinux-highavailability.repo" 149 | highavailability: 150 | descr: AlmaLinux $releasever - HighAvailability 151 | enabled: false 152 | gpgcheck: true 153 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 154 | metadata_expire: 86400 155 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability 156 | target: "/etc/yum.repos.d/almalinux-highavailability.repo" 157 | nfv-debuginfo: 158 | descr: AlmaLinux $releasever - NFV - Debug 159 | enabled: false 160 | gpgcheck: true 161 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 162 | metadata_expire: 86400 163 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/nfv-debug 164 | target: "/etc/yum.repos.d/almalinux-nfv.repo" 165 | nfv-source: 166 | descr: AlmaLinux $releasever - NFV - Source 167 | enabled: false 168 | gpgcheck: true 169 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 170 | metadata_expire: 86400 171 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/nfv-source 172 | target: "/etc/yum.repos.d/almalinux-nfv.repo" 173 | nfv: 174 | descr: AlmaLinux $releasever - NFV 175 | enabled: false 176 | gpgcheck: true 177 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 178 | metadata_expire: 86400 179 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/nfv 180 | target: "/etc/yum.repos.d/almalinux-nfv.repo" 181 | plus-debuginfo: 182 | descr: AlmaLinux $releasever - Plus - Debug 183 | enabled: false 184 | gpgcheck: true 185 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 186 | metadata_expire: 86400 187 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/plus-debug 188 | target: "/etc/yum.repos.d/almalinux-plus.repo" 189 | plus-source: 190 | descr: AlmaLinux $releasever - Plus - Source 191 | enabled: false 192 | gpgcheck: true 193 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 194 | metadata_expire: 86400 195 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/plus-source 196 | target: "/etc/yum.repos.d/almalinux-plus.repo" 197 | plus: 198 | descr: AlmaLinux $releasever - Plus 199 | enabled: false 200 | gpgcheck: true 201 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 202 | metadata_expire: 86400 203 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/plus 204 | target: "/etc/yum.repos.d/almalinux-plus.repo" 205 | resilientstorage-debuginfo: 206 | descr: AlmaLinux $releasever - ResilientStorage - Debug 207 | enabled: false 208 | gpgcheck: true 209 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 210 | metadata_expire: 86400 211 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage-debug 212 | target: "/etc/yum.repos.d/almalinux-resilientstorage.repo" 213 | resilientstorage-source: 214 | descr: AlmaLinux $releasever - ResilientStorage - Source 215 | enabled: false 216 | gpgcheck: true 217 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 218 | metadata_expire: 86400 219 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage-source 220 | target: "/etc/yum.repos.d/almalinux-resilientstorage.repo" 221 | resilientstorage: 222 | descr: AlmaLinux $releasever - ResilientStorage 223 | enabled: false 224 | gpgcheck: true 225 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 226 | metadata_expire: 86400 227 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage 228 | target: "/etc/yum.repos.d/almalinux-resilientstorage.repo" 229 | rt-debuginfo: 230 | descr: AlmaLinux $releasever - RT - Debug 231 | enabled: false 232 | gpgcheck: true 233 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 234 | metadata_expire: 86400 235 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/rt-debug 236 | target: "/etc/yum.repos.d/almalinux-rt.repo" 237 | rt-source: 238 | descr: AlmaLinux $releasever - RT - Source 239 | enabled: false 240 | gpgcheck: true 241 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 242 | metadata_expire: 86400 243 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/rt-source 244 | target: "/etc/yum.repos.d/almalinux-rt.repo" 245 | rt: 246 | descr: AlmaLinux $releasever - RT 247 | enabled: false 248 | gpgcheck: true 249 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 250 | metadata_expire: 86400 251 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/rt 252 | target: "/etc/yum.repos.d/almalinux-rt.repo" 253 | sap-debuginfo: 254 | descr: AlmaLinux $releasever - SAP - Debug 255 | enabled: false 256 | gpgcheck: true 257 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 258 | metadata_expire: 86400 259 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/sap-debug 260 | target: "/etc/yum.repos.d/almalinux-sap.repo" 261 | sap-source: 262 | descr: AlmaLinux $releasever - SAP - Source 263 | enabled: false 264 | gpgcheck: true 265 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 266 | metadata_expire: 86400 267 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/sap-source 268 | target: "/etc/yum.repos.d/almalinux-sap.repo" 269 | sap: 270 | descr: AlmaLinux $releasever - SAP 271 | enabled: false 272 | gpgcheck: true 273 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 274 | metadata_expire: 86400 275 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/sap 276 | target: "/etc/yum.repos.d/almalinux-sap.repo" 277 | saphana-debuginfo: 278 | descr: AlmaLinux $releasever - SAPHANA - Debug 279 | enabled: false 280 | gpgcheck: true 281 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 282 | metadata_expire: 86400 283 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/saphana-debug 284 | target: "/etc/yum.repos.d/almalinux-saphana.repo" 285 | saphana-source: 286 | descr: AlmaLinux $releasever - SAPHANA - Source 287 | enabled: false 288 | gpgcheck: true 289 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 290 | metadata_expire: 86400 291 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/saphana-source 292 | target: "/etc/yum.repos.d/almalinux-saphana.repo" 293 | saphana: 294 | descr: AlmaLinux $releasever - SAPHANA 295 | enabled: false 296 | gpgcheck: true 297 | gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 298 | metadata_expire: 86400 299 | mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/saphana 300 | target: "/etc/yum.repos.d/almalinux-saphana.repo" 301 | -------------------------------------------------------------------------------- /data/os/RedHat/Amazon.yaml: -------------------------------------------------------------------------------- 1 | # Amazon Linux default repos 2 | --- 3 | yum::os_default_repos: 4 | - 'amzn-main' 5 | - 'amzn-main-debuginfo' 6 | - 'amzn-main-source' 7 | - 'amzn-nosrc' 8 | - 'amzn-preview' 9 | - 'amzn-preview-debuginfo' 10 | - 'amzn-preview-source' 11 | - 'amzn-updates' 12 | - 'amzn-updates-debuginfo' 13 | - 'amzn-updates-source' 14 | - 'epel' 15 | - 'epel-debuginfo' 16 | - 'epel-source' 17 | - 'epel-testing' 18 | - 'epel-testing-debuginfo' 19 | - 'epel-testing-source' 20 | 21 | # Upstream repo parameters "fastestmirror_enabled" and "report_instanceid" 22 | # not defined for Amazon Linux default repos as Puppet does not currently 23 | # support them. For more details, see: 24 | # https://tickets.puppetlabs.com/browse/PUP-8730 25 | # https://tickets.puppetlabs.com/browse/PUP-8904 26 | yum::repos: 27 | amzn-main: 28 | descr: "amzn-main-Base" 29 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/main/mirror.list" 30 | mirrorlist_expire: 300 31 | metadata_expire: 300 32 | priority: 10 33 | failovermethod: "priority" 34 | gpgcheck: true 35 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 36 | enabled: true 37 | retries: 3 38 | timeout: 5 39 | target: "/etc/yum.repos.d/amzn-main.repo" 40 | amzn-main-debuginfo: 41 | descr: "amzn-main-debuginfo" 42 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/main/debuginfo/mirror.list" 43 | mirrorlist_expire: 300 44 | metadata_expire: 300 45 | priority: 10 46 | failovermethod: "priority" 47 | gpgcheck: true 48 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 49 | enabled: false 50 | retries: 3 51 | timeout: 5 52 | target: "/etc/yum.repos.d/amzn-main.repo" 53 | amzn-main-source: 54 | descr: "amzn-main-source" 55 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/main/SRPMS/mirror.list" 56 | mirrorlist_expire: 300 57 | metadata_expire: 300 58 | priority: 10 59 | failovermethod: "priority" 60 | gpgcheck: true 61 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 62 | enabled: false 63 | retries: 3 64 | timeout: 5 65 | target: "/etc/yum.repos.d/amzn-main.repo" 66 | amzn-nosrc: 67 | descr: "amzn-nosrc-Base" 68 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/nosrc/mirror.list" 69 | mirrorlist_expire: 300 70 | metadata_expire: 300 71 | priority: 10 72 | failovermethod: "priority" 73 | gpgcheck: false 74 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 75 | enabled: false 76 | retries: 3 77 | timeout: 5 78 | target: "/etc/yum.repos.d/amzn-nosrc.repo" 79 | amzn-preview: 80 | descr: "amzn-preview-Base" 81 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/preview/mirror.list" 82 | mirrorlist_expire: 300 83 | metadata_expire: 300 84 | priority: 10 85 | failovermethod: "priority" 86 | gpgcheck: true 87 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 88 | enabled: false 89 | retries: 3 90 | timeout: 5 91 | target: "/etc/yum.repos.d/amzn-preview.repo" 92 | amzn-preview-debuginfo: 93 | descr: "amzn-preview-debuginfo" 94 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/preview/debuginfo/mirror.list" 95 | mirrorlist_expire: 300 96 | metadata_expire: 300 97 | priority: 10 98 | failovermethod: "priority" 99 | gpgcheck: true 100 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 101 | enabled: false 102 | retries: 3 103 | timeout: 5 104 | target: "/etc/yum.repos.d/amzn-preview.repo" 105 | amzn-preview-source: 106 | descr: "amzn-preview-source" 107 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/preview/SRPMS/mirror.list" 108 | mirrorlist_expire: 300 109 | metadata_expire: 300 110 | priority: 10 111 | failovermethod: "priority" 112 | gpgcheck: true 113 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 114 | enabled: false 115 | retries: 3 116 | timeout: 5 117 | target: "/etc/yum.repos.d/amzn-preview.repo" 118 | amzn-updates: 119 | descr: "amzn-updates-Base" 120 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list" 121 | mirrorlist_expire: 300 122 | metadata_expire: 300 123 | priority: 10 124 | failovermethod: "priority" 125 | gpgcheck: true 126 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 127 | enabled: true 128 | retries: 3 129 | timeout: 5 130 | target: "/etc/yum.repos.d/amzn-updates.repo" 131 | amzn-updates-debuginfo: 132 | descr: "amzn-updates-debuginfo" 133 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/updates/debuginfo/mirror.list" 134 | mirrorlist_expire: 300 135 | metadata_expire: 300 136 | priority: 10 137 | failovermethod: "priority" 138 | gpgcheck: true 139 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 140 | enabled: false 141 | retries: 3 142 | timeout: 5 143 | target: "/etc/yum.repos.d/amzn-updates.repo" 144 | amzn-updates-source: 145 | descr: "amzn-updates-source" 146 | mirrorlist: "http://repo.$awsregion.$awsdomain/$releasever/updates/SRPMS/mirror.list" 147 | mirrorlist_expire: 300 148 | metadata_expire: 300 149 | priority: 10 150 | failovermethod: "priority" 151 | gpgcheck: true 152 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga" 153 | enabled: false 154 | retries: 3 155 | timeout: 5 156 | target: "/etc/yum.repos.d/amzn-updates.repo" 157 | epel: 158 | descr: "Extra Packages for Enterprise Linux 6 - $basearch" 159 | #baseurl: "http://download.fedoraproject.org/pub/epel/6/$basearch" 160 | mirrorlist: "https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch" 161 | failovermethod: "priority" 162 | enabled: false 163 | gpgcheck: true 164 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" 165 | target: "/etc/yum.repos.d/epel.repo" 166 | epel-debuginfo: 167 | descr: "Extra Packages for Enterprise Linux 6 - $basearch - Debug" 168 | #baseurl: "http://download.fedoraproject.org/pub/epel/6/$basearch/debug" 169 | mirrorlist: "https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch" 170 | failovermethod: "priority" 171 | enabled: false 172 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" 173 | gpgcheck: true 174 | target: "/etc/yum.repos.d/epel.repo" 175 | epel-source: 176 | descr: "Extra Packages for Enterprise Linux 6 - $basearch - Source" 177 | #baseurl: "http://download.fedoraproject.org/pub/epel/6/SRPMS" 178 | mirrorlist: "https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch" 179 | failovermethod: "priority" 180 | enabled: false 181 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" 182 | gpgcheck: true 183 | target: "/etc/yum.repos.d/epel.repo" 184 | epel-testing: 185 | descr: "Extra Packages for Enterprise Linux 6 - Testing - $basearch" 186 | #baseurl: "http://download.fedoraproject.org/pub/epel/testing/6/$basearch" 187 | mirrorlist: "https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch" 188 | failovermethod: "priority" 189 | enabled: false 190 | gpgcheck: true 191 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" 192 | target: "/etc/yum.repos.d/epel-testing.repo" 193 | epel-testing-debuginfo: 194 | descr: "Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug" 195 | #baseurl: "http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug" 196 | mirrorlist: "https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch" 197 | failovermethod: "priority" 198 | enabled: false 199 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" 200 | gpgcheck: true 201 | target: "/etc/yum.repos.d/epel-testing.repo" 202 | epel-testing-source: 203 | descr: "Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source" 204 | #baseurl: "http://download.fedoraproject.org/pub/epel/testing/6/SRPMS" 205 | mirrorlist: "https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch" 206 | failovermethod: "priority" 207 | enabled: false 208 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" 209 | gpgcheck: true 210 | target: "/etc/yum.repos.d/epel-testing.repo" 211 | -------------------------------------------------------------------------------- /data/os/RedHat/CentOS.yaml: -------------------------------------------------------------------------------- 1 | --- {} 2 | -------------------------------------------------------------------------------- /data/os/RedHat/CentOS/9.yaml: -------------------------------------------------------------------------------- 1 | yum::os_default_repos: 2 | - appstream 3 | - baseos 4 | - crb 5 | - extras-common 6 | - appstream-source 7 | - appstream-debug 8 | - baseos-source 9 | - baseos-debug 10 | - crb-source 11 | - crb-debug 12 | - highavailability 13 | - highavailability-source 14 | - highavailability-debug 15 | - nfv 16 | - nfv-source 17 | - nfv-debug 18 | - rt 19 | - rt-source 20 | - rt-debug 21 | - resilientstorage 22 | - resilientstorage-source 23 | - resilientstorage-debug 24 | - extras-common 25 | - extras-common-source 26 | 27 | yum::repos: 28 | appstream: 29 | enabled: true 30 | descr: 'CentOS Stream $releasever - AppStream' 31 | metalink: "https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http" 32 | metadata_expire: 6h 33 | gpgcheck: true 34 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 35 | target: '/etc/yum.repos.d/centos.repo' 36 | 37 | appstream-source: 38 | enabled: false 39 | descr: 'CentOS Stream $releasever - AppStream - Source' 40 | metalink: "https://mirrors.centos.org/metalink?repo=centos-appstream-source-$stream&arch=source&protocol=https,http" 41 | metadata_expire: 6h 42 | gpgcheck: true 43 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 44 | target: '/etc/yum.repos.d/centos.repo' 45 | 46 | appstream-debug: 47 | enabled: false 48 | descr: 'CentOS Stream $releasever - AppStream - Debug' 49 | metalink: "https://mirrors.centos.org/metalink?repo=centos-appstream-debug-$stream&arch=source&protocol=https,http" 50 | metadata_expire: 6h 51 | gpgcheck: true 52 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 53 | target: '/etc/yum.repos.d/centos.repo' 54 | 55 | baseos: 56 | enabled: true 57 | descr: 'CentOS Stream $releasever - BaseOS' 58 | metalink: "https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http" 59 | metadata_expire: 6h 60 | gpgcheck: true 61 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 62 | target: '/etc/yum.repos.d/centos.repo' 63 | 64 | baseos-source: 65 | enabled: false 66 | descr: 'CentOS Stream $releasever - BaseOS - Source' 67 | metalink: "https://mirrors.centos.org/metalink?repo=centos-baseos-source-$stream&arch=source&protocol=https,http" 68 | metadata_expire: 6h 69 | gpgcheck: true 70 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 71 | target: '/etc/yum.repos.d/centos.repo' 72 | 73 | baseos-debug: 74 | enabled: false 75 | descr: 'CentOS Stream $releasever - BaseOS - Debug' 76 | metalink: "https://mirrors.centos.org/metalink?repo=centos-baseos-debug-$stream&arch=source&protocol=https,http" 77 | metadata_expire: 6h 78 | gpgcheck: true 79 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 80 | target: '/etc/yum.repos.d/centos.repo' 81 | 82 | crb: 83 | enabled: false 84 | descr: 'CentOS Stream $releasever - Code Ready Builder' 85 | metalink: "https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http" 86 | metadata_expire: 6h 87 | gpgcheck: true 88 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 89 | target: '/etc/yum.repos.d/centos.repo' 90 | 91 | crb-source: 92 | enabled: false 93 | descr: 'CentOS Stream $releasever - Code Ready Builder - Source' 94 | metalink: "https://mirrors.centos.org/metalink?repo=centos-crb-source-$stream&arch=source&protocol=https,http" 95 | metadata_expire: 6h 96 | gpgcheck: true 97 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 98 | target: '/etc/yum.repos.d/centos.repo' 99 | 100 | crb-debug: 101 | enabled: false 102 | descr: 'CentOS Stream $releasever - Code Ready Builder - Debug' 103 | metalink: "https://mirrors.centos.org/metalink?repo=centos-crb-debug-$stream&arch=source&protocol=https,http" 104 | metadata_expire: 6h 105 | gpgcheck: true 106 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 107 | target: '/etc/yum.repos.d/centos.repo' 108 | 109 | highavailability: 110 | enabled: false 111 | descr: 'CentOS Stream $releasever - HighAvailability' 112 | metalink: "https://mirrors.centos.org/metalink?repo=centos-highavailability-$stream&arch=$basearch&protocol=https,http" 113 | metadata_expire: 6h 114 | gpgcheck: true 115 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 116 | target: centos-addons.repo 117 | 118 | highavailability-source: 119 | enabled: false 120 | descr: 'CentOS Stream $releasever - HighAvailability - Source' 121 | metalink: "https://mirrors.centos.org/metalink?repo=centos-highavailability-source-$stream&arch=$basearch&protocol=https,http" 122 | metadata_expire: 6h 123 | gpgcheck: true 124 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 125 | target: centos-addons.repo 126 | 127 | highavailability-debug: 128 | enabled: false 129 | descr: 'CentOS Stream $releasever - HighAvailability - Debug' 130 | metalink: "https://mirrors.centos.org/metalink?repo=centos-highavailability-debug-$stream&arch=$basearch&protocol=https,http" 131 | metadata_expire: 6h 132 | gpgcheck: true 133 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 134 | target: centos-addons.repo 135 | 136 | nfv: 137 | enabled: false 138 | descr: 'CentOS Stream $releasever - Network Functions Virtualization' 139 | metalink: "https://mirrors.centos.org/metalink?repo=centos-nfv-$stream&arch=$basearch&protocol=https,http" 140 | metadata_expire: 6h 141 | gpgcheck: true 142 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 143 | target: centos-addons.repo 144 | 145 | nfv-source: 146 | enabled: false 147 | descr: 'CentOS Stream $releasever - Network Functions Virtualization - Source' 148 | metalink: "https://mirrors.centos.org/metalink?repo=centos-nfv-source-$stream&arch=$basearch&protocol=https,http" 149 | metadata_expire: 6h 150 | gpgcheck: true 151 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 152 | target: centos-addons.repo 153 | 154 | nfv-debug: 155 | enabled: false 156 | descr: 'CentOS Stream $releasever - Network Functions Virtualization - Debug' 157 | metalink: "https://mirrors.centos.org/metalink?repo=centos-nfv-debug-$stream&arch=$basearch&protocol=https,http" 158 | metadata_expire: 6h 159 | gpgcheck: true 160 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 161 | target: centos-addons.repo 162 | 163 | rt: 164 | enabled: false 165 | descr: 'CentOS Stream $releasever - Real Time' 166 | metalink: "https://mirrors.centos.org/metalink?repo=centos-rt-$stream&arch=$basearch&protocol=https,http" 167 | metadata_expire: 6h 168 | gpgcheck: true 169 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 170 | target: centos-addons.repo 171 | 172 | rt-source: 173 | enabled: false 174 | descr: 'CentOS Stream $releasever - Real Time - Source' 175 | metalink: "https://mirrors.centos.org/metalink?repo=centos-rt-source-$stream&arch=$basearch&protocol=https,http" 176 | metadata_expire: 6h 177 | gpgcheck: true 178 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 179 | target: centos-addons.repo 180 | 181 | rt-debug: 182 | enabled: false 183 | descr: 'CentOS Stream $releasever - Real Time - Debug' 184 | metalink: "https://mirrors.centos.org/metalink?repo=centos-rt-debug-$stream&arch=$basearch&protocol=https,http" 185 | metadata_expire: 6h 186 | gpgcheck: true 187 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 188 | target: centos-addons.repo 189 | 190 | resilientstorage: 191 | enabled: false 192 | descr: 'CentOS Stream $releasever - ResilientStorage' 193 | metalink: "https://mirrors.centos.org/metalink?repo=centos-resilientstorage-$stream&arch=$basearch&protocol=https,http" 194 | metadata_expire: 6h 195 | gpgcheck: true 196 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 197 | target: centos-addons.repo 198 | 199 | resilientstorage-source: 200 | enabled: false 201 | descr: 'CentOS Stream $releasever - ResilientStorage - Source' 202 | metalink: "https://mirrors.centos.org/metalink?repo=centos-resilientstorage-source-$stream&arch=$basearch&protocol=https,http" 203 | metadata_expire: 6h 204 | gpgcheck: true 205 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 206 | target: centos-addons.repo 207 | 208 | resilientstorage-debug: 209 | enabled: false 210 | descr: 'CentOS Stream $releasever - ResilientStorage - Debug' 211 | metalink: "https://mirrors.centos.org/metalink?repo=centos-resilientstorage-debug-$stream&arch=$basearch&protocol=https,http" 212 | metadata_expire: 6h 213 | gpgcheck: true 214 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial" 215 | target: centos-addons.repo 216 | 217 | extras-common: 218 | enabled: true 219 | descr: 'CentOS Stream $releasever - Extras packages' 220 | metalink: "https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-$stream&arch=$basearch&protocol=https,http" 221 | metadata_expire: 6h 222 | gpgcheck: true 223 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512" 224 | target: centos-addons.repo 225 | 226 | extras-common-source: 227 | enabled: false 228 | descr: 'CentOS Stream $releasever - Extras packages - Source' 229 | metalink: "https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-source-$stream&arch=$basearch&protocol=https,http" 230 | metadata_expire: 6h 231 | gpgcheck: true 232 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512" 233 | target: centos-addons.repo 234 | -------------------------------------------------------------------------------- /data/os/RedHat/Fedora.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | yum::os_default_repos: 3 | - fedora 4 | - fedora-debuginfo 5 | - fedora-source 6 | - fedora-cisco-openh264 7 | - fedora-cisco-openh264-debuginfo 8 | - updates 9 | - updates-debuginfo 10 | - updates-source 11 | - updates-testing 12 | - updates-testing-debuginfo 13 | - updates-testing-source 14 | 15 | yum::repos: 16 | fedora: 17 | descr: 'Fedora $releasever - $basearch' 18 | enabled: true 19 | gpgcheck: true 20 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 21 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch' 22 | target: '/etc/yum.repos.d/fedora.repo' 23 | 24 | fedora-debuginfo: 25 | descr: 'Fedora $releasever - $basearch - Debug' 26 | enabled: false 27 | gpgcheck: true 28 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 29 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch' 30 | target: '/etc/yum.repos.d/fedora.repo' 31 | 32 | fedora-source: 33 | descr: 'Fedora $releasever - Source' 34 | enabled: false 35 | gpgcheck: true 36 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 37 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch' 38 | target: '/etc/yum.repos.d/fedora.repo' 39 | 40 | fedora-cisco-openh264: 41 | descr: 'Fedora $releasever openh264 (From Cisco) - $basearch' 42 | enabled: true 43 | gpgcheck: true 44 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 45 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-$releasever&arch=$basearch' 46 | target: '/etc/yum.repos.d/fedora-cisco-openh264.repo' 47 | 48 | fedora-cisco-openh264-debuginfo: 49 | descr: 'Fedora $releasever openh264 (From Cisco) - $basearch - Debug' 50 | enabled: false 51 | gpgcheck: true 52 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 53 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-debug-$releasever&arch=$basearch' 54 | target: '/etc/yum.repos.d/fedora-cisco-openh264.repo' 55 | 56 | updates: 57 | descr: 'Fedora $releasever - $basearch - Updates' 58 | enabled: true 59 | gpgcheck: true 60 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 61 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch' 62 | target: '/etc/yum.repos.d/fedora-updates.repo' 63 | 64 | updates-debuginfo: 65 | descr: 'Fedora $releasever - $basearch - Updates - Debug' 66 | enabled: false 67 | gpgcheck: true 68 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 69 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch' 70 | target: '/etc/yum.repos.d/fedora-updates.repo' 71 | 72 | updates-source: 73 | descr: 'Fedora $releasever - Updates Source' 74 | enabled: false 75 | gpgcheck: true 76 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 77 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch' 78 | target: '/etc/yum.repos.d/fedora-updates.repo' 79 | 80 | updates-testing: 81 | descr: 'Fedora $releasever - $basearch - Test Updates' 82 | enabled: false 83 | gpgcheck: true 84 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 85 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch' 86 | target: '/etc/yum.repos.d/fedora-updates-testing.repo' 87 | 88 | updates-testing-debuginfo: 89 | descr: 'Fedora $releasever - $basearch - Test Updates Debug' 90 | enabled: false 91 | gpgcheck: true 92 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 93 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=updates-testing-debug-f$releasever&arch=$basearch' 94 | target: '/etc/yum.repos.d/fedora-updates-testing.repo' 95 | 96 | updates-testing-source: 97 | descr: 'Fedora $releasever - Test Updates Source' 98 | enabled: false 99 | gpgcheck: true 100 | gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch' 101 | metalink: 'https://mirrors.fedoraproject.org/metalink?repo=updates-testing-source-f$releasever&arch=$basearch' 102 | target: '/etc/yum.repos.d/fedora-updates-testing.repo' 103 | 104 | yum::utils_package_name: "dnf-utils" 105 | -------------------------------------------------------------------------------- /data/os/RedHat/RedHat.yaml: -------------------------------------------------------------------------------- 1 | # Red Hat Enterprise Linux default repos for AWS. 2 | --- 3 | yum::os_default_repos: 4 | - "rhui-REGION-rhel-server-releases" 5 | - "rhui-REGION-rhel-server-releases-debug" 6 | - "rhui-REGION-rhel-server-releases-source" 7 | - "rhui-REGION-rhel-server-rhscl" 8 | - "rhui-REGION-rhel-server-debug-rhscl" 9 | - "rhui-REGION-rhel-server-source-rhscl" 10 | - "rhui-REGION-rhel-server-extras" 11 | - "rhui-REGION-rhel-server-debug-extras" 12 | - "rhui-REGION-rhel-server-source-extras" 13 | - "rhui-REGION-rhel-server-optional" 14 | - "rhui-REGION-rhel-server-debug-optional" 15 | - "rhui-REGION-rhel-server-source-optional" 16 | - "rhui-REGION-rhel-server-rh-common" 17 | - "rhui-REGION-rhel-server-debug-rh-common" 18 | - "rhui-REGION-rhel-server-source-rh-common" 19 | - "rhui-REGION-rhel-server-supplementary" 20 | - "rhui-REGION-rhel-server-debug-supplementary" 21 | - "rhui-REGION-rhel-server-source-supplementary" 22 | yum::repos: 23 | rhui-REGION-rhel-server-releases: 24 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} (RPMs)" 25 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/os" 26 | enabled: true 27 | gpgcheck: true 28 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 29 | sslverify: true 30 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 31 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 32 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 33 | target: "/etc/yum.repos.d/redhat-rhui.repo" 34 | rhui-REGION-rhel-server-releases-debug: 35 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Debug (Debug RPMs)" 36 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/debug" 37 | enabled: false 38 | gpgcheck: true 39 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 40 | sslverify: true 41 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 42 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 43 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 44 | target: "/etc/yum.repos.d/redhat-rhui.repo" 45 | rhui-REGION-rhel-server-releases-source: 46 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} (SRPMs)" 47 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/source/SRPMS" 48 | enabled: false 49 | gpgcheck: true 50 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 51 | sslverify: true 52 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 53 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 54 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 55 | rhui-REGION-rhel-server-rhscl: 56 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} RHSCL (RPMs)" 57 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/rhscl/1/os" 58 | enabled: false 59 | gpgcheck: true 60 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 61 | sslverify: true 62 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 63 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 64 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 65 | target: "/etc/yum.repos.d/redhat-rhui.repo" 66 | rhui-REGION-rhel-server-debug-rhscl: 67 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} RHSCL Debug (Debug RPMs)" 68 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/rhscl/1/debug" 69 | enabled: false 70 | gpgcheck: true 71 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 72 | sslverify: true 73 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 74 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 75 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 76 | target: "/etc/yum.repos.d/redhat-rhui.repo" 77 | rhui-REGION-rhel-server-source-rhscl: 78 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} RHSCL (SRPMs)" 79 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/rhscl/1/source/SRPMS" 80 | enabled: false 81 | gpgcheck: true 82 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 83 | sslverify: true 84 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 85 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 86 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 87 | target: "/etc/yum.repos.d/redhat-rhui.repo" 88 | rhui-REGION-rhel-server-extras: 89 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Extra(RPMs)" 90 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/extras/os" 91 | enabled: false 92 | gpgcheck: true 93 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 94 | sslverify: true 95 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 96 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 97 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 98 | target: "/etc/yum.repos.d/redhat-rhui.repo" 99 | rhui-REGION-rhel-server-debug-extras: 100 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Extra Debug (Debug RPMs)" 101 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/extras/debug" 102 | enabled: false 103 | gpgcheck: true 104 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 105 | sslverify: true 106 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 107 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 108 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 109 | target: "/etc/yum.repos.d/redhat-rhui.repo" 110 | rhui-REGION-rhel-server-source-extras: 111 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Extra (SRPMs)" 112 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/extras/source/SRPMS" 113 | enabled: false 114 | gpgcheck: true 115 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 116 | sslverify: true 117 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 118 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 119 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 120 | target: "/etc/yum.repos.d/redhat-rhui.repo" 121 | rhui-REGION-rhel-server-optional: 122 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Optional (RPMs)" 123 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/optional/os" 124 | enabled: false 125 | gpgcheck: true 126 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 127 | sslverify: true 128 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 129 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 130 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 131 | target: "/etc/yum.repos.d/redhat-rhui.repo" 132 | rhui-REGION-rhel-server-debug-optional: 133 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Optional Debug (Debug RPMs)" 134 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/optional/debug" 135 | enabled: false 136 | gpgcheck: true 137 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 138 | sslverify: true 139 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 140 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 141 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 142 | target: "/etc/yum.repos.d/redhat-rhui.repo" 143 | rhui-REGION-rhel-server-source-optional: 144 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Optional (SRPMs)" 145 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/optional/source/SRPMS" 146 | enabled: false 147 | gpgcheck: true 148 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 149 | sslverify: true 150 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 151 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 152 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 153 | target: "/etc/yum.repos.d/redhat-rhui.repo" 154 | rhui-REGION-rhel-server-rh-common: 155 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} RH Common (RPMs)" 156 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/rh-common/os" 157 | enabled: true 158 | gpgcheck: true 159 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 160 | sslverify: true 161 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 162 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 163 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 164 | target: "/etc/yum.repos.d/redhat-rhui.repo" 165 | rhui-REGION-rhel-server-debug-rh-common: 166 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} RH Common Debug (Debug RPMs)" 167 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/rh-common/debug" 168 | enabled: false 169 | gpgcheck: true 170 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 171 | sslverify: true 172 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 173 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 174 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 175 | target: "/etc/yum.repos.d/redhat-rhui.repo" 176 | rhui-REGION-rhel-server-source-rh-common: 177 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} RH Common (SRPMs)" 178 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/rh-common/source/SRPMS" 179 | enabled: false 180 | gpgcheck: true 181 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 182 | sslverify: true 183 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 184 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 185 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 186 | target: "/etc/yum.repos.d/redhat-rhui.repo" 187 | rhui-REGION-rhel-server-supplementary: 188 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Supplementary (RPMs)" 189 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/supplementary/os" 190 | enabled: false 191 | gpgcheck: true 192 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 193 | sslverify: true 194 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 195 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 196 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 197 | target: "/etc/yum.repos.d/redhat-rhui.repo" 198 | rhui-REGION-rhel-server-debug-supplementary: 199 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Supplementary Debug (Debug RPMs)" 200 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/supplementary/debug" 201 | enabled: false 202 | gpgcheck: true 203 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 204 | sslverify: true 205 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 206 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 207 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 208 | target: "/etc/yum.repos.d/redhat-rhui.repo" 209 | rhui-REGION-rhel-server-source-supplementary: 210 | descr: "Red Hat Enterprise Linux Server %{facts.os.release.major} Supplementary (SRPMs)" 211 | mirrorlist: "https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/%{facts.os.release.major}/$releasever/$basearch/supplementary/source/SRPMS" 212 | enabled: false 213 | gpgcheck: true 214 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release " 215 | sslverify: true 216 | sslclientkey: "/etc/pki/rhui/content-rhel%{facts.os.release.major}.key" 217 | sslclientcert: "/etc/pki/rhui/product/content-rhel%{facts.os.release.major}.crt" 218 | sslcacert: "/etc/pki/rhui/cdn.redhat.com-chain.crt" 219 | target: "/etc/yum.repos.d/redhat-rhui.repo" 220 | -------------------------------------------------------------------------------- /data/os/RedHat/Rocky.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | yum::os_default_repos: 3 | - 'appstream' 4 | - 'appstream-source' 5 | - 'baseos' 6 | - 'baseos-source' 7 | - 'devel' 8 | - 'extras' 9 | - 'ha' 10 | - 'ha-source' 11 | - 'nfv' 12 | - 'plus' 13 | - 'powertools' 14 | - 'powertools-source' 15 | - 'resilient-storage' 16 | - 'resilient-storage-source' 17 | - 'rt' 18 | yum::repos: 19 | baseos: 20 | enabled: true 21 | descr: 'Rocky Linux $releasever - BaseOS' 22 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever' 23 | gpgcheck: true 24 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 25 | target: '/etc/yum.repos.d/Rocky-BaseOS.repo' 26 | 27 | appstream: 28 | enabled: true 29 | descr: 'Rocky Linux $releasever - AppStream' 30 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever' 31 | gpgcheck: true 32 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 33 | target: '/etc/yum.repos.d/Rocky-AppStream.repo' 34 | 35 | extras: 36 | enabled: true 37 | descr: 'Rocky Linux $releasever - Extras' 38 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever' 39 | gpgcheck: true 40 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 41 | target: '/etc/yum.repos.d/Rocky-extras.repo' 42 | 43 | baseos-source: 44 | enabled: false 45 | descr: 'Rocky Linux $releasever - BaseOS - Source' 46 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=BaseOS-$releasever-source' 47 | gpgcheck: true 48 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 49 | target: '/etc/yum.repos.d/Rocky-Sources.repo' 50 | 51 | appstream-source: 52 | enabled: false 53 | descr: 'Rocky Linux $releasever - AppStream - Source' 54 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=AppStream-$releasever-source' 55 | gpgcheck: true 56 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 57 | target: '/etc/yum.repos.d/Rocky-Sources.repo' 58 | 59 | plus: 60 | enabled: false 61 | descr: 'Rocky Linux $releasever - Plus' 62 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=rockyplus-$releasever' 63 | gpgcheck: true 64 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 65 | target: '/etc/yum.repos.d/Rocky-Plus.repo' 66 | 67 | devel: 68 | enabled: false 69 | descr: 'Rocky Linux $releasever - Devel WARNING! FOR BUILDROOT AND KOJI USE' 70 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=Devel-$releasever' 71 | gpgcheck: true 72 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 73 | target: '/etc/yum.repos.d/Rocky-Devel.repo' 74 | 75 | ha: 76 | enabled: false 77 | descr: 'Rocky Linux $releasever - HighAvailability' 78 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-$releasever' 79 | gpgcheck: true 80 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 81 | target: '/etc/yum.repos.d/Rocky-HighAvailability.repo' 82 | 83 | ha-source: 84 | enabled: false 85 | descr: 'Rocky Linux $releasever - High Availability - Source' 86 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=HighAvailability-$releasever-source' 87 | gpgcheck: true 88 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 89 | target: '/etc/yum.repos.d/Rocky-Sources.repo' 90 | 91 | nfv: 92 | enabled: false 93 | descr: 'Rocky Linux $releasever - NFV' 94 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=NFV-$releasever' 95 | gpgcheck: true 96 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 97 | target: '/etc/yum.repos.d/Rocky-NFV.repo' 98 | 99 | powertools: 100 | enabled: false 101 | descr: 'Rocky Linux $releasever - PowerTools' 102 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=PowerTools-$releasever' 103 | gpgcheck: true 104 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 105 | target: '/etc/yum.repos.d/Rocky-PowerTools.repo' 106 | 107 | powertools-source: 108 | enabled: false 109 | descr: 'Rocky Linux $releasever - PowerTools - Source' 110 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=PowerTools-$releasever-source' 111 | gpgcheck: true 112 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 113 | target: '/etc/yum.repos.d/Rocky-Sources.repo' 114 | 115 | resilient-storage: 116 | enabled: false 117 | descr: 'Rocky Linux $releasever - ResilientStorage' 118 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-$releasever' 119 | gpgcheck: true 120 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 121 | target: '/etc/yum.repos.d/Rocky-ResilientStorage.repo' 122 | 123 | resilient-storage-source: 124 | enabled: false 125 | descr: 'Rocky Linux $releasever - Resilient Storage - Source' 126 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=ResilientStorage-$releasever-source' 127 | gpgcheck: true 128 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 129 | target: '/etc/yum.repos.d/Rocky-Sources.repo' 130 | 131 | rt: 132 | enabled: false 133 | descr: 'Rocky Linux $releasever - Realtime' 134 | mirrorlist: 'https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever' 135 | gpgcheck: true 136 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial" 137 | target: '/etc/yum.repos.d/Rocky-RT.repo' 138 | -------------------------------------------------------------------------------- /data/package_provider/dnf.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | yum::plugin::versionlock::path: /etc/dnf/plugins/versionlock.list 3 | yum::settings::mainconf: /etc/dnf/dnf.conf 4 | -------------------------------------------------------------------------------- /data/repos/RedHat/8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # This file contains miscellaneous, non-distro repositories. 3 | yum::repos: 4 | # EPEL 5 | epel-modular: 6 | descr: "Extra Packages for Enterprise Linux Modular $releasever - $basearch" 7 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-modular-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 8 | mirrorlist: absent 9 | enabled: true 10 | gpgcheck: true 11 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 12 | target: '/etc/yum.repos.d/epel-modular.repo' 13 | 14 | epel-modular-debuginfo: 15 | descr: "Extra Packages for Enterprise Linux Modular $releasever - $basearch - Debug" 16 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-modular-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 17 | mirrorlist: absent 18 | enabled: false 19 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 20 | gpgcheck: true 21 | target: '/etc/yum.repos.d/epel-modular.repo' 22 | 23 | epel-modular-source: 24 | descr: "Extra Packages for Enterprise Linux Modular $releasever - $basearch - Source" 25 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-modular-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 26 | mirrorlist: absent 27 | enabled: false 28 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 29 | gpgcheck: true 30 | target: '/etc/yum.repos.d/epel-modular.repo' 31 | 32 | epel-testing-modular: 33 | descr: "Extra Packages for Enterprise Linux Modular $releasever - Testing - $basearch" 34 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=testing-modular-epel$releasever&arch=$basearch&infra=$infra&content=$contentdir" 35 | mirrorlist: absent 36 | enabled: false 37 | gpgcheck: true 38 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 39 | target: '/etc/yum.repos.d/epel-testing-modular.repo' 40 | 41 | epel-testing-modular-debuginfo: 42 | descr: "Extra Packages for Enterprise Linux Modular $releasever - Testing -$basearch - Debug" 43 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=testing-modular-debug-epel$releasever&arch=$basearch&infra=$infra&content=$contentdir" 44 | mirrorlist: absent 45 | enabled: false 46 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 47 | gpgcheck: true 48 | target: '/etc/yum.repos.d/epel-testing-modular.repo' 49 | 50 | epel-testing-modular-source: 51 | descr: "Extra Packages for Enterprise Linux Modular $releasever - Testing -$basearch - Source" 52 | mirrorlist: absent 53 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=testing-modular-source-epel$releasever&arch=$basearch&infra=$infra&content=$contentdir" 54 | enabled: false 55 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 56 | gpgcheck: true 57 | target: '/etc/yum.repos.d/epel-testing-modular.repo' 58 | -------------------------------------------------------------------------------- /data/repos/RedHat/9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # This file contains miscellaneous, non-distro repositories. 3 | yum::repos: 4 | # EPEL 5 | epel-next: 6 | descr: "Extra Packages for Enterprise Linux $releasever - Next - $basearch" 7 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-next-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 8 | mirrorlist: absent 9 | enabled: false 10 | gpgcheck: true 11 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 12 | target: '/etc/yum.repos.d/epel-next.repo' 13 | 14 | epel-next-debuginfo: 15 | descr: "Extra Packages for Enterprise Linux $releasever - Next - $basearch - Debug" 16 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-next-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 17 | mirrorlist: absent 18 | enabled: false 19 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 20 | gpgcheck: true 21 | target: '/etc/yum.repos.d/epel-next.repo' 22 | 23 | epel-next-source: 24 | descr: "Extra Packages for Enterprise Linux $releasever - Next - $basearch - Source" 25 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-next-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 26 | mirrorlist: absent 27 | enabled: false 28 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 29 | gpgcheck: true 30 | target: '/etc/yum.repos.d/epel-next.repo' 31 | -------------------------------------------------------------------------------- /data/repos/repos.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # This file contains miscellaneous, non-distro repositories. 3 | yum::repos: 4 | # EPEL 5 | epel: 6 | descr: "Extra Packages for Enterprise Linux %{facts.os.release.major} - $basearch" 7 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 8 | enabled: true 9 | gpgcheck: true 10 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 11 | target: '/etc/yum.repos.d/epel.repo' 12 | 13 | epel-debuginfo: 14 | descr: "Extra Packages for Enterprise Linux %{facts.os.release.major} - $basearch - Debug" 15 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 16 | enabled: false 17 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 18 | gpgcheck: true 19 | target: '/etc/yum.repos.d/epel.repo' 20 | 21 | epel-source: 22 | descr: "Extra Packages for Enterprise Linux %{facts.os.release.major} - $basearch - Source" 23 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir" 24 | enabled: false 25 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 26 | gpgcheck: true 27 | target: '/etc/yum.repos.d/epel.repo' 28 | 29 | epel-testing: 30 | descr: "Extra Packages for Enterprise Linux %{facts.os.release.major} - Testing - $basearch" 31 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=testing-epel$releasever&arch=$basearch&infra=$infra&content=$contentdir" 32 | enabled: false 33 | gpgcheck: true 34 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 35 | target: '/etc/yum.repos.d/epel-testing.repo' 36 | 37 | epel-testing-debuginfo: 38 | descr: "Extra Packages for Enterprise Linux %{facts.os.release.major} - Testing - $basearch - Debug" 39 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel$releasever&arch=$basearch&infra=$infra&content=$contentdir" 40 | enabled: false 41 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 42 | gpgcheck: true 43 | target: '/etc/yum.repos.d/epel-testing.repo' 44 | 45 | epel-testing-source: 46 | descr: "Extra Packages for Enterprise Linux %{facts.os.release.major} - Testing - $basearch - Source" 47 | metalink: "https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel$releasever&arch=$basearch&infra=$infra&content=$contentdir" 48 | enabled: false 49 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major}" 50 | gpgcheck: true 51 | target: '/etc/yum.repos.d/epel-testing.repo' 52 | 53 | # RPMFusion 54 | rpmfusion-free-updates: 55 | descr: "RPM Fusion for EL %{facts.os.release.major} - Free - Updates" 56 | metalink: "http://mirrors.rpmfusion.org/metalink?repo=free-el-updates-released-%{facts.os.release.major}&arch=$basearch" 57 | enabled: true 58 | gpgcheck: true 59 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-%{facts.os.release.major}" 60 | target: '/etc/yum.repos.d/rpmfusion-free-updates.repo' 61 | rpmfusion-free-updates-debuginfo: 62 | descr: "RPM Fusion for EL %{facts.os.release.major} - Free - Updates Debug" 63 | metalink: "http://mirrors.rpmfusion.org/metalink?repo=free-el-updates-released-debug-%{facts.os.release.major}&arch=$basearch" 64 | enabled: true 65 | gpgcheck: true 66 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-%{facts.os.release.major}" 67 | target: '/etc/yum.repos.d/rpmfusion-free-updates.repo' 68 | rpmfusion-free-updates-source: 69 | descr: "RPM Fusion for EL %{facts.os.release.major} - Free - Updates Source" 70 | metalink: "http://mirrors.rpmfusion.org/metalink?repo=free-el-updates-released-source-%{facts.os.release.major}&arch=$basearch" 71 | enabled: true 72 | gpgcheck: true 73 | gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-%{facts.os.release.major}" 74 | target: '/etc/yum.repos.d/rpmfusion-free-updates.repo' 75 | -------------------------------------------------------------------------------- /examples/gpgkey.pp: -------------------------------------------------------------------------------- 1 | yum::gpgkey { '/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-smoketest1': 2 | ensure => absent, 3 | content => '-----BEGIN PGP PUBLIC KEY BLOCK-----...', 4 | } 5 | -------------------------------------------------------------------------------- /examples/group.pp: -------------------------------------------------------------------------------- 1 | yum::group { 'X Window System': 2 | ensure => present, 3 | } 4 | -------------------------------------------------------------------------------- /examples/install.pp: -------------------------------------------------------------------------------- 1 | if ($facts['os']['release']['major'] in [5,6,7]) { 2 | # https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 3 | # https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm 4 | # https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm 5 | $source = "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${facts['os']['release']['major']}.noarch.rpm" 6 | 7 | yum::install { 'epel-release': 8 | ensure => present, 9 | source => $source, 10 | } 11 | } else { 12 | err("Unsupported OS release ${facts['os']['release']['major']}") 13 | } 14 | -------------------------------------------------------------------------------- /examples/plugin.pp: -------------------------------------------------------------------------------- 1 | yum::plugin { 'versionlock': 2 | ensure => present, 3 | } 4 | -------------------------------------------------------------------------------- /examples/versionlock.pp: -------------------------------------------------------------------------------- 1 | yum::versionlock { '0:bash-4.1.2-9.el6_2.*': 2 | ensure => present, 3 | } 4 | -------------------------------------------------------------------------------- /functions/bool2num_hash_recursive.pp: -------------------------------------------------------------------------------- 1 | # This functions converts the Boolean values of a Hash to Integers, 2 | # either '0' or '1'. It does this recursively, decending as far as the 3 | # language implemenation will allow. Note that Structs and Arrays will 4 | # be ignored, even if they contain Hashes. 5 | # 6 | # @private 7 | # 8 | # @param arg [Hash] The hash on which to operate 9 | # @return [Hash] 10 | # 11 | # @example Usage 12 | # 13 | # Hash $foo = { 14 | # bar => { 'a' => true, 'b' => 'b' }, 15 | # baz => false, 16 | # qux => [{ 'c' => true }, { 'd' => false }], 17 | # } 18 | # 19 | # yum::bool2num_hash_recursive($foo) 20 | # 21 | # The above would return: 22 | # 23 | # { 24 | # bar => { 'a' => 1, 'b' => 'b' }, 25 | # baz => 0, 26 | # qux => [{ 'c' => true }, { 'd' => false }], 27 | # } 28 | # 29 | function yum::bool2num_hash_recursive($arg) { 30 | assert_type(Hash, $arg) 31 | $arg.map |$key, $value| { 32 | $return_value = $value ? { 33 | Boolean => bool2num($value), 34 | Hash => yum::bool2num_hash_recursive($value), 35 | default => $value, 36 | } 37 | # see the issue for the strange/asymetrical whitespace 38 | # https://github.com/kuleuven/puppet-lint-manifest_whitespace-check/issues/8 39 | Hash({ $key => $return_value }) 40 | }.reduce |$attrs_memo, $kv| { 41 | $attrs_memo + $kv 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /hiera.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 5 3 | 4 | defaults: 5 | datadir: data 6 | data_hash: yaml_data 7 | 8 | hierarchy: 9 | - name: 'OS Data' 10 | paths: 11 | - 'os/%{facts.os.family}/%{facts.os.name}/%{facts.os.release.full}.yaml' 12 | - 'os/%{facts.os.family}/%{facts.os.name}/%{facts.os.release.major}/%{facts.os.release.minor}.yaml' 13 | - 'os/%{facts.os.family}/%{facts.os.name}/%{facts.os.release.major}.yaml' 14 | - 'os/%{facts.os.family}/%{facts.os.name}.yaml' 15 | - 'os/%{facts.os.family}.yaml' 16 | 17 | - name: 'Non-OS Yumrepos' 18 | paths: 19 | - 'repos/%{facts.os.family}/%{facts.os.release.major}.yaml' 20 | - 'repos/repos.yaml' 21 | 22 | - name: 'Yum vs DNF settings' 23 | path: 'package_provider/%{facts.package_provider}.yaml' 24 | 25 | - name: 'Common Data' 26 | path: 'common.yaml' 27 | -------------------------------------------------------------------------------- /lib/facter/yum_reboot_required.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'English' 4 | 5 | Facter.add(:yum_reboot_required) do 6 | confine 'os.family': 'RedHat' 7 | setcode do 8 | if File.exist?('/usr/bin/needs-restarting') 9 | Facter::Core::Execution.execute('/usr/bin/needs-restarting --reboothint') 10 | !$CHILD_STATUS.success? 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/facter/yum_updates.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Facter.add('yum_package_updates') do 4 | confine 'os.family': 'RedHat' 5 | setcode do 6 | yum_updates = [] 7 | 8 | if File.executable?('/usr/bin/yum') 9 | yum_get_result = Facter::Util::Resolution.exec('/usr/bin/yum --assumeyes --quiet --cacheonly list updates') 10 | yum_get_result&.each_line do |line| 11 | %r{\A(?\S+\.\S+)\s+(?[[:digit:]]\S+)\s+(?\S+)\s*\z} =~ line 12 | yum_updates.push(package) if package && available_version && repository 13 | end 14 | end 15 | 16 | yum_updates 17 | end 18 | end 19 | 20 | Facter.add('yum_has_updates') do 21 | confine 'os.family': 'RedHat' 22 | setcode do 23 | Facter.value(:yum_package_updates).any? 24 | end 25 | end 26 | 27 | Facter.add('yum_updates') do 28 | confine 'os.family': 'RedHat' 29 | setcode do 30 | Facter.value(:yum_package_updates).length 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/puppet/provider/dnf_module_stream/dnf_module_stream.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Puppet::Type.type(:dnf_module_stream).provide(:dnf_module_stream) do 4 | desc 'Unique provider' 5 | 6 | confine package_provider: 'dnf' 7 | 8 | commands dnf: 'dnf' 9 | 10 | # Converts plain output from 'dnf module list ' to an array formatted as: 11 | # { 12 | # default_stream: " (if there's one)", 13 | # enabled_stream: " (if there's one)", 14 | # available_streams: ["", "", ...,] 15 | # } 16 | def dnf_output_2_hash(dnf_output) 17 | module_hash = { available_streams: [] } 18 | dnf_output.lines.each do |line| 19 | line.chomp! 20 | break if line.empty? 21 | 22 | # @stream_start and @stream_length: chunk of dnf output line with stream info 23 | # Determined in elsif block below from dnf output header 24 | if !@stream_start.nil? 25 | # Stream string is '', ' [d][e]', or the like 26 | stream_string = line[@stream_start, @stream_length].rstrip 27 | stream = stream_string.split[0] 28 | module_hash[:default_stream] = stream if stream_string.include?('[d]') 29 | module_hash[:enabled_stream] = stream if stream_string.include?('[e]') 30 | module_hash[:available_streams] << stream 31 | elsif line.split[0] == 'Name' 32 | # 'dnf module list' output header is 'NameStreamProfiles...' 33 | # Each field has same position of data that follows 34 | @stream_start = line[%r{Name\s+}].length 35 | @stream_length = line[%r{Stream\s+}].length 36 | end 37 | end 38 | module_hash 39 | end 40 | 41 | # Gets module default, enabled and available streams 42 | # Output formatted by function dnf_output_2_hash 43 | def streams_state(module_name) 44 | # This function can be called multiple times in the same resource call 45 | return unless @streams_current_state.nil? 46 | 47 | dnf_output = dnf('-q', 'module', 'list', module_name) 48 | rescue Puppet::ExecutionFailure 49 | # Assumes any execution error happens because module doesn't exist 50 | raise ArgumentError, "Module \"#{module_name}\" not found" 51 | else 52 | @streams_current_state = dnf_output_2_hash(dnf_output) 53 | end 54 | 55 | def disable_stream(module_name) 56 | dnf('-y', 'module', 'reset', module_name) 57 | end 58 | 59 | def enable_stream(module_name, target_stream) 60 | action = @streams_current_state.key?(:enabled_stream) ? 'switch-to' : 'enable' 61 | dnf('-y', 'module', action, "#{module_name}:#{target_stream}") 62 | end 63 | 64 | def stream 65 | streams_state(resource[:module]) 66 | case resource[:stream] 67 | when :absent 68 | # Act if any stream is enabled 69 | @streams_current_state.key?(:enabled_stream) ? @streams_current_state[:enabled_stream] : :absent 70 | when :default 71 | # Act if default stream isn't enabled 72 | # Specified stream = :default requires an existing default stream 73 | raise ArgumentError, "No default stream to enable in module \"#{resource[:module]}\"" unless 74 | @streams_current_state.key?(:default_stream) 75 | 76 | @streams_current_state[:enabled_stream] == @streams_current_state[:default_stream] ? :default : @streams_current_state[:enabled_stream] 77 | when :present 78 | # Act if no stream is enabled 79 | # Specified stream = :default requires an existing default or enabled stream 80 | raise ArgumentError, "No default stream to enable in module \"#{resource[:module]}\"" unless 81 | @streams_current_state.key?(:default_stream) || @streams_current_state.key?(:enabled_stream) 82 | 83 | @streams_current_state.key?(:enabled_stream) ? :present : :absent 84 | else 85 | # Act if specified stream isn't enabled 86 | @streams_current_state[:enabled_stream] 87 | end 88 | end 89 | 90 | def stream=(target_stream) 91 | case target_stream 92 | when :absent 93 | disable_stream(resource[:module]) 94 | when :default, :present 95 | enable_stream(resource[:module], @streams_current_state[:default_stream]) 96 | else 97 | enable_stream(resource[:module], target_stream) 98 | end 99 | end 100 | end 101 | -------------------------------------------------------------------------------- /lib/puppet/type/dnf_module_stream.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Puppet::Type.newtype(:dnf_module_stream) do 4 | @doc = <<-TYPE_DOC 5 | @summary Manage DNF module streams 6 | @example Enable MariaDB default stream 7 | dnf_module_stream { 'mariadb': 8 | stream => default, 9 | } 10 | @example Enable MariaDB 10.5 stream 11 | dnf_module_stream { 'mariadb': 12 | stream => '10.5', 13 | } 14 | @example Disable MariaDB streams 15 | dnf_module_stream { 'mariadb': 16 | stream => absent, 17 | } 18 | @param module 19 | Module to be managed - Defaults to title 20 | @param stream 21 | Module stream to be enabled 22 | 23 | This type allows Puppet to enable/disable streams via DNF modules 24 | TYPE_DOC 25 | 26 | newparam(:title, namevar: true) do 27 | desc 'Resource title' 28 | newvalues(%r{.+}) 29 | end 30 | 31 | newparam(:module) do 32 | desc 'DNF module to be managed' 33 | newvalues(%r{.+}) 34 | end 35 | 36 | newproperty(:stream) do 37 | desc <<-EOS 38 | Module stream that should be enabled 39 | String - Specify stream 40 | present - Keep current enabled stream if any, otherwise enable default one 41 | default - Enable default stream 42 | absent - No stream (resets module) 43 | EOS 44 | newvalues(:present, :default, :absent, %r{.+}) 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /manifests/clean.pp: -------------------------------------------------------------------------------- 1 | # A $(yum clean all) Exec to be notified if desired. 2 | class yum::clean { 3 | exec { 'yum_clean_all': 4 | command => '/usr/bin/yum clean all', 5 | refreshonly => true, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /manifests/config.pp: -------------------------------------------------------------------------------- 1 | # 2 | # @summary This definition manages yum.conf 3 | # 4 | # @param ensure specifies value or absent keyword 5 | # @param key alternative conf. key (defaults to name) 6 | # 7 | # @example configure installonly limit 8 | # yum::config { 'installonly_limit': 9 | # ensure => 2, 10 | # } 11 | # 12 | # @example remove a configuration 13 | # yum::config { 'debuglevel': 14 | # ensure => absent, 15 | # } 16 | # 17 | define yum::config ( 18 | Variant[Boolean, Integer, Enum['absent'], String, Sensitive[String]] $ensure, 19 | String $key = $title, 20 | ) { 21 | include yum::settings 22 | $_mainconf = $yum::settings::mainconf 23 | 24 | $_ensure = $ensure ? { 25 | Boolean => bool2num($ensure), 26 | Sensitive => $ensure.unwrap, 27 | default => $ensure, 28 | } 29 | 30 | $_changes = $ensure ? { 31 | 'absent' => "rm ${key}", 32 | default => "set ${key} '${_ensure}'", 33 | } 34 | 35 | $_show_diff = $ensure ? { 36 | Sensitive => false, 37 | default => true, 38 | } 39 | 40 | augeas { "${facts['package_provider']}.conf_${key}": 41 | incl => $_mainconf, 42 | lens => 'Yum.lns', 43 | context => "/files${_mainconf}/main/", 44 | changes => $_changes, 45 | show_diff => $_show_diff, 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /manifests/copr.pp: -------------------------------------------------------------------------------- 1 | # 2 | # @summary This definition manages Copr (Cool Other Package Repo) repositories. 3 | # 4 | # @param copr_repo 5 | # Name of repository, defaults to title. 6 | # @param manage_prereq_plugin 7 | # Wheter required plugin for dnf/yum should be installed by this resource. 8 | # @param ensure 9 | # Specifies if repo should be enabled, disabled or removed. 10 | # 11 | # @example add and enable COPR restic repository 12 | # yum::copr { 'copart/restic': 13 | # ensure => 'enabled', 14 | # } 15 | # 16 | define yum::copr ( 17 | String $copr_repo = $title, 18 | Boolean $manage_prereq_plugin = true, 19 | Enum['enabled', 'disabled', 'removed'] $ensure = 'enabled', 20 | ) { 21 | $prereq_plugin = $facts['package_provider'] ? { 22 | 'dnf' => 'dnf-plugins-core', 23 | default => 'yum-plugin-copr', 24 | } 25 | if $manage_prereq_plugin { 26 | stdlib::ensure_packages([$prereq_plugin]) 27 | } 28 | 29 | if $facts['package_provider'] == 'dnf' { 30 | $copr_name = regsubst($copr_repo, '@', 'group_') 31 | case $ensure { 32 | 'enabled': { 33 | exec { "dnf -y copr enable ${copr_repo}": 34 | path => '/bin:/usr/bin:/sbin/:/usr/sbin', 35 | unless => "dnf copr list | egrep -q '${copr_name}\$'", 36 | require => Package[$prereq_plugin], 37 | } 38 | } 39 | 'disabled': { 40 | exec { "dnf -y copr disable ${copr_repo}": 41 | path => '/bin:/usr/bin:/sbin/:/usr/sbin', 42 | unless => "dnf copr list | egrep -q '${copr_name} \\(disabled\\)\$'", 43 | require => Package[$prereq_plugin], 44 | } 45 | } 46 | 'removed': { 47 | exec { "dnf -y copr remove ${copr_repo}": 48 | path => '/bin:/usr/bin:/sbin/:/usr/sbin', 49 | onlyif => "dnf copr list | egrep -q '${copr_name}'", 50 | require => Package[$prereq_plugin], 51 | } 52 | } 53 | default: { 54 | fail("The value for ensure for `yum::copr` must be enabled, disabled or removed, but it is ${ensure}.") 55 | } 56 | } 57 | } else { 58 | $copr_repo_name_part = regsubst($copr_repo, '/', '-', 'G') 59 | case $ensure { 60 | 'enabled': { 61 | exec { "yum -y copr enable ${copr_repo}": 62 | path => '/bin:/usr/bin:/sbin/:/usr/sbin', 63 | onlyif => "test ! -e /etc/yum.repos.d/_copr_${copr_repo_name_part}.repo", 64 | require => Package[$prereq_plugin], 65 | } 66 | } 67 | 'disabled', 'removed': { 68 | exec { "yum -y copr disable ${copr_repo}": 69 | path => '/bin:/usr/bin:/sbin/:/usr/sbin', 70 | onlyif => "test -e /etc/yum.repos.d/_copr_${copr_repo_name_part}.repo", 71 | require => Package[$prereq_plugin], 72 | } 73 | } 74 | default: { 75 | fail("The value for ensure for `yum::copr` must be enabled, disabled or removed, but it is ${ensure}.") 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /manifests/gpgkey.pp: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # @summary imports/deleted public GPG key for RPM. Key can be stored on Puppet's fileserver or as inline content. 4 | # 5 | # @param path alternative file location (defaults to name) 6 | # @param ensure specifies if key should be present or absent 7 | # @param content the actual file content 8 | # @param source source (e.g.: puppet:///) 9 | # @param owner file owner 10 | # @param group file group 11 | # @param mode file mode 12 | # 13 | # @example Sample usage: 14 | # yum::gpgkey { '/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-smoketest1': 15 | # ensure => 'present', 16 | # content => '-----BEGIN PGP PUBLIC KEY BLOCK----- 17 | # ... 18 | # -----END PGP PUBLIC KEY BLOCK-----'; 19 | # } 20 | # 21 | define yum::gpgkey ( 22 | String $path = $name, 23 | Enum['present', 'absent'] $ensure = 'present', 24 | Optional[String] $content = undef, 25 | Optional[String] $source = undef, 26 | String $owner = 'root', 27 | String $group = 'root', 28 | String $mode = '0644' 29 | ) { 30 | $_creators = [$content, $source] 31 | $_used_creators = $_creators.filter |$value| { !empty($value) } 32 | 33 | unless size($_used_creators) != 1 { 34 | File[$path] { 35 | content => $content, 36 | source => $source, 37 | } 38 | } else { 39 | case size($_used_creators) { 40 | 0: { fail('Missing params: $content or $source must be specified') } 41 | default: { fail('You cannot specify more than one of content, source') } 42 | } 43 | } 44 | 45 | file { $path: 46 | ensure => $ensure, 47 | owner => $owner, 48 | group => $group, 49 | mode => $mode, 50 | } 51 | 52 | $rpmname = "gpg-pubkey-$(gpg --with-colons ${path} | \ 53 | head -n 1 | \ 54 | cut -d: -f5 | \ 55 | cut -c9-16 | \ 56 | tr '[A-Z]' '[a-z]')" 57 | 58 | case $ensure { 59 | 'present', default: { 60 | exec { "rpm-import-${name}": 61 | path => '/bin:/usr/bin:/sbin/:/usr/sbin', 62 | command => "rpm --import ${path}", 63 | unless => "rpm -q ${rpmname}", 64 | require => File[$path], 65 | } 66 | } 67 | 68 | 'absent': { 69 | exec { "rpm-delete-${name}": 70 | path => '/bin:/usr/bin:/sbin/:/usr/sbin', 71 | command => "rpm -e ${rpmname}", 72 | onlyif => ["test -f ${path}", "rpm -q ${rpmname}"], 73 | before => File[$path], 74 | } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /manifests/group.pp: -------------------------------------------------------------------------------- 1 | # 2 | # @summary This definition installs or removes yum package group. 3 | # 4 | # @param ensure specifies if package group should be present (installed) or absent (purged) 5 | # @param timeout exec timeout for yum group install command 6 | # @param install_options options provided to yum group install command 7 | # 8 | # @example Sample usage: 9 | # yum::group { 'X Window System': 10 | # ensure => 'present', 11 | # } 12 | # 13 | define yum::group ( 14 | Array[String[1]] $install_options = [], 15 | Enum['present', 'installed', 'latest', 'absent', 'purged'] $ensure = 'present', 16 | Optional[Integer] $timeout = undef, 17 | ) { 18 | Exec { 19 | path => '/bin:/usr/bin:/sbin:/usr/sbin', 20 | environment => 'LC_ALL=C', 21 | } 22 | 23 | case $ensure { 24 | 'present', 'installed', default: { 25 | exec { "yum-groupinstall-${name}": 26 | command => join(concat(["yum -y group install '${name}'"], $install_options), ' '), 27 | unless => "yum group list hidden '${name}' | egrep -i '^Installed.+Groups:$'", 28 | timeout => $timeout, 29 | } 30 | if $ensure == 'latest' { 31 | exec { "yum-groupinstall-${name}-latest": 32 | command => join(concat(["yum -y group install '${name}'"], $install_options), ' '), 33 | onlyif => "yum group info '${name}' | egrep '\\s+\\+'", 34 | timeout => $timeout, 35 | require => Exec["yum-groupinstall-${name}"], 36 | } 37 | } 38 | } 39 | 40 | 'absent', 'purged': { 41 | exec { "yum-groupremove-${name}": 42 | command => "yum -y group remove '${name}'", 43 | onlyif => "yum group list hidden '${name}' | egrep -i '^Installed.+Groups:$'", 44 | timeout => $timeout, 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /manifests/init.pp: -------------------------------------------------------------------------------- 1 | # A class to install and manage Yum configuration. 2 | # 3 | # @param clean_old_kernels 4 | # Whether or not to purge old kernel version beyond the `keeponly_limit`. 5 | # 6 | # @param keep_kernel_devel 7 | # Whether or not to keep kernel devel packages on old kernel purge. 8 | # 9 | # @param config_options 10 | # A Hash where keys are the names of `Yum::Config` resources and the values 11 | # are either the direct `ensure` value, or a Hash of the resource's attributes. 12 | # 13 | # @note Boolean parameter values will be converted to either a `1` or `0`; use a quoted string to 14 | # get a literal `true` or `false`. Sensitive value will disable the `show_diff`. 15 | # 16 | # 17 | # @param repos 18 | # A hash where keys are the names of `Yumrepo` resources and each value represents its respective 19 | # Yumrepo's resource parameters. This is used in conjunction with the `managed_repos` parameter 20 | # to create `Yumrepo` resources en masse. Some default data is provided for this using module 21 | # data. It is configured to deep merge with a `knockout_prefix` of `--` by default, so individual 22 | # parameters may be overriden or removed via global or environment Hiera data. 23 | # 24 | # @note Boolean parameter values will be converted to either a `1` or `0`; use a quoted string to 25 | # get a literal `true` or `false`. 26 | # 27 | # @param managed_repos 28 | # An array of first-level keys from the `repos` hash to include in the catalog. The module uses 29 | # this list to select `Yumrepo` resources from the `repos` hash for instantiation. Defaults are 30 | # set in the module's Hiera data. 31 | # 32 | # @note This only indicates the *managed* state of the repos, the `ensure` state must be managed 33 | # in the `repos` data. 34 | # 35 | # @param manage_os_default_repos 36 | # Whether or not to add an operating system's default repos to the `managed_repos` array. 37 | # 38 | # @note This only works for operating systems with data in the module's data directory. Currently 39 | # the module only contains data for for CentOS 6 & 7. 40 | # 41 | # @param os_default_repos 42 | # A list of default repos to add to `managed_repos` if `manage_os_default_repos` is enabled. 43 | # Normally this should not be modified. 44 | # 45 | # @param repo_exclusions 46 | # An array of first-level keys from the `repos` hash to exclude from management via this module. 47 | # Values in this array will be subtracted from the `managed_repos` array as a last step before 48 | # instantiation. 49 | # 50 | # @param gpgkeys 51 | # A hash of yum::gpgkey types, which will be automatically included if they 52 | # are referenced by a managed_repo. This will use the same merging behavior 53 | # as repos. 54 | # 55 | # @param utils_package_name 56 | # Name of the utils package, e.g. 'yum-utils', or 'dnf-utils'. 57 | # 58 | # @param groups 59 | # A hash of yum::group instances to manage. 60 | # 61 | # @example Enable management of the default repos for a supported OS: 62 | # --- 63 | # yum::manage_os_default_repos: true 64 | # 65 | # @example Add Hiera data to disable *management* of the CentOS Base repo: 66 | # --- 67 | # yum::manage_os_default_repos: true 68 | # yum::repo_exclusions: 69 | # - 'base' 70 | # 71 | # @example Ensure the CentOS base repo is removed from the agent system(s): 72 | # --- 73 | # yum::manage_os_default_repos: true 74 | # yum::repos: 75 | # base: 76 | # ensure: 'absent' 77 | # 78 | # @example Add a custom repo: 79 | # --- 80 | # yum::managed_repos: 81 | # - 'example_repo' 82 | # yum::repos: 83 | # example_repo: 84 | # ensure: 'present' 85 | # enabled: true 86 | # descr: 'Example Repo' 87 | # baseurl: 'https://repos.example.com/example/' 88 | # gpgcheck: true 89 | # gpgkey: 'file:///etc/pki/gpm-gpg/RPM-GPG-KEY-Example' 90 | # target: '/etc/yum.repos.d/example.repo' 91 | # 92 | # @example Use a custom `baseurl` for the CentOS Base repo: 93 | # --- 94 | # yum::manage_os_default_repos: true 95 | # yum::repos: 96 | # base: 97 | # baseurl: 'https://repos.example.com/CentOS/base/' 98 | # mirrorlist: '--' 99 | # 100 | # @example Install a couple of `yum::group`s. 101 | # --- 102 | # yum::groups: 103 | # 'Development Tools': 104 | # ensure: present 105 | # 'System Tools': 106 | # ensure: present 107 | # 108 | class yum ( 109 | Boolean $clean_old_kernels = true, 110 | Boolean $keep_kernel_devel = false, 111 | Hash[String, Variant[String, Integer, Boolean, Sensitive[String], Hash[String, Variant[String, Integer, Boolean, Sensitive[String]]]]] $config_options = {}, 112 | Hash[String, Optional[Hash[String, Variant[String, Integer, Boolean]]]] $repos = {}, 113 | Array[String] $managed_repos = [], 114 | Boolean $manage_os_default_repos = false, 115 | Array[String] $os_default_repos = [], 116 | Array[String] $repo_exclusions = [], 117 | Hash[String, Hash[String, String]] $gpgkeys = {}, 118 | String $utils_package_name = 'yum-utils', 119 | Stdlib::CreateResources $groups = {} 120 | ) { 121 | $module_metadata = load_module_metadata($module_name) 122 | $supported_operatingsystems = $module_metadata['operatingsystem_support'] 123 | $supported_os_names = $supported_operatingsystems.map |$os| { 124 | $os['operatingsystem'] 125 | } 126 | 127 | unless member($supported_os_names, $facts['os']['name']) { 128 | fail("${facts['os']['name']} not supported") 129 | } 130 | 131 | $_managed_repos = $manage_os_default_repos ? { 132 | true => $managed_repos + $os_default_repos, 133 | default => $managed_repos, 134 | } 135 | 136 | unless empty($_managed_repos) or empty($repos) { 137 | $_managed_repos_minus_exclusions = $_managed_repos - $repo_exclusions 138 | $normalized_repos = yum::bool2num_hash_recursive($repos) 139 | 140 | $normalized_repos.each |$yumrepo, $attributes| { 141 | if member($_managed_repos_minus_exclusions, $yumrepo) { 142 | yumrepo { $yumrepo: 143 | * => $attributes, 144 | } 145 | # Handle GPG Key 146 | if ('gpgkey' in $attributes) { 147 | $matches = $attributes['gpgkey'].split(/\s/).match('^file://(.*)$') 148 | $matches.each |$match| { 149 | if $match { 150 | $gpgkey = $match[1] 151 | if $gpgkey =~ Stdlib::AbsolutePath and $gpgkey in $gpgkeys { 152 | if !defined(Yum::Gpgkey[$gpgkey]) { 153 | yum::gpgkey { $gpgkey: 154 | * => $gpgkeys[$gpgkey], 155 | before => Package[$utils_package_name], 156 | # GPG Keys for any managed repository need to be installed before we attempt to install any packages. 157 | } 158 | } # end if Yum::Gpgkey[$gpgkey] is not defined 159 | } # end if $gpgkey exists in gpgkeys 160 | } # end if gpgkey is a file:// resource 161 | } # end each matches 162 | } # end if $attributes has a gpgkey 163 | } 164 | } 165 | } 166 | 167 | unless empty($config_options) { 168 | if ('installonly_limit' in $config_options) { 169 | assert_type(Variant[Integer, Hash[String, Integer]], $config_options['installonly_limit']) |$expected, $actual| { 170 | fail("The value or ensure for `\$yum::config_options[installonly_limit]` must be an Integer, but it is not.") 171 | } 172 | } 173 | 174 | $_normalized_config_options = $config_options.map |$key, $attrs| { 175 | $_ensure = $attrs ? { 176 | Hash => $attrs[ensure], 177 | default => $attrs, 178 | } 179 | 180 | $_normalized_ensure = $_ensure ? { 181 | Boolean => Hash({ 'ensure' => bool2num($_ensure) }), 182 | default => Hash({ ensure => $_ensure }), # lint:ignore:unquoted_string_in_selector 183 | } 184 | 185 | $_normalized_attrs = $attrs ? { 186 | Hash => $attrs + $_normalized_ensure, 187 | default => $_normalized_ensure, 188 | } 189 | 190 | Hash({ $key => $_normalized_attrs }) 191 | }.reduce |$memo, $cfg_opt_hash| { 192 | $memo + $cfg_opt_hash 193 | } 194 | 195 | $_normalized_config_options.each |$config, $attributes| { 196 | yum::config { $config: 197 | * => $attributes, 198 | } 199 | } 200 | } 201 | 202 | unless defined(Yum::Config['installonly_limit']) { 203 | yum::config { 'installonly_limit': ensure => '3' } 204 | } 205 | 206 | $_clean_old_kernels_subscribe = $clean_old_kernels ? { 207 | true => Yum::Config['installonly_limit'], 208 | default => undef, 209 | } 210 | 211 | # cleanup old kernels 212 | stdlib::ensure_packages([$utils_package_name]) 213 | 214 | $_real_installonly_limit = $config_options['installonly_limit'] ? { 215 | Variant[String, Integer] => $config_options['installonly_limit'], 216 | Hash => $config_options['installonly_limit']['ensure'], 217 | default => '3', 218 | } 219 | 220 | $_keep_kernel_devel = $keep_kernel_devel ? { 221 | true => $facts['package_provider'] ? { 222 | 'yum' => '--keepdevel ', 223 | 'dnf' => '--exclude kernel-release', 224 | default => fail("Fact package_provider is not set to \'yum\' or \'dnf\' - giving up"), 225 | }, 226 | default => '', 227 | } 228 | 229 | $_pc_cmd = $facts['package_provider'] ? { 230 | 'yum' => "/usr/bin/package-cleanup --oldkernels --count=${_real_installonly_limit} -y${$_keep_kernel_devel}", 231 | default => "/usr/bin/dnf -y remove $(/usr/bin/dnf repoquery --installonly --latest-limit=-${_real_installonly_limit}${_keep_kernel_devel} | /usr/bin/grep -v ${facts['kernelrelease']})" 232 | } 233 | 234 | exec { 'package-cleanup_oldkernels': 235 | command => $_pc_cmd, 236 | refreshonly => true, 237 | require => Package[$utils_package_name], 238 | subscribe => $_clean_old_kernels_subscribe, 239 | } 240 | 241 | $groups.each |$_group, $_group_attrs| { 242 | yum::group { $_group: 243 | * => $_group_attrs, 244 | } 245 | } 246 | } 247 | -------------------------------------------------------------------------------- /manifests/install.pp: -------------------------------------------------------------------------------- 1 | # 2 | # @summary Installs/removes rpms from local file/URL via yum install command. 3 | # 4 | # @note This can be better than using just the rpm provider because it will pull all the dependencies. 5 | # 6 | # @param source file or URL where RPM is available 7 | # @param ensure the desired state of the package 8 | # @param timeout optional timeout for the installation 9 | # @param require_verify optional argument, will reinstall if rpm verify fails 10 | # 11 | # @example Sample usage: 12 | # yum::install { 'epel-release': 13 | # ensure => 'present', 14 | # source => 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm', 15 | # } 16 | # 17 | define yum::install ( 18 | String $source, 19 | Enum['present', 'installed', 'absent', 'purged'] $ensure = 'present', 20 | Boolean $require_verify = false, 21 | Optional[Integer] $timeout = undef, 22 | ) { 23 | Exec { 24 | path => '/bin:/usr/bin:/sbin:/usr/sbin', 25 | environment => 'LC_ALL=C', 26 | } 27 | 28 | case $ensure { 29 | 'present', 'installed', default: { 30 | if $require_verify { 31 | exec { "yum-reinstall-${name}": 32 | command => "yum -y reinstall '${source}'", 33 | onlyif => "rpm -q '${name}'", 34 | unless => "rpm -V '${name}'", 35 | timeout => $timeout, 36 | before => Exec["yum-install-${name}"], 37 | } 38 | } 39 | 40 | exec { "yum-install-${name}": 41 | command => "yum -y install '${source}'", 42 | unless => "rpm -q '${name}'", 43 | timeout => $timeout, 44 | } 45 | } 46 | 47 | 'absent', 'purged': { 48 | package { $name: 49 | ensure => $ensure, 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /manifests/plugin.pp: -------------------------------------------------------------------------------- 1 | # 2 | # @summary This definition installs Yum plugin. 3 | # 4 | # @param ensure specifies if plugin should be present or absent 5 | # @param pkg_prefix the package prefix for the plugins 6 | # @param pkg_name the actual package name 7 | # 8 | # 9 | # @example Sample usage: 10 | # yum::plugin { 'versionlock': 11 | # ensure => 'present', 12 | # } 13 | # 14 | define yum::plugin ( 15 | Enum['present', 'absent'] $ensure = 'present', 16 | Optional[String] $pkg_prefix = undef, 17 | Optional[String] $pkg_name = undef, 18 | ) { 19 | if $pkg_prefix { 20 | $_pkg_prefix = $pkg_prefix 21 | } else { 22 | $_pkg_prefix = $facts['os']['release']['major'] ? { 23 | Variant[Integer[5,5], Enum['5']] => 'yum', 24 | default => 'yum-plugin', 25 | } 26 | } 27 | 28 | $_pkg_name = $pkg_name ? { 29 | Variant[Enum[''], Undef] => "${_pkg_prefix}-${name}", 30 | default => "${_pkg_prefix}-${pkg_name}", 31 | } 32 | 33 | package { $_pkg_name: 34 | ensure => $ensure, 35 | } 36 | 37 | if ! defined(Yum::Config['plugins']) { 38 | yum::config { 'plugins': 39 | ensure => 1, 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /manifests/plugin/post_transaction_actions.pp: -------------------------------------------------------------------------------- 1 | # @summary Class to install post_transaction plugin 2 | # 3 | # @see https://dnf-plugins-core.readthedocs.io/en/latest/post-transaction-actions.html DNF Post Transaction Items 4 | # 5 | # @param ensure Should the post_transaction actions plugin be installed 6 | # 7 | # @example Enable post_transaction_action plugin 8 | # class{'yum::plugin::post_transaction_actions': 9 | # ensure => present, 10 | # } 11 | # 12 | class yum::plugin::post_transaction_actions ( 13 | Enum['present', 'absent'] $ensure = 'present', 14 | ) { 15 | if $facts['package_provider'] == 'yum' { 16 | $_pkg_prefix = undef 17 | $_actionfile = '/etc/yum/post-actions/puppet_maintained.action' 18 | } else { 19 | $_pkg_prefix = 'python3-dnf-plugin' 20 | $_actionfile = '/etc/dnf/plugins/post-transaction-actions.d/puppet_maintained.action' 21 | } 22 | 23 | yum::plugin { 'post-transaction-actions': 24 | ensure => $ensure, 25 | pkg_prefix => $_pkg_prefix, 26 | } 27 | 28 | if $ensure == 'present' { 29 | concat { 'puppet_actions': 30 | ensure => present, 31 | path => $_actionfile, 32 | owner => root, 33 | group => root, 34 | mode => '0644', 35 | } 36 | 37 | concat::fragment { 'action_header': 38 | target => 'puppet_actions', 39 | content => "# Puppet maintained actions\n# \$key:\$state:\$command\n\n", 40 | order => '01', 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /manifests/plugin/versionlock.pp: -------------------------------------------------------------------------------- 1 | # 2 | # @summary This class installs versionlock plugin 3 | # 4 | # @param ensure specifies if versionlock should be present or absent 5 | # @param clean specifies if yum clean all should be called after edits. Defaults false. 6 | # @param path filepath for the versionlock.list, default based on your system. 7 | # 8 | # @example Sample usage: 9 | # class { 'yum::plugin::versionlock': 10 | # ensure => present, 11 | # } 12 | # 13 | class yum::plugin::versionlock ( 14 | String $path, 15 | Enum['present', 'absent'] $ensure = 'present', 16 | Boolean $clean = false, 17 | ) { 18 | $pkg_prefix = $facts['package_provider'] ? { 19 | 'dnf' => 'python3-dnf-plugin', 20 | 'yum' => 'yum-plugin', 21 | default => '', 22 | } 23 | 24 | yum::plugin { 'versionlock': 25 | ensure => $ensure, 26 | pkg_prefix => $pkg_prefix, 27 | } 28 | 29 | if $ensure == 'present' { 30 | include yum::clean 31 | $_clean_notify = $clean ? { 32 | true => Exec['yum_clean_all'], 33 | false => undef, 34 | } 35 | 36 | concat { $path: 37 | mode => '0644', 38 | owner => 'root', 39 | group => 'root', 40 | notify => $_clean_notify, 41 | } 42 | 43 | concat::fragment { 'versionlock_header': 44 | target => $path, 45 | content => "# File managed by puppet\n", 46 | order => '01', 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /manifests/post_transaction_action.pp: -------------------------------------------------------------------------------- 1 | # @summary Creates post transaction configuratons for dnf or yum. 2 | # 3 | # @see https://dnf-plugins-core.readthedocs.io/en/latest/post-transaction-actions.html DNF Post Transaction Items 4 | # 5 | # @param action Name variable a string to label the rule 6 | # @param key Package name, glob or file name file glob. 7 | # @param state 8 | # Can be `install`, `update`, `remove` or `any` on YUM based systems. 9 | # Can be `in`, `out` or `any` on DNF based systems. 10 | # @param command The command to run 11 | # 12 | # @example Touch a file when ssh is package is updated, installed or removed. 13 | # yum::post_transaction_action{'touch file on ssh package update': 14 | # key => 'openssh-*', 15 | # state => 'any', 16 | # command => 'touch /tmp/openssh-installed', 17 | # } 18 | # 19 | define yum::post_transaction_action ( 20 | Variant[Enum['*'],Yum::RpmNameGlob,Stdlib::Unixpath] $key, 21 | String[1] $command, 22 | Enum['install', 'update', 'remove', 'any', 'in', 'out'] $state = 'any', 23 | String[1] $action = $title, 24 | ) { 25 | # 26 | # The valid Enum is different for yum and dnf based systems. 27 | # 28 | if $facts['package_provider'] == 'yum' { 29 | assert_type(Enum['install','update','remove','any'],$state) |$expected, $actual| { 30 | fail("The state parameter on ${facts['package_provider']} based systems should be \'${expected}\' and not \'${actual}\'") 31 | } 32 | } else { 33 | assert_type(Enum['in', 'out', 'any'],$state) |$expected, $actual| { 34 | fail("The state parameter on ${facts['package_provider']} based systems should be \'${expected}\' and not \'${actual}\'") 35 | } 36 | } 37 | 38 | require yum::plugin::post_transaction_actions 39 | 40 | if $yum::plugin::post_transaction_actions::ensure == 'present' { 41 | concat::fragment { "post_trans_${action}": 42 | target => 'puppet_actions', 43 | content => "# Action name: ${action}\n${key}:${state}:${command}\n\n", 44 | order => '10', 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /manifests/settings.pp: -------------------------------------------------------------------------------- 1 | # @summary Simple settings to use 2 | # @param mainconf 3 | # Augeas location of the dnf or yum configuration file. 4 | # The default is set into hiera according to the package_provider 5 | # being yum or dnf. 6 | # 7 | class yum::settings ( 8 | Enum['/etc/yum.conf','/etc/dnf/dnf.conf'] $mainconf, 9 | ) {} 10 | -------------------------------------------------------------------------------- /manifests/versionlock.pp: -------------------------------------------------------------------------------- 1 | # @summary Locks package from updates. 2 | # 3 | # @example Sample usage on CentOS 7 4 | # yum::versionlock { '0:bash-4.1.2-9.el7.*': 5 | # ensure => present, 6 | # } 7 | # 8 | # @example Sample usage on CentOS 8 9 | # yum::versionlock { 'bash': 10 | # ensure => present, 11 | # version => '4.1.2', 12 | # release => '9.el8', 13 | # epoch => 0, 14 | # arch => 'noarch', 15 | # } 16 | # 17 | # 18 | # @example Sample usage on CentOS 7 with new style version, release, epoch, name parameters. 19 | # yum::versionlock { 'bash': 20 | # ensure => present, 21 | # version => '3.1.2', 22 | # release => '9.el7', 23 | # epoch => 0, 24 | # arch => 'noarch', 25 | # } 26 | # 27 | # @param ensure 28 | # Specifies if versionlock should be `present`, `absent` or `exclude`. 29 | # 30 | # @param version 31 | # Version of the package if CentOS 8 mechanism is used. This must be set for dnf based systems (e.g CentOS 8). 32 | # If version is set then the name var is assumed to a package name and not the full versionlock string. 33 | # 34 | # @param release 35 | # Release of the package if CentOS 8 mechanism is used. 36 | # 37 | # @param arch 38 | # Arch of the package if CentOS 8 mechanism is used. 39 | # 40 | # @param epoch 41 | # Epoch of the package if CentOS 8 mechanism is used. 42 | # 43 | # @note The resource title must use the format 44 | # By default on CentOS 7 the following format is used. 45 | # "%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}". This can be retrieved via 46 | # the command `rpm -q --qf '%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}'. 47 | # If "%{EPOCH}" returns as '(none)', it should be set to '0'. Wildcards may 48 | # be used within token slots, but must not cover seperators, e.g., 49 | # '0:b*sh-4.1.2-9.*' covers Bash version 4.1.2, revision 9 on all 50 | # architectures. 51 | # By default on CentOS 8 and newer the resource title to just set the 52 | # package name. 53 | # If a version is set on CentOS 7 then it behaves like CentOS 8 54 | # 55 | # @see http://man7.org/linux/man-pages/man1/yum-versionlock.1.html 56 | define yum::versionlock ( 57 | Enum['present', 'absent', 'exclude'] $ensure = 'present', 58 | Optional[Yum::RpmVersion] $version = undef, 59 | Yum::RpmRelease $release = '*', 60 | Integer[0] $epoch = 0, 61 | Variant[Yum::RpmArch, Enum['*']] $arch = '*', 62 | ) { 63 | require yum::plugin::versionlock 64 | 65 | $line_prefix = $ensure ? { 66 | 'exclude' => '!', 67 | default => '', 68 | } 69 | 70 | if $facts['package_provider'] == 'yum' and $version =~ Undef { 71 | assert_type(Yum::VersionlockString, $name) |$_expected, $actual | { 72 | # lint:ignore:140chars 73 | fail("Package name must be formatted as %{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}, not \'${actual}\'. See Yum::Versionlock documentation for details.") 74 | # lint:endignore 75 | } 76 | 77 | $_versionlock = "${line_prefix}${name}" 78 | } else { 79 | assert_type(Yum::RpmNameGlob, $name) |$_expected, $actual | { 80 | fail("Package name must be formatted as Yum::RpmName, not \'${actual}\'. See Yum::Rpmname documentation for details.") 81 | } 82 | 83 | assert_type(Yum::RpmVersion, $version) |$_expected, $actual | { 84 | fail("Version must be formatted as Yum::RpmVersion, not \'${actual}\'. See Yum::RpmVersion documentation for details.") 85 | } 86 | 87 | $_versionlock = $facts['package_provider'] ? { 88 | 'yum' => "${line_prefix}${epoch}:${name}-${version}-${release}.${arch}", 89 | default => "${line_prefix}${name}-${epoch}:${version}-${release}.${arch}", 90 | } 91 | } 92 | 93 | unless $ensure == 'absent' { 94 | concat::fragment { "yum-versionlock-${name}": 95 | content => "${_versionlock}\n", 96 | target => $yum::plugin::versionlock::path, 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "puppet-yum", 3 | "version": "7.3.1-rc0", 4 | "author": "Vox Pupuli", 5 | "summary": "YUM utilities", 6 | "license": "MIT", 7 | "source": "https://github.com/voxpupuli/puppet-yum.git", 8 | "project_page": "https://github.com/voxpupuli/puppet-yum", 9 | "issues_url": "https://github.com/voxpupuli/puppet-yum/issues", 10 | "dependencies": [ 11 | { 12 | "name": "puppetlabs/stdlib", 13 | "version_requirement": ">= 9.0.0 < 10.0.0" 14 | }, 15 | { 16 | "name": "puppetlabs/concat", 17 | "version_requirement": ">= 1.2.5 < 10.0.0" 18 | } 19 | ], 20 | "tags": [ 21 | "yum", 22 | "package", 23 | "rpm", 24 | "dnf", 25 | "voxpupuli" 26 | ], 27 | "operatingsystem_support": [ 28 | { 29 | "operatingsystem": "AlmaLinux", 30 | "operatingsystemrelease": [ 31 | "8", 32 | "9" 33 | ] 34 | }, 35 | { 36 | "operatingsystem": "Amazon", 37 | "operatingsystemrelease": [ 38 | "2017" 39 | ] 40 | }, 41 | { 42 | "operatingsystem": "CentOS", 43 | "operatingsystemrelease": [ 44 | "9" 45 | ] 46 | }, 47 | { 48 | "operatingsystem": "Fedora", 49 | "operatingsystemrelease": [ 50 | "36", 51 | "37", 52 | "38", 53 | "40" 54 | ] 55 | }, 56 | { 57 | "operatingsystem": "OracleLinux", 58 | "operatingsystemrelease": [ 59 | "8", 60 | "9" 61 | ] 62 | }, 63 | { 64 | "operatingsystem": "RedHat", 65 | "operatingsystemrelease": [ 66 | "8", 67 | "9" 68 | ] 69 | }, 70 | { 71 | "operatingsystem": "Rocky", 72 | "operatingsystemrelease": [ 73 | "8", 74 | "9" 75 | ] 76 | } 77 | ], 78 | "requirements": [ 79 | { 80 | "name": "puppet", 81 | "version_requirement": ">= 7.0.0 < 9.0.0" 82 | }, 83 | { 84 | "name": "openvox", 85 | "version_requirement": ">= 7.0.0 < 9.0.0" 86 | } 87 | ] 88 | } 89 | -------------------------------------------------------------------------------- /spec/acceptance/class_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper_acceptance' 4 | 5 | describe 'yum class' do 6 | context 'default parameters' do 7 | # Using puppet_apply as a helper 8 | it 'must work idempotently with no errors' do 9 | pp = <<-EOS 10 | class { 'yum': } 11 | EOS 12 | 13 | # Run it twice and test for idempotency 14 | apply_manifest(pp, catch_failures: true) 15 | apply_manifest(pp, catch_changes: true) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/acceptance/copr_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper_acceptance' 4 | 5 | describe 'yum::copr' do 6 | context 'when @caddy/caddy and nucleo/wget are enabled' do 7 | # Using puppet_apply as a helper 8 | it 'must work idempotently with no errors' do 9 | pp = <<-PUPPET 10 | yum::copr { ['@caddy/caddy', 'nucleo/wget']: } 11 | PUPPET 12 | 13 | # Run it twice and test for idempotency 14 | apply_manifest(pp, catch_failures: true) 15 | apply_manifest(pp, catch_changes: true) 16 | end 17 | 18 | describe command('dnf copr list') do 19 | its(:stdout) { is_expected.to match(%r{^copr.fedorainfracloud.org/nucleo/wget$}) } 20 | its(:stdout) { is_expected.to match(%r{^copr.fedorainfracloud.org/group_caddy/caddy$}) } 21 | end 22 | end 23 | 24 | context 'when nucleo/wget is disabled' do 25 | # Using puppet_apply as a helper 26 | it 'must work idempotently with no errors' do 27 | pp = <<-PUPPET 28 | yum::copr { ['@caddy/caddy', 'nucleo/wget']: 29 | ensure => 'disabled', 30 | } 31 | PUPPET 32 | 33 | # Run it twice and test for idempotency 34 | apply_manifest(pp, catch_failures: true) 35 | apply_manifest(pp, catch_changes: true) 36 | end 37 | 38 | describe command('dnf copr list') do 39 | its(:stdout) { is_expected.to match(%r{^copr.fedorainfracloud.org/nucleo/wget \(disabled\)$}) } 40 | its(:stdout) { is_expected.to match(%r{^copr.fedorainfracloud.org/group_caddy/caddy \(disabled\)$}) } 41 | end 42 | end 43 | 44 | context 'when nucleo/wget is removed' do 45 | # Using puppet_apply as a helper 46 | it 'must work idempotently with no errors' do 47 | pp = <<-PUPPET 48 | yum::copr { ['@caddy/caddy', 'nucleo/wget']: 49 | ensure => 'removed', 50 | } 51 | PUPPET 52 | 53 | # Run it twice and test for idempotency 54 | apply_manifest(pp, catch_failures: true) 55 | apply_manifest(pp, catch_changes: true) 56 | end 57 | 58 | describe command('dnf copr list') do 59 | its(:stdout) { is_expected.not_to match(%r{^copr.fedorainfracloud.org/nucleo/wget$}) } 60 | its(:stdout) { is_expected.not_to match(%r{^copr.fedorainfracloud.org/group_caddy/caddy$}) } 61 | end 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /spec/acceptance/define_group_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper_acceptance' 4 | 5 | describe 'managing a yum::group' do 6 | context 'installing group RPM dev tools' do 7 | # Using puppet_apply as a helper 8 | it 'must work idempotently with no errors' do 9 | pp = <<-EOS 10 | yum::group { 'Development Tools': 11 | ensure => 'installed', 12 | } 13 | EOS 14 | 15 | # Run it twice and test for idempotency 16 | apply_manifest(pp, catch_failures: true) 17 | apply_manifest(pp, catch_changes: true) 18 | end 19 | 20 | describe package('make') do 21 | it { is_expected.to be_installed } 22 | end 23 | end 24 | 25 | context 'removing group RPM dev tools' do 26 | # Using puppet_apply as a helper 27 | it 'must work idempotently with no errors' do 28 | pp = <<-EOS 29 | yum::group { 'Development Tools': 30 | ensure => 'absent', 31 | } 32 | EOS 33 | 34 | # Run it twice and test for idempotency 35 | apply_manifest(pp, catch_failures: true) 36 | apply_manifest(pp, catch_changes: true) 37 | end 38 | 39 | describe package('make') do 40 | it { is_expected.not_to be_installed } 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /spec/acceptance/define_versionlock_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper_acceptance' 4 | 5 | describe 'yum::versionlock define' do 6 | context 'default parameters' do 7 | # Using puppet_apply as a helper 8 | it 'must work idempotently with no errors' do 9 | pp = <<-EOS 10 | if versioncmp($facts['os']['release']['major'],'7') <= 0 { 11 | yum::versionlock{ '0:bash-4.1.2-9.el6_2.*': 12 | ensure => present, 13 | } 14 | yum::versionlock{ '0:tcsh-3.1.2-9.el6_2.*': 15 | ensure => present, 16 | } 17 | } else { 18 | yum::versionlock{ 'bash': 19 | ensure => present, 20 | version => '4.1.2', 21 | release => '9.el6_2', 22 | } 23 | yum::versionlock{ 'tcsh': 24 | ensure => present, 25 | version => '3.1.2', 26 | release => '9.el6_2', 27 | arch => '*', 28 | epoch => 0, 29 | } 30 | } 31 | 32 | # Lock a package with new style on all OSes 33 | yum::versionlock{ 'netscape': 34 | ensure => present, 35 | version => '8.1.2', 36 | release => '9.el6_2', 37 | arch => '*', 38 | epoch => 2, 39 | } 40 | 41 | EOS 42 | # Run it twice and test for idempotency 43 | apply_manifest(pp, catch_failures: true) 44 | apply_manifest(pp, catch_changes: true) 45 | end 46 | 47 | if fact('os.release.major') == '7' 48 | describe file('/etc/yum/pluginconf.d/versionlock.list') do 49 | it { is_expected.to be_file } 50 | it { is_expected.to contain '0:bash-4.1.2-9.el6_2.*' } 51 | it { is_expected.to contain '0:tcsh-3.1.2-9.el6_2.*' } 52 | it { is_expected.to contain '2:netscape-8.1.2-9.el6_2.*' } 53 | end 54 | else 55 | describe file('/etc/dnf/plugins/versionlock.list') do 56 | it { is_expected.to be_file } 57 | 58 | it { is_expected.to contain 'bash-0:4.1.2-9.el6_2.*' } 59 | it { is_expected.to contain 'tcsh-0:3.1.2-9.el6_2.*' } 60 | it { is_expected.to contain 'netscape-2:8.1.2-9.el6_2.*' } 61 | end 62 | end 63 | 64 | if fact('os.release.major') == '7' 65 | describe package('yum-plugin-versionlock') do 66 | it { is_expected.to be_installed } 67 | end 68 | else 69 | describe package('python3-dnf-plugin-versionlock') do 70 | it { is_expected.to be_installed } 71 | end 72 | end 73 | end 74 | 75 | it 'must work if clean is specified' do 76 | shell('yum repolist', acceptable_exit_codes: [0]) 77 | pp = <<-EOS 78 | class{yum::plugin::versionlock: 79 | clean => true, 80 | } 81 | # Pick an obscure package that hopefully will not be installed. 82 | if versioncmp($facts['os']['release']['major'],'7') <= 0 { 83 | yum::versionlock{ '0:samba-devel-3.1.2-9.el6_2.*': 84 | ensure => present, 85 | } 86 | } else { 87 | yum::versionlock{'samba-devel': 88 | ensure => present, 89 | version => '3.1.2', 90 | release => '9.el6_2', 91 | } 92 | } 93 | EOS 94 | # Run it twice and test for idempotency 95 | apply_manifest(pp, catch_failures: true) 96 | apply_manifest(pp, catch_changes: true) 97 | 98 | # Check the cache is really empty. 99 | # all repos will have 0 packages. 100 | # bit confused by the motivation of the first test? 101 | if fact('os.release.major') == '7' 102 | shell('yum -C repolist -d0 | grep -v "repo id" | awk "{print $NF}" FS= | grep -v 0', acceptable_exit_codes: [1]) 103 | shell('yum -q list available samba-devel', acceptable_exit_codes: [1]) 104 | elsif %w[8 9].include?(fact('os.release.major')) 105 | shell('dnf -q list --available samba-devel', acceptable_exit_codes: [1]) 106 | else 107 | shell('dnf install -y samba-devel | grep "All matches were filtered"', acceptable_exit_codes: [0]) 108 | end 109 | end 110 | end 111 | -------------------------------------------------------------------------------- /spec/acceptance/post_transaction_actions_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper_acceptance' 4 | 5 | describe 'yum::post_transaction_action define' do 6 | context 'simple parameters' do 7 | let(:pre_condition) do 8 | " 9 | package{ 'vim-enhanced-absent': 10 | name => 'vim-enhanced', 11 | ensure => 'absent', 12 | } 13 | " 14 | end 15 | 16 | # Using puppet_apply as a helper 17 | it 'must work idempotently with no errors' do 18 | pp = <<-EOS 19 | yum::post_transaction_action{'touch_file': 20 | key => 'vim-*', 21 | command => 'touch /tmp/vim-installed', 22 | } 23 | yum::post_transaction_action{'second to check for conflicts': 24 | key => 'openssh-*', 25 | command => 'touch /tmp/openssh-installed', 26 | } 27 | # Pick a package that is hopefully not installed. 28 | package{'vim-enhanced': 29 | ensure => 'present', 30 | require => Yum::Post_transaction_action['touch_file'], 31 | } 32 | EOS 33 | # Run it twice and test for idempotency 34 | apply_manifest(pp, catch_failures: true) 35 | apply_manifest(pp, catch_changes: true) 36 | end 37 | 38 | describe file('/tmp/vim-installed') do 39 | it { is_expected.to be_file } 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /spec/acceptance/yum_config_install_limit_2_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper_acceptance' 4 | 5 | describe 'yum::config installonly_limit 1' do 6 | context 'simple parameters' do 7 | # Using puppet_apply as a helper 8 | it 'must work idempotently with no errors' do 9 | pp = <<-EOS 10 | yum::config{'installonly_limit': 11 | ensure => 2, # yum (and not dnf) does not like the value 1 12 | } 13 | include yum 14 | EOS 15 | # Run it twice and test for idempotency 16 | apply_manifest(pp, catch_failures: true) 17 | apply_manifest(pp, catch_changes: true) 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /spec/acceptance/yum_config_variable_false_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper_acceptance' 4 | 5 | describe 'yum::config variable false' do 6 | context 'simple parameters' do 7 | # Using puppet_apply as a helper 8 | it 'must work idempotently with no errors' do 9 | pp = <<-EOS 10 | yum::config{'variable': 11 | ensure => false, 12 | } 13 | EOS 14 | # Run it twice and test for idempotency 15 | apply_manifest(pp, catch_failures: true) 16 | apply_manifest(pp, catch_changes: true) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/classes/plugin_post_transaction_actions_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::plugin::post_transaction_actions' do 6 | on_supported_os.each do |os, os_facts| 7 | context "on #{os}" do 8 | %w[yum dnf].each do |provider| 9 | context "with package_provider #{provider}" do 10 | let(:facts) do 11 | os_facts.merge(package_provider: provider) 12 | end 13 | 14 | it { is_expected.to compile.with_all_deps } 15 | it { is_expected.to contain_concat('puppet_actions') } 16 | it { is_expected.to contain_concat__fragment('action_header') } 17 | 18 | case provider 19 | when 'yum' 20 | it { is_expected.to contain_package('yum-plugin-post-transaction-actions').with_ensure('present') } 21 | it { is_expected.not_to contain_package('python3-dnf-plugin-post-transaction-actions') } 22 | it { is_expected.to contain_concat('puppet_actions').with_path('/etc/yum/post-actions/puppet_maintained.action') } 23 | else 24 | it { is_expected.to contain_package('python3-dnf-plugin-post-transaction-actions').with_ensure('present') } 25 | it { is_expected.not_to contain_package('yum-plugin-post-transaction-actions') } 26 | it { is_expected.to contain_concat('puppet_actions').with_path('/etc/dnf/plugins/post-transaction-actions.d/puppet_maintained.action') } 27 | end 28 | context 'with plugin disable' do 29 | let(:params) do 30 | { ensure: 'absent' } 31 | end 32 | 33 | it { is_expected.to compile.with_all_deps } 34 | it { is_expected.not_to contain_concat('puppet_actions') } 35 | it { is_expected.not_to contain_concat__fragment('action_header') } 36 | 37 | case provider 38 | when 'yum' 39 | it { is_expected.to contain_package('yum-plugin-post-transaction-actions').with_ensure('absent') } 40 | it { is_expected.not_to contain_package('python3-dnf-plugin-post-transaction-actions') } 41 | else 42 | it { is_expected.to contain_package('python3-dnf-plugin-post-transaction-actions').with_ensure('absent') } 43 | it { is_expected.not_to contain_package('yum-plugin-post-transaction-actions') } 44 | end 45 | end 46 | end 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /spec/classes/plugin_versionlock_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::plugin::versionlock' do 6 | on_supported_os.each do |os, os_facts| 7 | context "on #{os}" do 8 | %w[yum dnf].each do |provider| 9 | context "with package_provider #{provider}" do 10 | let(:facts) do 11 | os_facts.merge(package_provider: provider) 12 | end 13 | 14 | it { is_expected.to compile.with_all_deps } 15 | 16 | case provider 17 | when 'yum' 18 | it { is_expected.to contain_package('yum-plugin-versionlock').with_ensure('present') } 19 | it { is_expected.not_to contain_package('python3-dnf-plugin-versionlock') } 20 | it { is_expected.to contain_concat__fragment('versionlock_header').with_target('/etc/yum/pluginconf.d/versionlock.list') } 21 | else 22 | it { is_expected.to contain_package('python3-dnf-plugin-versionlock').with_ensure('present') } 23 | it { is_expected.not_to contain_package('yum-plugin-versionlock') } 24 | it { is_expected.to contain_concat__fragment('versionlock_header').with_target('/etc/dnf/plugins/versionlock.list') } 25 | end 26 | context 'with plugin disable' do 27 | let(:params) do 28 | { ensure: 'absent' } 29 | end 30 | 31 | it { is_expected.to compile.with_all_deps } 32 | it { is_expected.not_to contain_concat__fragment('versionlock_header') } 33 | 34 | case provider 35 | when 'yum' 36 | it { is_expected.to contain_package('yum-plugin-versionlock').with_ensure('absent') } 37 | it { is_expected.not_to contain_package('python3-dnf-plugin-versionlock') } 38 | else 39 | it { is_expected.to contain_package('python3-dnf-plugin-versionlock').with_ensure('absent') } 40 | it { is_expected.not_to contain_package('yum-plugin-versionlock') } 41 | end 42 | end 43 | end 44 | end 45 | end 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /spec/defines/config_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::config' do 6 | context 'with no parameters' do 7 | let(:title) { 'assumeyes' } 8 | 9 | it { is_expected.to compile.and_raise_error(%r{expects a value for parameter 'ensure'}) } 10 | end 11 | 12 | %w[dnf yum].each do |pkgmgr| 13 | context "when package_provider fact is #{pkgmgr}" do 14 | let(:facts) { { package_provider: pkgmgr } } 15 | 16 | context 'when ensure is a Boolean' do 17 | let(:title) { 'assumeyes' } 18 | let(:params) { { ensure: true } } 19 | 20 | it { is_expected.to compile.with_all_deps } 21 | 22 | it 'contains an Augeas resource with the correct changes' do 23 | case pkgmgr 24 | when 'yum' 25 | is_expected.to contain_augeas("yum.conf_#{title}").with( 26 | incl: '/etc/yum.conf', 27 | context: '/files/etc/yum.conf/main/', 28 | changes: "set assumeyes '1'" 29 | ) 30 | else 31 | is_expected.to contain_augeas("dnf.conf_#{title}").with( 32 | incl: '/etc/dnf/dnf.conf', 33 | context: '/files/etc/dnf/dnf.conf/main/', 34 | changes: "set assumeyes '1'" 35 | ) 36 | end 37 | end 38 | end 39 | 40 | context 'ensure is an Integer' do 41 | let(:title) { 'assumeyes' } 42 | let(:params) { { ensure: 0 } } 43 | 44 | it { is_expected.to compile.with_all_deps } 45 | 46 | it 'contains an Augeas resource with the correct changes' do 47 | case pkgmgr 48 | when 'yum' 49 | is_expected.to contain_augeas("yum.conf_#{title}").with( 50 | changes: "set assumeyes '0'" 51 | ) 52 | else 53 | is_expected.to contain_augeas("dnf.conf_#{title}").with( 54 | changes: "set assumeyes '0'" 55 | ) 56 | end 57 | end 58 | end 59 | 60 | context 'ensure is a comma separated String' do 61 | let(:title) { 'assumeyes' } 62 | let(:params) { { ensure: '1, 2' } } 63 | 64 | it { is_expected.to compile.with_all_deps } 65 | 66 | it 'contains an Augeas resource with the correct changes' do 67 | case pkgmgr 68 | when 'yum' 69 | is_expected.to contain_augeas("yum.conf_#{title}").with( 70 | changes: "set assumeyes '1, 2'" 71 | ) 72 | else 73 | is_expected.to contain_augeas("dnf.conf_#{title}").with( 74 | changes: "set assumeyes '1, 2'" 75 | ) 76 | end 77 | end 78 | end 79 | 80 | context 'when ensure is a Sensitive[String]' do 81 | let(:title) { 'assumeyes' } 82 | let(:params) { { ensure: sensitive('secret') } } 83 | 84 | it { is_expected.to compile.with_all_deps } 85 | 86 | it 'contains an Augeas resource with the correct changes' do 87 | case pkgmgr 88 | when 'yum' 89 | is_expected.to contain_augeas("yum.conf_#{title}").with( 90 | changes: "set assumeyes 'secret'", 91 | show_diff: false 92 | ) 93 | else 94 | is_expected.to contain_augeas("dnf.conf_#{title}").with( 95 | changes: "set assumeyes 'secret'", 96 | show_diff: false 97 | ) 98 | end 99 | end 100 | end 101 | end 102 | end 103 | end 104 | -------------------------------------------------------------------------------- /spec/defines/copr_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::copr' do 6 | context 'with package_provider set to yum' do 7 | let(:facts) { { package_provider: 'yum' } } 8 | let(:prereq_plugin) { 'yum-plugin-copr' } 9 | let(:title) { 'copart/restic' } 10 | let(:copr_repo_name_part) { title.gsub('/', '-') } 11 | 12 | context 'package provider plugin installed' do 13 | it { is_expected.to compile.with_all_deps } 14 | 15 | it { 16 | is_expected.to contain_package(prereq_plugin.to_s) 17 | } 18 | end 19 | 20 | context 'with ensure = enabled' do 21 | let(:params) { { ensure: 'enabled' } } 22 | 23 | it { is_expected.to compile.with_all_deps } 24 | 25 | it { 26 | is_expected.to contain_exec("yum -y copr enable #{title}").with( 27 | 'path' => '/bin:/usr/bin:/sbin/:/usr/sbin', 28 | 'onlyif' => "test ! -e /etc/yum.repos.d/_copr_#{copr_repo_name_part}.repo", 29 | 'require' => "Package[#{prereq_plugin}]" 30 | ) 31 | } 32 | end 33 | 34 | context 'with ensure = disabled' do 35 | let(:params) { { ensure: 'disabled' } } 36 | 37 | it { is_expected.to compile.with_all_deps } 38 | 39 | it { 40 | is_expected.to contain_exec("yum -y copr disable #{title}").with( 41 | 'path' => '/bin:/usr/bin:/sbin/:/usr/sbin', 42 | 'onlyif' => "test -e /etc/yum.repos.d/_copr_#{copr_repo_name_part}.repo", 43 | 'require' => "Package[#{prereq_plugin}]" 44 | ) 45 | } 46 | end 47 | 48 | context 'with ensure = removed' do 49 | let(:params) { { ensure: 'removed' } } 50 | 51 | it { is_expected.to compile.with_all_deps } 52 | 53 | it { 54 | is_expected.to contain_exec("yum -y copr disable #{title}").with( 55 | 'path' => '/bin:/usr/bin:/sbin/:/usr/sbin', 56 | 'onlyif' => "test -e /etc/yum.repos.d/_copr_#{copr_repo_name_part}.repo", 57 | 'require' => "Package[#{prereq_plugin}]" 58 | ) 59 | } 60 | end 61 | end 62 | 63 | context 'with package_provider set to dnf' do 64 | let(:facts) { { package_provider: 'dnf' } } 65 | let(:prereq_plugin) { 'dnf-plugins-core' } 66 | let(:title) { 'copart/restic' } 67 | 68 | context 'package provider plugin installed' do 69 | it { is_expected.to compile.with_all_deps } 70 | 71 | it { 72 | is_expected.to contain_package(prereq_plugin.to_s) 73 | } 74 | end 75 | 76 | context 'with ensure = enabled' do 77 | let(:params) { { ensure: 'enabled' } } 78 | 79 | it { is_expected.to compile.with_all_deps } 80 | 81 | it { 82 | is_expected.to contain_exec("dnf -y copr enable #{title}").with( 83 | 'path' => '/bin:/usr/bin:/sbin/:/usr/sbin', 84 | 'unless' => "dnf copr list | egrep -q '#{title}$'", 85 | 'require' => "Package[#{prereq_plugin}]" 86 | ) 87 | } 88 | end 89 | 90 | context 'with ensure = disabled' do 91 | let(:params) { { ensure: 'disabled' } } 92 | 93 | it { is_expected.to compile.with_all_deps } 94 | 95 | it { 96 | is_expected.to contain_exec("dnf -y copr disable #{title}").with( 97 | 'path' => '/bin:/usr/bin:/sbin/:/usr/sbin', 98 | 'unless' => "dnf copr list | egrep -q '#{title} \\(disabled\\)$'", 99 | 'require' => "Package[#{prereq_plugin}]" 100 | ) 101 | } 102 | end 103 | 104 | context 'with ensure = removed' do 105 | let(:params) { { ensure: 'removed' } } 106 | 107 | it { is_expected.to compile.with_all_deps } 108 | 109 | it { 110 | is_expected.to contain_exec("dnf -y copr remove #{title}").with( 111 | 'path' => '/bin:/usr/bin:/sbin/:/usr/sbin', 112 | 'onlyif' => "dnf copr list | egrep -q '#{title}'", 113 | 'require' => "Package[#{prereq_plugin}]" 114 | ) 115 | } 116 | end 117 | end 118 | end 119 | -------------------------------------------------------------------------------- /spec/defines/gpgkey_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::gpgkey' do 6 | context 'with no parameters' do 7 | let(:title) { '/test-key' } 8 | 9 | it { is_expected.to compile.and_raise_error(%r{Missing params: \$content or \$source must be specified}) } 10 | end 11 | 12 | context 'with content provided' do 13 | let(:title) { '/test-key' } 14 | let(:params) { { content: 'a_non_empty_string' } } 15 | 16 | context 'with ensure = present' do 17 | let(:params) do 18 | super().merge(ensure: 'present') 19 | end 20 | 21 | it { is_expected.to compile.with_all_deps } 22 | 23 | it { 24 | is_expected.to contain_exec("rpm-import-#{title}").with( 25 | 'path' => '/bin:/usr/bin:/sbin/:/usr/sbin', 26 | 'command' => "rpm --import #{title}", 27 | 'unless' => "rpm -q gpg-pubkey-$(gpg --with-colons #{title} | head -n 1 | cut -d: -f5 | cut -c9-16 | tr '[A-Z]' '[a-z]')", 28 | 'require' => "File[#{title}]" 29 | ) 30 | } 31 | end 32 | 33 | context 'with ensure = absent' do 34 | let(:params) do 35 | super().merge(ensure: 'absent') 36 | end 37 | 38 | it { is_expected.to compile.with_all_deps } 39 | 40 | it { 41 | is_expected.to contain_exec("rpm-delete-#{title}").with( 42 | 'path' => '/bin:/usr/bin:/sbin/:/usr/sbin', 43 | 'command' => "rpm -e gpg-pubkey-$(gpg --with-colons #{title} | head -n 1 | cut -d: -f5 | cut -c9-16 | tr '[A-Z]' '[a-z]')", 44 | 'onlyif' => ["test -f #{title}", "rpm -q gpg-pubkey-$(gpg --with-colons #{title} | head -n 1 | cut -d: -f5 | cut -c9-16 | tr '[A-Z]' '[a-z]')"], 45 | 'before' => "File[#{title}]" 46 | ) 47 | } 48 | end 49 | end 50 | 51 | context 'with a source specified' do 52 | let(:title) { '/test-key' } 53 | let(:params) { { source: 'puppet:///files/test-key' } } 54 | 55 | it { is_expected.to compile.with_all_deps } 56 | end 57 | 58 | context 'when both content and source are specified' do 59 | let(:title) { '/test-key' } 60 | let(:params) do 61 | { 62 | content: 'a_non_empty_string', 63 | source: 'puppet:///files/test-key' 64 | } 65 | end 66 | 67 | it { is_expected.to compile.and_raise_error(%r{You cannot specify more than one of content, source}) } 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /spec/defines/group_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::group' do 6 | context 'with no parameters' do 7 | let(:title) { 'Core' } 8 | 9 | it { is_expected.to compile.with_all_deps } 10 | it { is_expected.to contain_exec("yum-groupinstall-#{title}").with_command("yum -y group install 'Core'") } 11 | end 12 | 13 | context 'when ensure is set to `absent`' do 14 | let(:title) { 'Core' } 15 | let(:params) { { ensure: 'absent' } } 16 | 17 | it { is_expected.to compile.with_all_deps } 18 | it { is_expected.to contain_exec("yum-groupremove-#{title}").with_command("yum -y group remove 'Core'") } 19 | end 20 | 21 | context 'with a timeout specified' do 22 | let(:title) { 'Core' } 23 | let(:params) { { timeout: 30 } } 24 | 25 | it { is_expected.to compile.with_all_deps } 26 | it { is_expected.to contain_exec("yum-groupinstall-#{title}").with_timeout(30) } 27 | end 28 | 29 | context 'with an install option specified' do 30 | let(:title) { 'Core' } 31 | let(:params) { { install_options: ['--enablerepo=epel'] } } 32 | 33 | it { is_expected.to compile.with_all_deps } 34 | it { is_expected.to contain_exec("yum-groupinstall-#{title}").with_command("yum -y group install 'Core' --enablerepo=epel") } 35 | end 36 | 37 | context 'when ensure is set to `latest`' do 38 | let(:title) { 'Core' } 39 | let(:params) { { ensure: 'latest' } } 40 | 41 | it { is_expected.to compile.with_all_deps } 42 | it { is_expected.to contain_exec("yum-groupinstall-#{title}").with_command("yum -y group install 'Core'") } 43 | it { is_expected.to contain_exec("yum-groupinstall-#{title}-latest").with_command("yum -y group install 'Core'") } 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /spec/defines/plugin_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::plugin' do 6 | on_supported_os.each do |os, facts| 7 | context "on #{os}" do 8 | let(:facts) { facts } 9 | let(:prefix) { facts[:os]['release']['major'] == '5' ? 'yum' : 'yum-plugin' } 10 | 11 | context 'with no parameters' do 12 | let(:title) { 'fastestmirror' } 13 | 14 | it { is_expected.to compile.with_all_deps } 15 | it { is_expected.to contain_package("#{prefix}-#{title}").with_ensure('present') } 16 | end 17 | 18 | context 'when explicitly set to install' do 19 | let(:title) { 'fastestmirror' } 20 | let(:params) { { ensure: 'present' } } 21 | 22 | it { is_expected.to compile.with_all_deps } 23 | it { is_expected.to contain_package("#{prefix}-#{title}").with_ensure('present') } 24 | end 25 | 26 | context 'when explicitly set to remove' do 27 | let(:title) { 'fastestmirror' } 28 | let(:params) { { ensure: 'absent' } } 29 | 30 | it { is_expected.to compile.with_all_deps } 31 | it { is_expected.to contain_package("#{prefix}-#{title}").with_ensure('absent') } 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /spec/defines/post_transaction_action_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::post_transaction_action' do 6 | let(:title) { 'an entry' } 7 | 8 | on_supported_os.each do |os, os_facts| 9 | context "on #{os}" do 10 | let(:facts) do 11 | os_facts 12 | end 13 | 14 | context 'with_package_provider unset' do 15 | let(:params) do 16 | { 17 | key: 'openssh', 18 | state: 'any', 19 | command: 'foo bar', 20 | } 21 | end 22 | 23 | it { is_expected.to compile.with_all_deps } 24 | end 25 | 26 | %w[yum dnf].each do |provider| 27 | context "with package_provider #{provider}" do 28 | let(:facts) do 29 | super().merge(package_provider: provider) 30 | end 31 | 32 | context 'with simple package name and state any' do 33 | let(:params) do 34 | { 35 | key: 'openssh', 36 | state: 'any', 37 | command: 'foo bar', 38 | } 39 | end 40 | 41 | it { is_expected.to compile.with_all_deps } 42 | it { is_expected.to contain_class('yum::plugin::post_transaction_actions') } 43 | it { is_expected.to contain_concat__fragment('post_trans_an entry').with_content(%r{^# Action name: an entry$}) } 44 | 45 | it { 46 | is_expected.to contain_concat__fragment('post_trans_an entry').with( 47 | { 48 | target: 'puppet_actions', 49 | order: '10', 50 | content: %r{^openssh:any:foo bar$}, 51 | } 52 | ) 53 | } 54 | 55 | context 'with post_transaction_actions disabled' do 56 | let(:pre_condition) { 'class{"yum::plugin::post_transaction_actions": ensure => "absent"}' } 57 | 58 | it { is_expected.to compile.with_all_deps } 59 | it { is_expected.to contain_class('yum::plugin::post_transaction_actions') } 60 | it { is_expected.not_to contain_concat__fragment('post_trans_an entry') } 61 | end 62 | end 63 | 64 | context 'with package name glob and state any' do 65 | let(:params) do 66 | { 67 | key: 'openssh-*', 68 | state: 'any', 69 | command: 'foo bar', 70 | } 71 | end 72 | 73 | it { is_expected.to contain_concat__fragment('post_trans_an entry').with_content(%r{^openssh-\*:any:foo bar$}) } 74 | end 75 | 76 | context 'with file name path and state any' do 77 | let(:params) do 78 | { 79 | key: '/etc/passwd', 80 | state: 'any', 81 | command: 'foo bar', 82 | } 83 | end 84 | 85 | it { is_expected.to contain_concat__fragment('post_trans_an entry').with_content(%r{^/etc/passwd:any:foo bar$}) } 86 | end 87 | 88 | context 'with file name glob and state any' do 89 | let(:params) do 90 | { 91 | key: '/etc/*', 92 | state: 'any', 93 | command: 'foo bar', 94 | } 95 | end 96 | 97 | it { is_expected.to contain_concat__fragment('post_trans_an entry').with_content(%r{^/etc/\*:any:foo bar$}) } 98 | end 99 | 100 | context 'with simple package name and state in (dnf only option)' do 101 | let(:params) do 102 | { 103 | key: 'openssh', 104 | state: 'in', 105 | command: 'foo bar', 106 | } 107 | end 108 | 109 | case provider 110 | when 'yum' 111 | it { is_expected.to raise_error(%r{The state parameter on}) } 112 | else 113 | it { is_expected.to contain_concat__fragment('post_trans_an entry').with_content(%r{^openssh:in:foo bar$}) } 114 | end 115 | end 116 | 117 | context 'with simple package name and state install (yum only option)' do 118 | let(:params) do 119 | { 120 | key: 'openssh', 121 | state: 'install', 122 | command: 'foo bar', 123 | } 124 | end 125 | 126 | case provider 127 | when 'yum' 128 | it { is_expected.to contain_concat__fragment('post_trans_an entry').with_content(%r{^openssh:install:foo bar$}) } 129 | else 130 | it { is_expected.to raise_error(%r{The state parameter on}) } 131 | end 132 | end 133 | end 134 | end 135 | end 136 | end 137 | end 138 | -------------------------------------------------------------------------------- /spec/defines/versionlock_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::versionlock' do 6 | context 'with package_provider set to yum' do 7 | let(:facts) do 8 | { os: { release: { major: 7 } }, 9 | package_provider: 'yum' } 10 | end 11 | 12 | context 'with a simple, well-formed title 0:bash-4.1.2-9.el6_2.x86_64' do 13 | let(:title) { '0:bash-4.1.2-9.el6_2.x86_64' } 14 | 15 | context 'and no parameters' do 16 | it { is_expected.to compile.with_all_deps } 17 | it { is_expected.to contain_concat__fragment('versionlock_header').with_content("# File managed by puppet\n") } 18 | 19 | it 'contains a well-formed Concat::Fragment' do 20 | is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("#{title}\n") 21 | end 22 | 23 | it { is_expected.to contain_concat('/etc/yum/pluginconf.d/versionlock.list').without_notify } 24 | end 25 | 26 | context 'clean set to true on module' do 27 | let :pre_condition do 28 | 'class { "yum::plugin::versionlock": clean => true, }' 29 | end 30 | 31 | it { is_expected.to contain_concat('/etc/yum/pluginconf.d/versionlock.list').with_notify('Exec[yum_clean_all]') } 32 | it { is_expected.to contain_exec('yum_clean_all').with_command('/usr/bin/yum clean all') } 33 | end 34 | 35 | context 'and ensure set to present' do 36 | let(:params) { { ensure: 'present' } } 37 | 38 | it { is_expected.to compile.with_all_deps } 39 | it { is_expected.to contain_concat__fragment('versionlock_header').with_content("# File managed by puppet\n") } 40 | 41 | it 'contains a well-formed Concat::Fragment' do 42 | is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("#{title}\n") 43 | end 44 | end 45 | 46 | context 'and ensure set to absent' do 47 | let(:params) { { ensure: 'absent' } } 48 | 49 | it { is_expected.to compile.with_all_deps } 50 | it { is_expected.to contain_concat__fragment('versionlock_header').with_content("# File managed by puppet\n") } 51 | 52 | it 'contains a well-formed Concat::Fragment' do 53 | is_expected.not_to contain_concat__fragment("yum-versionlock-#{title}") 54 | end 55 | end 56 | 57 | context 'with version set namevar must be just a package name' do 58 | let(:params) { { version: '4.3' } } 59 | 60 | it { is_expected.to compile.and_raise_error(%r{Package name must be formatted as Yum::RpmName, not 'String'}) } 61 | end 62 | end 63 | 64 | context 'with a trailing wildcard title' do 65 | let(:title) { '0:bash-4.1.2-9.el6_2.*' } 66 | 67 | it { is_expected.to compile.with_all_deps } 68 | 69 | it 'contains a well-formed Concat::Fragment' do 70 | is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("#{title}\n") 71 | end 72 | end 73 | 74 | context 'with a complex wildcard title' do 75 | let(:title) { '0:bash-4.*-*.el6' } 76 | 77 | it 'contains a well-formed Concat::Fragment' do 78 | is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("#{title}\n") 79 | end 80 | end 81 | 82 | context 'with a release containing dots' do 83 | let(:title) { '1:java-1.7.0-openjdk-1.7.0.121-2.6.8.0.el7_3.x86_64' } 84 | 85 | it 'contains a well-formed Concat::Fragment' do 86 | is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("#{title}\n") 87 | end 88 | end 89 | 90 | context 'with an invalid title' do 91 | let(:title) { 'bash-4.1.2' } 92 | 93 | it { is_expected.to compile.and_raise_error(%r(%\{EPOCH\}:%\{NAME\}-%\{VERSION\}-%\{RELEASE\}\.%\{ARCH\})) } 94 | end 95 | 96 | context 'with an invalid wildcard pattern' do 97 | let(:title) { '0:bash-4.1.2*' } 98 | 99 | it { is_expected.to compile.and_raise_error(%r(%\{EPOCH\}:%\{NAME\}-%\{VERSION\}-%\{RELEASE\}\.%\{ARCH\})) } 100 | end 101 | end 102 | 103 | context 'with a simple, well-formed package name title bash and a version' do 104 | let(:facts) do 105 | { os: { release: { major: 7 } }, 106 | package_provider: 'yum' } 107 | end 108 | 109 | let(:title) { 'bash' } 110 | let(:params) { { version: '4.3' } } 111 | 112 | context 'with version set' do 113 | it { is_expected.to compile.with_all_deps } 114 | 115 | it 'contains a well-formed Concat::Fragment' do 116 | is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("0:bash-4.3-*.*\n") 117 | end 118 | end 119 | 120 | context 'with version, release, epoch and arch set' do 121 | let(:params) do 122 | { 123 | version: '4.3', 124 | release: '3.2', 125 | arch: 'arm', 126 | epoch: 42 127 | } 128 | end 129 | 130 | context 'it works' do 131 | it { is_expected.to compile.with_all_deps } 132 | 133 | it 'contains a well-formed Concat::Fragment' do 134 | is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("42:bash-4.3-3.2.arm\n") 135 | end 136 | end 137 | end 138 | end 139 | 140 | context 'with package_provider set to dnf' do 141 | let(:facts) do 142 | { os: { release: { major: 8 } }, 143 | package_provider: 'dnf' } 144 | end 145 | 146 | context 'with a simple, well-formed title, no version set' do 147 | let(:title) { 'bash' } 148 | 149 | it { is_expected.to compile.and_raise_error(%r{Version must be formatted as Yum::RpmVersion}) } 150 | 151 | context 'and a version set to 4.3' do 152 | let(:params) { { version: '4.3' } } 153 | 154 | it 'contains a well-formed Concat::Fragment' do 155 | is_expected.to contain_concat__fragment('yum-versionlock-bash').with_content("bash-0:4.3-*.*\n") 156 | end 157 | 158 | context 'and an arch set to x86_64' do 159 | let(:params) { super().merge(arch: 'x86_64') } 160 | 161 | it 'contains a well-formed Concat::Fragment' do 162 | is_expected.to contain_concat__fragment('yum-versionlock-bash').with_content("bash-0:4.3-*.x86_64\n") 163 | end 164 | end 165 | 166 | context 'and an release set to 22.x' do 167 | let(:params) { super().merge(release: '22.5') } 168 | 169 | it 'contains a well-formed Concat::Fragment' do 170 | is_expected.to contain_concat__fragment('yum-versionlock-bash').with_content("bash-0:4.3-22.5.*\n") 171 | end 172 | end 173 | 174 | context 'and an epoch set to 5' do 175 | let(:params) { super().merge(epoch: 5) } 176 | 177 | it 'contains a well-formed Concat::Fragment' do 178 | is_expected.to contain_concat__fragment('yum-versionlock-bash').with_content("bash-5:4.3-*.*\n") 179 | end 180 | end 181 | end 182 | 183 | context 'with release, version, epoch, arch all set' do 184 | let(:params) do 185 | { 186 | version: '22.5', 187 | release: 'alpha12', 188 | epoch: 8, 189 | arch: 'i386' 190 | } 191 | end 192 | 193 | it 'contains a well-formed Concat::Fragment' do 194 | is_expected.to contain_concat__fragment('yum-versionlock-bash').with_content("bash-8:22.5-alpha12.i386\n") 195 | end 196 | end 197 | end 198 | end 199 | 200 | context 'with package_provider unset' do 201 | let(:facts) do 202 | { os: { release: { major: 7 } } } 203 | end 204 | let(:title) { 'bash' } 205 | let(:params) { { version: '4.3' } } 206 | 207 | it { is_expected.to compile.with_all_deps } 208 | 209 | it 'contains a well-formed Concat::Fragment' do 210 | is_expected.to contain_concat__fragment('yum-versionlock-bash').with_content("bash-0:4.3-*.*\n") 211 | end 212 | end 213 | end 214 | -------------------------------------------------------------------------------- /spec/functions/bool2num_hash_recursive_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum::bool2num_hash_recursive' do 6 | let(:flat_hash) { { 'a' => true, 'b' => false, 'c' => 'c' } } 7 | let(:nested_hash) do 8 | { 9 | 'a' => { 10 | 'aa' => true, 'ab' => false, 'ac' => 'c', 11 | 'aaa' => true, 'aab' => false, 'aac' => 'c' 12 | }, 13 | 'b' => { 'ba' => true, 'bb' => false, 'bc' => 'c' }, 14 | 'c' => true, 15 | 'd' => false, 16 | 'e' => 5 17 | } 18 | end 19 | 20 | it 'appropriately modifies a simple, flat hash' do 21 | is_expected.to run.with_params(flat_hash).and_return('a' => 1, 'b' => 0, 'c' => 'c') 22 | end 23 | 24 | it 'appropriately modifies a nested hash' do 25 | is_expected.to run.with_params(nested_hash). 26 | and_return( 27 | 'a' => { 28 | 'aa' => 1, 'ab' => 0, 'ac' => 'c', 29 | 'aaa' => 1, 'aab' => 0, 'aac' => 'c' 30 | }, 31 | 'b' => { 'ba' => 1, 'bb' => 0, 'bc' => 'c' }, 32 | 'c' => 1, 33 | 'd' => 0, 34 | 'e' => 5 35 | ) 36 | end 37 | 38 | it 'fails on an array' do 39 | is_expected.to run.with_params([true, false]).and_raise_error(Puppet::Error) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Managed by modulesync - DO NOT EDIT 4 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 5 | 6 | # puppetlabs_spec_helper will set up coverage if the env variable is set. 7 | # We want to do this if lib exists and it hasn't been explicitly set. 8 | ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__)) 9 | 10 | require 'voxpupuli/test/spec_helper' 11 | 12 | RSpec.configure do |c| 13 | c.facterdb_string_keys = false 14 | end 15 | 16 | add_mocked_facts! 17 | 18 | if File.exist?(File.join(__dir__, 'default_module_facts.yml')) 19 | facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) 20 | facts&.each do |name, value| 21 | add_custom_fact name.to_sym, value 22 | end 23 | end 24 | Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f } 25 | -------------------------------------------------------------------------------- /spec/spec_helper_acceptance.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Managed by modulesync - DO NOT EDIT 4 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ 5 | 6 | require 'voxpupuli/acceptance/spec_helper_acceptance' 7 | 8 | configure_beaker(modules: :metadata) 9 | 10 | Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f } 11 | -------------------------------------------------------------------------------- /spec/type_aliases/yum_rpmarch_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'Yum::Rpmarch' do 6 | it { is_expected.to allow_value('x86_64') } 7 | it { is_expected.to allow_value('aarch64') } 8 | it { is_expected.to allow_value('noarch') } 9 | it { is_expected.not_to allow_values('quantum') } 10 | end 11 | -------------------------------------------------------------------------------- /spec/type_aliases/yum_rpmname_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'Yum::Rpmname' do 6 | it { is_expected.to allow_value('python36-foobar') } 7 | # confirmed that Name: puppet:agent is not permitted 8 | # rpmbuild -bs ~/rpmbuild/SPECS/puppet\:agent.spec 9 | # error: line 28: Illegal char ':' (0x3a) in: Name: puppet:agent 10 | it { is_expected.not_to allow_values('puppet:agent') } 11 | end 12 | -------------------------------------------------------------------------------- /spec/type_aliases/yum_rpmnameglob_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'Yum::RpmnameGlob' do 6 | it { is_expected.to allow_value('python36-foobar') } 7 | it { is_expected.to allow_value('openssh-*') } 8 | it { is_expected.to allow_value('*-client') } 9 | # confirmed that Name: puppet:agent is not permitted 10 | # rpmbuild -bs ~/rpmbuild/SPECS/puppet\:agent.spec 11 | # error: line 28: Illegal char ':' (0x3a) in: Name: puppet:agent 12 | it { is_expected.not_to allow_values('puppet:agent*') } 13 | end 14 | -------------------------------------------------------------------------------- /spec/type_aliases/yum_rpmrelease_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'Yum::Rpmrelease' do 6 | it { is_expected.to allow_value('3.2') } 7 | it { is_expected.to allow_value('3.2alpha23') } 8 | it { is_expected.to allow_value('3.2_alpha23') } 9 | it { is_expected.to allow_value('3.2.el8') } 10 | it { is_expected.to allow_value('3.2.el8_5') } 11 | it { is_expected.not_to allow_values('4-3') } 12 | it { is_expected.not_to allow_values('-3') } 13 | it { is_expected.not_to allow_values('3-') } 14 | end 15 | -------------------------------------------------------------------------------- /spec/type_aliases/yum_rpmversion_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'Yum::Rpmversion' do 6 | it { is_expected.to allow_value('3.2') } 7 | it { is_expected.to allow_value('3.2alpha23') } 8 | it { is_expected.to allow_value('3.2_alpha23') } 9 | it { is_expected.not_to allow_values('4-3') } 10 | it { is_expected.not_to allow_values('-3') } 11 | it { is_expected.not_to allow_values('3-') } 12 | end 13 | -------------------------------------------------------------------------------- /spec/unit/facter/yum_package_updates_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | describe 'yum_package_updates fact' do 6 | subject { Facter.fact(:yum_package_updates).value } 7 | 8 | after { Facter.clear } 9 | 10 | describe 'on non-Redhat distro' do 11 | before do 12 | allow(Facter.fact('os.family')).to receive(:value).and_return('Debian') 13 | end 14 | 15 | it { is_expected.to be_nil } 16 | end 17 | 18 | describe 'on Redhat distro' do 19 | before do 20 | allow(Facter.fact('os.family')).to receive(:value).and_return('Redhat') 21 | allow(File).to receive(:executable?) # Stub all other calls 22 | allow(File).to receive(:executable?).with('/usr/bin/yum').and_return(true) 23 | allow(Facter::Util::Resolution).to receive(:exec).with('/usr/bin/yum --assumeyes --quiet --cacheonly list updates').and_return(yum_list_updates_result) 24 | end 25 | 26 | context 'when no updates are available' do 27 | let(:yum_list_updates_result) { '' } 28 | 29 | it { is_expected.to eq([]) } 30 | end 31 | 32 | context 'when updates are available' do 33 | let(:yum_list_updates_result) do 34 | # rubocop:disable Layout/TrailingWhitespace 35 | <<~END 36 | Updated Packages 37 | ca-certificates.noarch 2020.2.41-70.0.el7_8 updates 38 | gitlab-ce.x86_64 13.1.1-ce.0.el7 gitlab_official_ce 39 | grafana.x86_64 7.0.4-1 grafana-stable 40 | kernel.x86_64 3.10.0-1127.13.1.el7 updates 41 | kernel-headers.x86_64 3.10.0-1127.13.1.el7 updates 42 | net-snmp-libs.x86_64 1:5.7.2-48.el7_8.1 updates 43 | ntp.x86_64 4.2.6p5-29.el7.centos.2 updates 44 | ntpdate.x86_64 4.2.6p5-29.el7.centos.2 updates 45 | passenger.x86_64 6.0.5-1.el7 passenger 46 | python-perf.x86_64 3.10.0-1127.13.1.el7 updates 47 | unbound.x86_64 1.6.6-5.el7_8 updates 48 | unbound-libs.x86_64 1.6.6-5.el7_8 updates 49 | END 50 | # rubocop:enable Layout/TrailingWhitespace 51 | end 52 | 53 | it do 54 | is_expected.to eq(%w[ca-certificates.noarch gitlab-ce.x86_64 55 | grafana.x86_64 kernel.x86_64 kernel-headers.x86_64 56 | net-snmp-libs.x86_64 ntp.x86_64 ntpdate.x86_64 57 | passenger.x86_64 python-perf.x86_64 unbound.x86_64 58 | unbound-libs.x86_64]) 59 | end 60 | end 61 | 62 | context 'when diagnostic messages are emitted' do 63 | let(:yum_list_updates_result) do 64 | <<~END 65 | https://oss-binaries.phusionpassenger.com/yum/passenger/el/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for passenger 66 | Trying other mirror. 67 | Updated Packages 68 | ca-certificates.noarch 2020.2.41-70.0.el7_8 updates 69 | END 70 | end 71 | 72 | it { is_expected.to eq(%w[ca-certificates.noarch]) } 73 | end 74 | 75 | context 'when plugins emit output' do 76 | let(:yum_list_updates_result) do 77 | <<~END 78 | Loaded plugins: auto-update-debuginfo, priorities, product-id, subscription- 79 | : manager, versionlock 80 | ca-certificates.noarch 2020.2.41-70.0.el7_8 updates 81 | END 82 | end 83 | 84 | it { is_expected.to eq(%w[ca-certificates.noarch]) } 85 | end 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/dnf_module_stream/dnf_module_stream_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | RSpec.describe 'the dnf_module_stream provider' do 6 | it 'loads' do 7 | expect(Puppet::Type.type(:dnf_module_stream).provide(:dnf_module_stream)).not_to be_nil 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/dnf_module_stream_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'spec_helper' 4 | 5 | dnf_module_stream = Puppet::Type.type(:dnf_module_stream) 6 | RSpec.describe 'the dnf_module_stream type' do 7 | it 'loads' do 8 | expect(dnf_module_stream).not_to be_nil 9 | end 10 | 11 | it 'has parameter module' do 12 | expect(dnf_module_stream.parameters).to be_include(:module) 13 | end 14 | 15 | it 'has property stream' do 16 | expect(dnf_module_stream.properties.map(&:name)).to be_include(:stream) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /tasks/init.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Allows you to perform yum functions", 3 | "input_method": "stdin", 4 | "parameters": { 5 | "action": { 6 | "description": "Action to perform ", 7 | "type": "Enum[update, upgrade, 'list updates']" 8 | }, 9 | "quiet": { 10 | "description": "Run without output ", 11 | "type": "Optional[Boolean]" 12 | } 13 | }, 14 | "implementations": [ 15 | { 16 | "name": "init.rb", 17 | "requirements": ["puppet-agent"] 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tasks/init.rb: -------------------------------------------------------------------------------- 1 | #!/opt/puppetlabs/puppet/bin/ruby 2 | # frozen_string_literal: true 3 | 4 | require 'json' 5 | require 'open3' 6 | require 'puppet' 7 | 8 | def yum(action, quiet) 9 | cmd = ['yum', '-y'] 10 | cmd << '-q' unless quiet == false || quiet.nil? 11 | cmd += action.split(%r{\s+}) 12 | 13 | stdout, stderr, status = Open3.capture3(*cmd) 14 | raise Puppet::Error, stderr unless status.success? 15 | 16 | { status: stdout.strip } 17 | end 18 | 19 | def process_list_updates(output) 20 | status = output[:status].lines[1..] 21 | status ||= [] 22 | 23 | result = status.map do |line| 24 | package, available_version, repository = line.split(%r{\s+}) 25 | { 26 | package: package, 27 | available_version: available_version, 28 | repository: repository 29 | } 30 | end 31 | 32 | { status: result } 33 | end 34 | 35 | params = JSON.parse($stdin.read) 36 | action = params['action'] 37 | quiet = params['quiet'] 38 | 39 | begin 40 | result = yum(action, quiet) 41 | result = process_list_updates(result) if action == 'list updates' 42 | puts result.to_json 43 | exit 0 44 | rescue Puppet::Error => e 45 | puts({ status: 'failure', error: e.message }.to_json) 46 | exit 1 47 | end 48 | -------------------------------------------------------------------------------- /types/rpmarch.pp: -------------------------------------------------------------------------------- 1 | # @summary Valid rpm architectures. 2 | # Output of `rpm -q --queryformat '%{arch}\n' package` 3 | # @see https://github.com/rpm-software-management/rpm/blob/master/rpmrc.in 4 | type Yum::RpmArch = Enum[ 5 | 'noarch', 6 | 'x86_64', 7 | 'i386', 8 | 'aarch64', 9 | 'arm', 10 | 'ppc64', 11 | 'ppc64le', 12 | 'sparc64', 13 | 'ia64', 14 | 'alpha', 15 | 'ip', 16 | 'm68k', 17 | 'mips', 18 | 'mipsel', 19 | 'mk68k', 20 | 'mint', 21 | 'ppc', 22 | 'rs6000', 23 | 's390', 24 | 's390x', 25 | 'sh', 26 | 'sparc', 27 | 'xtensa', 28 | ] 29 | -------------------------------------------------------------------------------- /types/rpmname.pp: -------------------------------------------------------------------------------- 1 | # @summary Valid rpm name. 2 | # Can be alphanumeric or contain `.` `_` `+` `%` `{` `}` `-`. 3 | # Output of `rpm -q --queryformat '%{name}\n package` 4 | # Examples python36-foobar, netscape 5 | type Yum::RpmName = Pattern[/\A([0-9a-zA-Z\._\+%\{\}-]+)\z/] 6 | -------------------------------------------------------------------------------- /types/rpmnameglob.pp: -------------------------------------------------------------------------------- 1 | # @summary Valid rpm name with globs. 2 | # Can be alphanumeric or contain `.` `_` `+` `%` `{` `}` `-` `*`. 3 | # Examples python36-*, *netscape 4 | type Yum::RpmNameGlob = Pattern[/\A([*0-9a-zA-Z\._\+%\{\}-]+)\z/] 5 | -------------------------------------------------------------------------------- /types/rpmrelease.pp: -------------------------------------------------------------------------------- 1 | # @summary Valid rpm release fields. 2 | # It may not contain a dash. 3 | # Output of `rpm -q --queryformat '%{release}\n' package`. 4 | # Examples 3.4 3.4.el6, 3.4.el6_2 5 | # @see http://ftp.rpm.org/max-rpm/ch-rpm-file-format.html 6 | type Yum::RpmRelease = Pattern[/\A([^-]+)\z/] 7 | -------------------------------------------------------------------------------- /types/rpmversion.pp: -------------------------------------------------------------------------------- 1 | # @summary Valid rpm version fields. 2 | # It may not contain a dash. 3 | # Output of `rpm -q --queryformat '%{version}\n' package`. 4 | # Examples 3.4, 2.5.alpha6 5 | # @see http://ftp.rpm.org/max-rpm/ch-rpm-file-format.html 6 | type Yum::RpmVersion = Pattern[/\A([^-]+)\z/] 7 | -------------------------------------------------------------------------------- /types/versionlockstring.pp: -------------------------------------------------------------------------------- 1 | # This type matches strings appropriate for use with yum-versionlock. 2 | # Its basic format, using the `rpm(8)` query string format, is 3 | # `%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}`. As a Regex, it 4 | # breaks down into five distinct parts, plus the seperators. 5 | # 6 | # EPOCH: An unsigned integer 7 | # type Yum::PackageEpoch = Regexp[/[0-9]\*]+/] 8 | # 9 | # NAME: Any valid package name (see https://github.com/rpm-software-management/rpm/blob/master/doc/manual/spec) 10 | # type Yum::PackageName = Regexp[/[0-9a-zA-Z\._\+%\{\}\*-]+/] 11 | # 12 | # VERSION: Any valid version string. The only limitation here, according to the RPM manual, is that it may not contain a dash (`-`). 13 | # type Yum::PackageVersion = Regexp[/[^-]+/] 14 | # 15 | # RELEASE: Any valid release string. Only limitation is that it is not a dash (`-`) 16 | # type Yum::PackageRelease = Regexp[/[^-]+/] 17 | # 18 | # lint:ignore:140chars 19 | # ARCH: Matches a string such as `el7.x86_64`. This is actuall two sub-expressions. See below. 20 | # type Yum::PackageArch = Regexp[/([0-9a-zZ-Z_\*]+)(?:\.(noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa|\*))?/] 21 | # lint:endignore 22 | # 23 | # The `%{ARCH}` sub-expression is composed of two sub-expressions 24 | # separated by a dot (`.`), where the second part is optional. The RPM 25 | # specification calls the first field the `DistTag`, and the second the 26 | # `BuildArch`. 27 | # 28 | # DistTag: Any string consiting of only letters, numbers, or an underscore, e.g., `el6`, `sl7`, or `fc24`. 29 | # type Yum::PackageDistTag = Regexp[/[0-9a-zZ-Z_\*]+/] 30 | # 31 | # lint:ignore:140chars 32 | # BuildArch: Any string from the list at https://github.com/rpm-software-management/rpm/blob/master/rpmrc.in. Strings are roughly listed from most common to least common to improve performance. 33 | # type Yum::PackageBuildArch = Regexp[/noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa/] 34 | # lint:endignore 35 | # 36 | # @note Each field may contain wildcard characters (`*`), but the 37 | # wildcard characters may not span the fields, may not cover the 38 | # seperators. This is an undocumented but tested limitation of 39 | # yum-versionlock. 40 | # 41 | # @example A complete, well-formed string: `0:bash-4.1.2-9.el6_2.x86_64' 42 | # @example A well-formed string that has dropped the optional BuildArch sub-field: `0:bash-4.1.2-9.el6_2` 43 | # @example A well-formed string using wildcards: `*0:bash*-4.*-*.*` 44 | # @example An invalid string (wildcard spans the VERSION and RELEASE fields): `0:bash-4.*-el6.x86_64 45 | # @example An invlaid string (wildcard spans the VERSION, RELEASE, and ARCH fields): `0:bash-*` 46 | # 47 | # lint:ignore:140chars 48 | type Yum::VersionlockString = Pattern[/^([0-9\*]+):([0-9a-zA-Z\._\+%\{\}\*-]+)-([^-]+)-([^-]+)\.(([0-9a-zZ-Z_\*]+)(?:\.(noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa|\*))?)$/] 49 | # lint:endignore 50 | --------------------------------------------------------------------------------