├── .gitignore ├── .gitreview ├── .pdkignore ├── .zuul.yaml ├── CHANGELOG.md ├── CONTRIBUTING.rst ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── bindep.txt ├── doc └── requirements.txt ├── examples └── redhat_repo.yaml ├── files ├── RPM-GPG-KEY-CentOS-SIG-Cloud ├── RPM-GPG-KEY-CentOS-SIG-Virtualization ├── RPM-GPG-KEY-EPEL-6 └── RPM-GPG-KEY-EPEL-7 ├── lib └── puppet │ └── functions │ └── validate_yum_hash.rb ├── manifests ├── auth_file.pp └── repo │ ├── debian │ ├── debian.pp │ └── ubuntu.pp │ └── redhat │ └── redhat.pp ├── metadata.json ├── releasenotes ├── notes │ ├── add-redhat-repo-stream-param-e07601e273aad56c.yaml │ ├── add_centos_mirror-079eb2b38940f583.yaml │ ├── allow_change_uca_url-b855c119a693b583.yaml │ ├── bug-1969484-6e4864f8bcc56230.yaml │ ├── bug-1978332-8b223e30a7f30165.yaml │ ├── centos-9-support-ee1fc77ac7ac450c.yaml │ ├── debian-repo-updates-4aee254ef80e8dd7.yaml │ ├── debian-uses-extrepo-a77c672920581e4e.yaml │ ├── deprecate-manage_epel-056acc6686886a4a.yaml │ ├── deprecate-pacemaker-service-b34268f01b39d676.yaml │ ├── deprecate-redhat-repo-manage-prio-429e39966b3f6f57.yaml │ ├── deprecate-tenant_name-d8feb61192e129f7.yaml │ ├── disable_epel-a07b06048465e7a1.yaml │ ├── mitaka_features-6358feed90cd0b0b.yaml │ ├── mitaka_upgrade-79294b892d21dfc7.yaml │ ├── puppet-8-0a5de2c5ecbc6a35.yaml │ ├── rdo-virt-a9fb3681cbc8419e.yaml │ ├── redhat-repo-cleanup-antelope-ca46c38bbf3ee957.yaml │ ├── release-note-ubuntu-py3-3fea08087d957b35.yaml │ ├── remove-domain_name-2a9dee69a7334eab.yaml │ ├── remove-openrc-tenant_name-b3c39a6b1a758f05.yaml │ ├── remove-pacemaker-service-d1903561dea90fef.yaml │ ├── remove-puppet-6-1feddecc3d99d0b1.yaml │ ├── rename-to-domain_name-d7bc8a7b44c619c8.yaml │ ├── repo-debian-remove-manage_whz-73b1326b754dfe30.yaml │ ├── repo-redhat-deprecate-manage_virt-4a29a4b85390b4fc.yaml │ ├── repo-redhat-deprecate-stream-04b111eabe5d5df3.yaml │ ├── repo-redhat-remove-manage_priorities-019ec005d1f98c46.yaml │ ├── repo-redhat-replace-9d475450f304ad94.yaml │ ├── repo-redhat-repofile-bfafdae3f8b158b2.yaml │ ├── repo-redhat-update_packages-d52c3fe93e97ac76.yaml │ ├── set-module-hotfixes-redhat-repo-e03358eb341bf820.yaml │ ├── ubuntu-jammy-fc64f281863a8de3.yaml │ ├── ubuntu-noble-f3fe04c4d190ed70.yaml │ ├── use-reno-1caaec4ba5aa4285.yaml │ └── yum-update-timeout-c68438aab2477331.yaml └── source │ ├── 2023.1.rst │ ├── 2023.2.rst │ ├── 2024.1.rst │ ├── 2024.2.rst │ ├── 2025.1.rst │ ├── _static │ └── .placeholder │ ├── conf.py │ ├── index.rst │ ├── mitaka.rst │ ├── newton.rst │ ├── ocata.rst │ ├── pike.rst │ ├── queens.rst │ ├── rocky.rst │ ├── stein.rst │ ├── train.rst │ ├── unreleased.rst │ ├── ussuri.rst │ ├── victoria.rst │ ├── wallaby.rst │ ├── xena.rst │ ├── yoga.rst │ └── zed.rst ├── setup.cfg ├── setup.py ├── spec ├── acceptance │ ├── openstack_extras_auth_file_spec.rb │ └── openstack_extras_repo_spec.rb ├── classes │ ├── openstack_extras_auth_file_spec.rb │ ├── openstack_extras_repo_debian_debian_spec.rb │ ├── openstack_extras_repo_debian_ubuntu_spec.rb │ └── openstack_extras_repo_redhat_redhat_spec.rb ├── functions │ └── validate_yum_hash_spec.rb ├── shared_examples.rb ├── spec_helper.rb └── spec_helper_acceptance.rb ├── templates └── openrc.erb └── tox.ini /.gitignore: -------------------------------------------------------------------------------- 1 | # Add patterns in here to exclude files created by tools integrated with this 2 | # repository, such as test frameworks from the project's recommended workflow, 3 | # rendered documentation and package builds. 4 | # 5 | # Don't add patterns to exclude files created by preferred personal tools 6 | # (editors, IDEs, your operating system itself even). These should instead be 7 | # maintained outside the repository, for example in a ~/.gitignore file added 8 | # with: 9 | # 10 | # git config --global core.excludesfile '~/.gitignore' 11 | 12 | pkg/ 13 | Gemfile.lock 14 | vendor/ 15 | spec/fixtures/ 16 | .vagrant/ 17 | .bundle/ 18 | coverage/ 19 | .idea/ 20 | *.iml 21 | /openstack 22 | /log 23 | 24 | # Files created by releasenotes build 25 | releasenotes/build 26 | .tox 27 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=review.opendev.org 3 | port=29418 4 | project=openstack/puppet-openstack_extras.git 5 | -------------------------------------------------------------------------------- /.pdkignore: -------------------------------------------------------------------------------- 1 | # common list used in puppetlabs repos 2 | .git/ 3 | .*.sw[op] 4 | .metadata 5 | .yardoc 6 | .yardwarns 7 | *.iml 8 | /.bundle/ 9 | /.idea/ 10 | /.vagrant/ 11 | /coverage/ 12 | /bin/ 13 | /doc/ 14 | /Gemfile.local 15 | /Gemfile.lock 16 | /junit/ 17 | /log/ 18 | /pkg/ 19 | /spec/fixtures/manifests/ 20 | /spec/fixtures/modules/* 21 | /tmp/ 22 | /vendor/ 23 | /convert_report.txt 24 | /update_report.txt 25 | .DS_Store 26 | .project 27 | .envrc 28 | /inventory.yaml 29 | /spec/fixtures/litmus_inventory.yaml 30 | /.fixtures.yml 31 | /Gemfile 32 | /.gitattributes 33 | /.gitignore 34 | /.pdkignore 35 | /.puppet-lint.rc 36 | /Rakefile 37 | /rakelib/ 38 | /.rspec 39 | /..yml 40 | /.yardopts 41 | /spec/ 42 | /.vscode/ 43 | /.sync.yml 44 | /.devcontainer/ 45 | # OpenStack-specific files 46 | /bindep.txt 47 | /.gitreview 48 | /releasenotes/ 49 | /setup.cfg 50 | /setup.py 51 | /tox.ini 52 | /.zuul.yaml 53 | -------------------------------------------------------------------------------- /.zuul.yaml: -------------------------------------------------------------------------------- 1 | - project: 2 | templates: 3 | - puppet-openstack-check-jobs 4 | - puppet-openstack-module-unit-jobs 5 | - puppet-openstack-integration-jobs-all 6 | - puppet-openstack-litmus-jobs 7 | - release-notes-jobs-python3 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 8.0.0 and beyond 2 | 3 | From 8.0.0 release and beyond, release notes are published on 4 | [docs.openstack.org](http://docs.openstack.org/releasenotes/puppet-openstack_extras/). 5 | 6 | ##2015-11-24 - 7.0.0 7 | ###Summary 8 | 9 | This is a backwards-incompatible major release for OpenStack Liberty. 10 | 11 | ####Backwards-incompatible changes 12 | - repo: bump to Liberty by default 13 | 14 | ####Features 15 | - repo/ubuntu: allow to change uca repo name 16 | 17 | ####Maintenance 18 | - implement acceptance tests 19 | - try to use zuul-cloner to prepare fixtures 20 | - remove class_parameter_defaults puppet-lint check 21 | - acceptance: use common bits from puppet-openstack-integration 22 | - fix RSpec 3.x syntax 23 | - initial msync run for all Puppet OpenStack modules 24 | 25 | ##2015-07-08 - 6.0.0 26 | ###Summary 27 | 28 | This is a backwards-incompatible major release for OpenStack Kilo. 29 | 30 | ####Backwards-incompatible changes 31 | - repo: bump to Kilo by default 32 | 33 | ####Features 34 | - Puppet 4.x support 35 | - Add hash based repository management 36 | - Add pacemaker provider for HA services 37 | - Add auth file from openstack repo 38 | - Support native OS primitive classes in Pacemaker 39 | - Support cloned resources in Pacemaker 40 | - auth_file: allow to change the path 41 | - repo/redhat: manage EPEL with metalink instead of baseurl 42 | 43 | ####Bugfixes 44 | - Ensure python-mysqldb is installed before MySQL db_sync 45 | - Fix dependency on nova-common package 46 | 47 | ####Maintenance 48 | - repo/apt: update to support apt 2.1.0 module 49 | - Increase major bound on puppetlabs-apt 50 | 51 | ##2014-11-21 - 5.0.0 52 | ###Summary 53 | 54 | Initial release for Juno. 55 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | The source repository for this project can be found at: 2 | 3 | https://opendev.org/openstack/puppet-openstack_extras 4 | 5 | Pull requests submitted through GitHub are not monitored. 6 | 7 | To start contributing to OpenStack, follow the steps in the contribution guide 8 | to set up and use Gerrit: 9 | 10 | https://docs.openstack.org/contributors/code-and-documentation/quick-start.html 11 | 12 | Bugs should be filed on Launchpad: 13 | 14 | https://bugs.launchpad.net/puppet-openstack_extras 15 | 16 | For more specific information about contributing to this repository, see the 17 | Puppet OpenStack contributor guide: 18 | 19 | https://docs.openstack.org/puppet-openstack-guide/latest/contributor/contributing.html 20 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source ENV['GEM_SOURCE'] || "https://rubygems.org" 2 | 3 | group :development, :test, :system_tests do 4 | spec_helper_dir = '/home/zuul/src/opendev.org/openstack/puppet-openstack_spec_helper' 5 | if File.directory?(spec_helper_dir) 6 | if ENV['ZUUL_PROJECT'] == 'openstack/puppet-openstack_spec_helper' 7 | gem 'puppet-openstack_spec_helper', 8 | :path => '../..', 9 | :require => 'false' 10 | else 11 | gem 'puppet-openstack_spec_helper', 12 | :path => spec_helper_dir, 13 | :require => 'false' 14 | end 15 | else 16 | spec_helper_version = ENV['ZUUL_BRANCH'] || "master" 17 | gem 'puppet-openstack_spec_helper', 18 | :git => 'https://opendev.org/openstack/puppet-openstack_spec_helper', 19 | :ref => spec_helper_version, 20 | :require => 'false' 21 | end 22 | end 23 | 24 | if facterversion = ENV['FACTER_GEM_VERSION'] 25 | gem 'facter', facterversion, :require => false 26 | else 27 | gem 'facter', :require => false 28 | end 29 | 30 | if puppetversion = ENV['PUPPET_GEM_VERSION'] 31 | gem 'puppet', puppetversion, :require => false 32 | else 33 | gem 'puppet', :require => false 34 | end 35 | 36 | # vim:ft=ruby 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Team and repository tags 2 | ======================== 3 | 4 | [![Team and repository tags](https://governance.openstack.org/tc/badges/puppet-openstack_extras.svg)](https://governance.openstack.org/tc/reference/tags/index.html) 5 | 6 | 7 | 8 | openstack_extras 9 | ================ 10 | 11 | #### Table of Contents 12 | 13 | 1. [Overview - What is the openstack_extras module?](#overview) 14 | 2. [Module Description - What does the module do?](#module-description) 15 | 3. [Setup - The basics of getting started with openstack_extras](#setup) 16 | 4. [Implementation - An under-the-hood peek at what the module is doing](#implementation) 17 | 5. [Limitations - OS compatibility, etc.](#limitations) 18 | 6. [Development - Guide for contributing to the module](#development) 19 | 7. [Release Notes - Release notes for the project](#release-notes) 20 | 8. [Contributors - Those with commits](#contributors) 21 | 9. [Repository - The project source code repository](#repository) 22 | 23 | Overview 24 | -------- 25 | 26 | The openstack_extras module is a part of [OpenStack](https://opendev.org/openstack), 27 | an effort by the Openstack infrastructure team to provide continuous integration 28 | testing and code review for Openstack and Openstack community projects as part 29 | of the core software. The module itself is used to add useful utilities for 30 | composing and deploying OpenStack with the Openstack puppet modules. 31 | 32 | Module Description 33 | ------------------ 34 | 35 | The openstack_extras module is intended to provide useful utilities to help 36 | with OpenStack deployments, including composition classes, HA utilities, 37 | monitoring functionality, and so on. 38 | 39 | This module combines other modules in order to build and leverage an entire 40 | OpenStack software stack. This module replaces functionality from the 41 | deprecated [stackforge/puppet-openstack module](https://github.com/stackforge/puppet-openstack). 42 | 43 | Setup 44 | ----- 45 | 46 | ### Installing openstack_extras 47 | 48 | puppet module install openstack/openstack_extras 49 | 50 | ### Beginning with openstack_extras 51 | 52 | Instructions for beginning with openstack_extras will be added later. 53 | 54 | Implementation 55 | -------------- 56 | 57 | ### openstack_extras 58 | 59 | openstack_extras is a combination of Puppet manifest and ruby code to delivery 60 | configuration and extra functionality through types and providers. 61 | 62 | Limitations 63 | ----------- 64 | 65 | * Limitations will be added as they are discovered. 66 | 67 | Development 68 | ----------- 69 | 70 | Developer documentation for the entire puppet-openstack project. 71 | 72 | * https://docs.openstack.org/puppet-openstack-guide/latest/ 73 | 74 | Release Notes 75 | ------------- 76 | 77 | * https://docs.openstack.org/releasenotes/puppet-openstack_extras 78 | 79 | Contributors 80 | ------------ 81 | 82 | * https://github.com/openstack/puppet-openstack_extras/graphs/contributors 83 | 84 | Repository 85 | ---------- 86 | 87 | * https://opendev.org/openstack/puppet-openstack_extras 88 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'puppet-openstack_spec_helper/rake_tasks' 2 | -------------------------------------------------------------------------------- /bindep.txt: -------------------------------------------------------------------------------- 1 | # This is a cross-platform list tracking distribution packages needed by tests; 2 | # see https://docs.openstack.org/infra/bindep/ for additional information. 3 | 4 | libxml2-devel [test platform:rpm] 5 | libxml2-dev [test platform:dpkg] 6 | libxslt-devel [test platform:rpm] 7 | libxslt1-dev [test platform:dpkg] 8 | ruby-devel [test platform:rpm] 9 | ruby-dev [test platform:dpkg] 10 | zlib1g-dev [test platform:dpkg] 11 | zlib-devel [test platform:rpm] 12 | puppet [build] 13 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | # This is required for the docs build jobs 2 | sphinx>=3.5.1 # BSD 3 | openstackdocstheme>=2.2.7 # Apache-2.0 4 | 5 | # This is required for the releasenotes build jobs 6 | reno>=3.2.0 # Apache-2.0 7 | -------------------------------------------------------------------------------- /examples/redhat_repo.yaml: -------------------------------------------------------------------------------- 1 | # This is an example of how to define your own repos in hiera 2 | # in addition to RDO when using the redhat repo class 3 | # assuming you have included the class somewhere 4 | # 5 | # This is taken from the aptira hiera data files in 6 | # puppet_openstack_builder and may go out of date. 7 | # 8 | # Set up repositories using openstack_extras 9 | openstack_extras::repo::redhat::redhat::repo_hash: 10 | 'CentOS-Base': 11 | 'descr': 'CentOS-$releasever - Base' 12 | 'baseurl': "%{hiera('yum_base_mirror')}/$releasever/os/$basearch/" 13 | 'CentOS-Updates': 14 | 'descr': 'CentOS-$releasever - Updates' 15 | 'baseurl': "%{hiera('yum_base_mirror')}/$releasever/updates/$basearch/" 16 | 'CentOS-Extras': 17 | 'descr': 'CentOS-$releasever - Extras' 18 | 'baseurl': "%{hiera('yum_base_mirror')}/$releasever/extras/$basearch/" 19 | 'epel': 20 | 'descr': 'Extra Packages for Enterprise Linux 6 - $basearch' 21 | 'baseurl': "%{hiera('yum_epel_mirror')}/$releasever/$basearch/" 22 | 'gpgkey': 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6' 23 | 'failovermethod': 'priority' 24 | 25 | openstack_extras::repo::redhat::redhat::repo_defaults: 26 | 'proxy': "http://%{hiera('proxy_host')}:%{hiera('proxy_port')}" 27 | 28 | openstack_extras::repo::redhat::redhat::gpgkey_hash: 29 | '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6': 30 | 'source': 'puppet:///modules/openstack_extras/RPM-GPG-KEY-EPEL-6' 31 | 32 | openstack_extras::repo::redhat::redhat::purge_unmanaged: true 33 | openstack_extras::repo::redhat::redhat::package_require: true 34 | -------------------------------------------------------------------------------- /files/RPM-GPG-KEY-CentOS-SIG-Cloud: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v2.0.22 (GNU/Linux) 3 | 4 | mQENBFVWcCcBCACfm3eQ0526/I0/p7HpR0NjK7K307XHhnbcbZv1sDUjQABDaqh0 5 | N4gnZcovf+3fj6pcdOmeOpGI0cKE7Fh68RbEIqyjB7l7+j1grjewR0oCFFZ38KGm 6 | j+DWQrj1IJW7JU5fH/G0Cu66ix+dJPcuTB3PJTqXN3ce+4TuG09D+epgwfbHlqaT 7 | pH2qHCu2uiGj/AaRSM/ZZzcInMaeleHSB+NChvaQ0W/m+kK5d/20d7sfkaTfI/pY 8 | SrodCfVTYxfKAd0TLW03kimHs5/Rdz+iZWecVKv6aFxzaywbrOjmOsy2q0kEWIwX 9 | MTZrq6cBRRuWyiXsI2zT2YHQ4UK44IxINiaJABEBAAG0WkNlbnRPUyBDbG91ZCBT 10 | SUcgKGh0dHA6Ly93aWtpLmNlbnRvcy5vcmcvU3BlY2lhbEludGVyZXN0R3JvdXAv 11 | Q2xvdWQpIDxzZWN1cml0eUBjZW50b3Mub3JnPokBOQQTAQIAIwUCVVZwJwIbAwcL 12 | CQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEPm5/ud2RCnmATUH/3HDtWxpFkmy 13 | FiA3VGkMt5dp3bgCRSd84X6Orfx1LARowpI4LomCGglGBGXVJePBacwcclorbLaz 14 | uWrW/wU0efz0aDB5c4NPg/yXfNvujvlda8ADJwZXVBQphzvaIKwl4PqBsEnxC10I 15 | 93T/0iyphAhfMRJ5R8AbEHMj7uF+TWTX/JoyQagllMqWTwoP4DFRutPdOmmjwvSV 16 | kWItH7hq6z9+M4dhlqeoOvPbL5oCxX7TVmLck02Q5gI4syULOa7sqntzUQKFkhWp 17 | 9U0+5KrBQBKezrurrrkq/WZR3WNE1KQfNQ77f7S2JcXJdOaKgJ7xe7Y2flPq98Aq 18 | wKXK7l1c3dc= 19 | =W6yF 20 | -----END PGP PUBLIC KEY BLOCK----- 21 | -------------------------------------------------------------------------------- /files/RPM-GPG-KEY-CentOS-SIG-Virtualization: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v2.0.22 (GNU/Linux) 3 | 4 | mQENBFWB31YBCAC4dFmTzBDOcq4R1RbvQXLkyYfF+yXcsMA5kwZy7kjxnFqBoNPv 5 | aAjFm3e5huTw2BMZW0viLGJrHZGnsXsE5iNmzom2UgCtrvcG2f65OFGlC1HZ3ajA 6 | 8ZIfdgNQkPpor61xqBCLzIsp55A7YuPNDvatk/+MqGdNv8Ug7iVmhQvI0p1bbaZR 7 | 0GuavmC5EZ/+mDlZ2kHIQOUoInHqLJaX7iw46iLRUnvJ1vATOzTnKidoFapjhzIt 8 | i4ZSIRaalyJ4sT+oX4CoRzerNnUtIe2k9Hw6cEu4YKGCO7nnuXjMKz7Nz5GgP2Ou 9 | zIA/fcOmQkSGcn7FoXybWJ8DqBExvkJuDljPABEBAAG0bENlbnRPUyBWaXJ0dWFs 10 | aXphdGlvbiBTSUcgKGh0dHA6Ly93aWtpLmNlbnRvcy5vcmcvU3BlY2lhbEludGVy 11 | ZXN0R3JvdXAvVmlydHVhbGl6YXRpb24pIDxzZWN1cml0eUBjZW50b3Mub3JnPokB 12 | OQQTAQIAIwUCVYHfVgIbAwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEHrr 13 | voJh6IBsRd0H/A62i5CqfftuySOCE95xMxZRw8+voWO84QS9zYvDEnzcEQpNnHyo 14 | FNZTpKOghIDtETWxzpY2ThLixcZOTubT+6hUL1n+cuLDVMu4OVXBPoUkRy56defc 15 | qkWR+UVwQitmlq1ngzwmqVZaB8Hf/mFZiB3B3Jr4dvVgWXRv58jcXFOPb8DdUoAc 16 | S3u/FLvri92lCaXu08p8YSpFOfT5T55kFICeneqETNYS2E3iKLipHFOLh7EWGM5b 17 | Wsr7o0r+KltI4Ehy/TjvNX16fa/t9p5pUs8rKyG8SZndxJCsk0MW55G9HFvQ0FmP 18 | A6vX9WQmbP+ml7jsUxtEJ6MOGJ39jmaUvPc= 19 | =ZzP+ 20 | -----END PGP PUBLIC KEY BLOCK----- 21 | -------------------------------------------------------------------------------- /files/RPM-GPG-KEY-EPEL-6: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1.4.5 (GNU/Linux) 3 | 4 | mQINBEvSKUIBEADLGnUj24ZVKW7liFN/JA5CgtzlNnKs7sBg7fVbNWryiE3URbn1 5 | JXvrdwHtkKyY96/ifZ1Ld3lE2gOF61bGZ2CWwJNee76Sp9Z+isP8RQXbG5jwj/4B 6 | M9HK7phktqFVJ8VbY2jfTjcfxRvGM8YBwXF8hx0CDZURAjvf1xRSQJ7iAo58qcHn 7 | XtxOAvQmAbR9z6Q/h/D+Y/PhoIJp1OV4VNHCbCs9M7HUVBpgC53PDcTUQuwcgeY6 8 | pQgo9eT1eLNSZVrJ5Bctivl1UcD6P6CIGkkeT2gNhqindRPngUXGXW7Qzoefe+fV 9 | QqJSm7Tq2q9oqVZ46J964waCRItRySpuW5dxZO34WM6wsw2BP2MlACbH4l3luqtp 10 | Xo3Bvfnk+HAFH3HcMuwdaulxv7zYKXCfNoSfgrpEfo2Ex4Im/I3WdtwME/Gbnwdq 11 | 3VJzgAxLVFhczDHwNkjmIdPAlNJ9/ixRjip4dgZtW8VcBCrNoL+LhDrIfjvnLdRu 12 | vBHy9P3sCF7FZycaHlMWP6RiLtHnEMGcbZ8QpQHi2dReU1wyr9QgguGU+jqSXYar 13 | 1yEcsdRGasppNIZ8+Qawbm/a4doT10TEtPArhSoHlwbvqTDYjtfV92lC/2iwgO6g 14 | YgG9XrO4V8dV39Ffm7oLFfvTbg5mv4Q/E6AWo/gkjmtxkculbyAvjFtYAQARAQAB 15 | tCFFUEVMICg2KSA8ZXBlbEBmZWRvcmFwcm9qZWN0Lm9yZz6JAjYEEwECACAFAkvS 16 | KUICGw8GCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRA7Sd8qBgi4lR/GD/wLGPv9 17 | qO39eyb9NlrwfKdUEo1tHxKdrhNz+XYrO4yVDTBZRPSuvL2yaoeSIhQOKhNPfEgT 18 | 9mdsbsgcfmoHxmGVcn+lbheWsSvcgrXuz0gLt8TGGKGGROAoLXpuUsb1HNtKEOwP 19 | Q4z1uQ2nOz5hLRyDOV0I2LwYV8BjGIjBKUMFEUxFTsL7XOZkrAg/WbTH2PW3hrfS 20 | WtcRA7EYonI3B80d39ffws7SmyKbS5PmZjqOPuTvV2F0tMhKIhncBwoojWZPExft 21 | HpKhzKVh8fdDO/3P1y1Fk3Cin8UbCO9MWMFNR27fVzCANlEPljsHA+3Ez4F7uboF 22 | p0OOEov4Yyi4BEbgqZnthTG4ub9nyiupIZ3ckPHr3nVcDUGcL6lQD/nkmNVIeLYP 23 | x1uHPOSlWfuojAYgzRH6LL7Idg4FHHBA0to7FW8dQXFIOyNiJFAOT2j8P5+tVdq8 24 | wB0PDSH8yRpn4HdJ9RYquau4OkjluxOWf0uRaS//SUcCZh+1/KBEOmcvBHYRZA5J 25 | l/nakCgxGb2paQOzqqpOcHKvlyLuzO5uybMXaipLExTGJXBlXrbbASfXa/yGYSAG 26 | iVrGz9CE6676dMlm8F+s3XXE13QZrXmjloc6jwOljnfAkjTGXjiB7OULESed96MR 27 | XtfLk0W5Ab9pd7tKDR6QHI7rgHXfCopRnZ2VVQ== 28 | =V/6I 29 | -----END PGP PUBLIC KEY BLOCK----- 30 | -------------------------------------------------------------------------------- /files/RPM-GPG-KEY-EPEL-7: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1.4.11 (GNU/Linux) 3 | 4 | mQINBFKuaIQBEAC1UphXwMqCAarPUH/ZsOFslabeTVO2pDk5YnO96f+rgZB7xArB 5 | OSeQk7B90iqSJ85/c72OAn4OXYvT63gfCeXpJs5M7emXkPsNQWWSju99lW+AqSNm 6 | jYWhmRlLRGl0OO7gIwj776dIXvcMNFlzSPj00N2xAqjMbjlnV2n2abAE5gq6VpqP 7 | vFXVyfrVa/ualogDVmf6h2t4Rdpifq8qTHsHFU3xpCz+T6/dGWKGQ42ZQfTaLnDM 8 | jToAsmY0AyevkIbX6iZVtzGvanYpPcWW4X0RDPcpqfFNZk643xI4lsZ+Y2Er9Yu5 9 | S/8x0ly+tmmIokaE0wwbdUu740YTZjCesroYWiRg5zuQ2xfKxJoV5E+Eh+tYwGDJ 10 | n6HfWhRgnudRRwvuJ45ztYVtKulKw8QQpd2STWrcQQDJaRWmnMooX/PATTjCBExB 11 | 9dkz38Druvk7IkHMtsIqlkAOQMdsX1d3Tov6BE2XDjIG0zFxLduJGbVwc/6rIc95 12 | T055j36Ez0HrjxdpTGOOHxRqMK5m9flFbaxxtDnS7w77WqzW7HjFrD0VeTx2vnjj 13 | GqchHEQpfDpFOzb8LTFhgYidyRNUflQY35WLOzLNV+pV3eQ3Jg11UFwelSNLqfQf 14 | uFRGc+zcwkNjHh5yPvm9odR1BIfqJ6sKGPGbtPNXo7ERMRypWyRz0zi0twARAQAB 15 | tChGZWRvcmEgRVBFTCAoNykgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB 16 | AgAiBQJSrmiEAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBqL66iNSxk 17 | 5cfGD/4spqpsTjtDM7qpytKLHKruZtvuWiqt5RfvT9ww9GUUFMZ4ZZGX4nUXg49q 18 | ixDLayWR8ddG/s5kyOi3C0uX/6inzaYyRg+Bh70brqKUK14F1BrrPi29eaKfG+Gu 19 | MFtXdBG2a7OtPmw3yuKmq9Epv6B0mP6E5KSdvSRSqJWtGcA6wRS/wDzXJENHp5re 20 | 9Ism3CYydpy0GLRA5wo4fPB5uLdUhLEUDvh2KK//fMjja3o0L+SNz8N0aDZyn5Ax 21 | CU9RB3EHcTecFgoy5umRj99BZrebR1NO+4gBrivIfdvD4fJNfNBHXwhSH9ACGCNv 22 | HnXVjHQF9iHWApKkRIeh8Fr2n5dtfJEF7SEX8GbX7FbsWo29kXMrVgNqHNyDnfAB 23 | VoPubgQdtJZJkVZAkaHrMu8AytwT62Q4eNqmJI1aWbZQNI5jWYqc6RKuCK6/F99q 24 | thFT9gJO17+yRuL6Uv2/vgzVR1RGdwVLKwlUjGPAjYflpCQwWMAASxiv9uPyYPHc 25 | ErSrbRG0wjIfAR3vus1OSOx3xZHZpXFfmQTsDP7zVROLzV98R3JwFAxJ4/xqeON4 26 | vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt 27 | RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw== 28 | =hdPa 29 | -----END PGP PUBLIC KEY BLOCK----- 30 | -------------------------------------------------------------------------------- /lib/puppet/functions/validate_yum_hash.rb: -------------------------------------------------------------------------------- 1 | Puppet::Functions.create_function(:validate_yum_hash) do 2 | def validate_yum_hash(*args) 3 | yumrepo_arguments = [ 4 | 'name', 5 | 'ensure', 6 | 'baseurl', 7 | 'cost', 8 | 'descr', 9 | 'enabled', 10 | 'enablegroups', 11 | 'exclude', 12 | 'failovermethod', 13 | 'gpgcheck', 14 | 'gpgkey', 15 | 'http_caching', 16 | 'include', 17 | 'includepkgs', 18 | 'keepalive', 19 | 'metadata_expire', 20 | 'metalink', 21 | 'mirrorlist', 22 | 'priority', 23 | 'protect', 24 | 'provider', 25 | 'proxy', 26 | 'proxy_password', 27 | 'proxy_username', 28 | 'repo_gpgcheck', 29 | 's3_enabled', 30 | 'skip_if_unavailable', 31 | 'sslcacert', 32 | 'sslclientcert', 33 | 'sslclientkey', 34 | 'sslverify', 35 | 'target', 36 | 'timeout' 37 | ] 38 | 39 | if args.size > 1 40 | raise Puppet::Error, "validate_yum_hash takes only a single argument, #{args.size} provided" 41 | end 42 | arg = args[0] 43 | 44 | if not arg.kind_of?(Hash) 45 | raise Puppet::Error, "non-hash argument provided to validate_yum_hash" 46 | end 47 | 48 | if arg.size > 0 49 | arg.each do |title, params| 50 | params.each do |param, value| 51 | if ! yumrepo_arguments.include?(param) 52 | raise Puppet::Error, "Parameter #{param} is not valid for the yumrepo type" 53 | end 54 | end 55 | end 56 | end 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /manifests/auth_file.pp: -------------------------------------------------------------------------------- 1 | # == Class: openstack_extras::auth_file 2 | # 3 | # Creates an auth file that can be used to export 4 | # environment variables that can be used to authenticate 5 | # against a keystone server. 6 | # 7 | # === Parameters 8 | # 9 | # [*password*] 10 | # (Required) Password for this account as defined in keystone 11 | # 12 | # [*auth_url*] 13 | # (Optional) URL to authenticate against 14 | # Defaults to 'http://127.0.0.1:5000/v3/' 15 | # 16 | # [*service_token*] 17 | # (Optional) Keystone service token 18 | # NOTE: This setting will trigger a warning from keystone. 19 | # Authentication credentials will be ignored by keystone client 20 | # in favor of token authentication. 21 | # Defaults to undef. 22 | # 23 | # [*service_endpoint*] 24 | # (Optional) Keystone service endpoint 25 | # Defaults to 'http://127.0.0.1:5000/v3/' 26 | # 27 | # [*username*] 28 | # (Optional) Username for this account as defined in keystone 29 | # Defaults to 'admin'. 30 | # 31 | # [*project_name*] 32 | # (Optional) Project for this account as defined in keystone 33 | # Use instead of tenant_name for when using identity v3. 34 | # Defaults to 'openstack'. 35 | # 36 | # [*region_name*] 37 | # (Optional) Openstack region to use 38 | # Defaults to 'RegionOne'. 39 | # 40 | # [*use_no_cache*] 41 | # (Optional) Do not use the auth token cache. 42 | # Defaults to true. 43 | # 44 | # [*os_interface*] 45 | # (Optional) The common endpoint to use with OSC 46 | # Defaults to 'public'. 47 | # 48 | # [*os_endpoint_type*] 49 | # (Optional) The common endpoint to use with service-specific clients 50 | # Defaults to 'publicURL'. 51 | # 52 | # [*cinder_endpoint_type*] 53 | # (Optional) The Cinder endpoint to use 54 | # Defaults to 'publicURL'. 55 | # 56 | # [*glance_endpoint_type*] 57 | # (Optional) The Glance endpoint to use 58 | # Defaults to 'publicURL'. 59 | # 60 | # [*keystone_endpoint_type*] 61 | # (Optional) The Keystone endpoint to use 62 | # Defaults to 'publicURL'. 63 | # 64 | # [*nova_endpoint_type*] 65 | # (Optional) The Nova endpoint to use 66 | # Defaults to 'publicURL'. 67 | # 68 | # [*neutron_endpoint_type*] 69 | # (Optional) The Neutron endpoint to use 70 | # Defaults to 'publicURL'. 71 | # 72 | # [*auth_strategy*] 73 | # (Optional) The method to use for authentication 74 | # Defaults to 'keystone'. 75 | # 76 | # [*path*] 77 | # (Optional) File path 78 | # Defaults to '/root/openrc'. 79 | # 80 | # [*project_domain_name*] 81 | # (Optional) Project domain in v3 api. 82 | # Defaults to 'Default'. 83 | # 84 | # [*user_domain_name*] 85 | # (Optional) User domain in v3 api. 86 | # Defaults to 'Default'. 87 | # 88 | # [*auth_type*] 89 | # (Optional) Authentication type to load. 90 | # Default to undef. 91 | # 92 | # [*compute_api_version*] 93 | # (Optional) Compute API version to use. 94 | # Defaults to undef. 95 | # 96 | # [*network_api_version*] 97 | # (Optional) Network API version to use. 98 | # Defaults to undef. 99 | # 100 | # [*image_api_version*] 101 | # (Optional) Image API version to use. 102 | # Defaults to undef. 103 | # 104 | # [*volume_api_version*] 105 | # (Optional) Volume API version to use. 106 | # Defaults to undef. 107 | # 108 | # [*identity_api_version*] 109 | # (Optional) Identity API version to use. 110 | # Defaults to '3'. 111 | # 112 | # [*object_api_version*] 113 | # (Optional) Object API version to use. 114 | # Defaults to undef. 115 | # 116 | class openstack_extras::auth_file ( 117 | $password, 118 | $auth_url = 'http://127.0.0.1:5000/v3/', 119 | $service_token = undef, 120 | $service_endpoint = 'http://127.0.0.1:5000/v3/', 121 | $username = 'admin', 122 | $project_name = 'openstack', 123 | $region_name = 'RegionOne', 124 | $use_no_cache = true, 125 | $project_domain_name = 'Default', 126 | $user_domain_name = 'Default', 127 | $auth_type = undef, 128 | $os_interface = 'public', 129 | $os_endpoint_type = 'publicURL', 130 | $cinder_endpoint_type = 'publicURL', 131 | $glance_endpoint_type = 'publicURL', 132 | $keystone_endpoint_type = 'publicURL', 133 | $nova_endpoint_type = 'publicURL', 134 | $neutron_endpoint_type = 'publicURL', 135 | $auth_strategy = 'keystone', 136 | $path = '/root/openrc', 137 | $compute_api_version = undef, 138 | $network_api_version = undef, 139 | $image_api_version = undef, 140 | $volume_api_version = undef, 141 | $identity_api_version = '3', 142 | $object_api_version = undef, 143 | ) { 144 | 145 | file { $path: 146 | owner => 'root', 147 | group => 'root', 148 | mode => '0700', 149 | show_diff => false, 150 | tag => ['openrc'], 151 | content => template('openstack_extras/openrc.erb') 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /manifests/repo/debian/debian.pp: -------------------------------------------------------------------------------- 1 | # == Class: openstack_extras::repo::debian::debian 2 | # 3 | # This repo sets up apt sources for use with the debian 4 | # osfamily and debian operatingsystem 5 | # 6 | # === Parameters: 7 | # 8 | # [*release*] 9 | # (optional) The OpenStack release to add a Debian apt source for. 10 | # Defaults to 'epoxy' 11 | # 12 | # [*manage_deb*] 13 | # (optional) Whether or not to add the default Debian APT source 14 | # Defaults to true 15 | # 16 | # [*package_require*] 17 | # (optional) Whether or not to run 'apt-get update' before 18 | # installing any packages. 19 | # Defaults to false 20 | # 21 | # [*use_extrepo*] 22 | # (optional) Should this module use extrepo to 23 | # setup the Debian apt sources.list. If true, the 24 | # below parameters aren't in use. 25 | # Defaults to true. 26 | # 27 | # [*source_hash*] 28 | # (optional) A hash of apt::source resources to 29 | # create and manage 30 | # Defaults to {} 31 | # 32 | # [*source_defaults*] 33 | # (optional) A hash of defaults to use for all apt::source 34 | # resources created by this class 35 | # Defaults to {} 36 | # 37 | # [*deb_location*] 38 | # (optional) Debian package repository location. 39 | # Defaults to "http://${facts['os']['distro']['codename']}-${release}.debian.net/debian" 40 | # 41 | class openstack_extras::repo::debian::debian( 42 | String[1] $release = 'epoxy', 43 | Boolean $manage_deb = true, 44 | Boolean $package_require = false, 45 | Boolean $use_extrepo = true, 46 | # Below params only used if $use_extrepo is set to false 47 | Hash $source_hash = {}, 48 | Hash $source_defaults = {}, 49 | String[1] $deb_location = "http://${facts['os']['distro']['codename']}-${release}.debian.net/debian", 50 | ) { 51 | 52 | $lowercase_release = downcase($release) 53 | 54 | if $manage_deb { 55 | 56 | if $use_extrepo { 57 | # Extrepo is much nicer than what's below, because 58 | # the repositories are authenticated by extrepo itself. 59 | # Also, using apt-key is now deprecated (to be removed in 2021). 60 | # We use ensure_packages to avoid conflict with any other class 61 | # external to this module that may also install extrepo. 62 | 63 | # We cannot use package{} or ensure_packages[] as per below, 64 | # because this introduces a dependency loop later on if 65 | # $package_require is set to true. 66 | # So please leave this commented. 67 | #ensure_packages(['extrepo',], {'ensure' => 'present'}) 68 | 69 | exec { "/usr/bin/extrepo enable openstack_${lowercase_release}": 70 | command => "/bin/true # comment to satisfy puppet syntax requirements 71 | apt-get update 72 | apt-get install -y extrepo 73 | extrepo enable openstack_${lowercase_release} 74 | apt-get update 75 | ", 76 | logoutput => 'on_failure', 77 | tries => 3, 78 | try_sleep => 1, 79 | creates => "/etc/apt/sources.list.d/extrepo_openstack_${lowercase_release}.sources", 80 | } 81 | if $package_require { 82 | Exec["/usr/bin/extrepo enable openstack_${lowercase_release}"] -> Exec['apt_update'] 83 | } 84 | }else{ 85 | exec { 'installing openstack-backports-archive-keyring': 86 | command => "/usr/bin/apt-get update ; \ 87 | wget ${deb_location}/dists/pubkey.gpg ; \ 88 | apt-key add pubkey.gpg ; \ 89 | rm pubkey.gpg", 90 | logoutput => 'on_failure', 91 | tries => 3, 92 | try_sleep => 1, 93 | refreshonly => true, 94 | subscribe => File['/etc/apt/sources.list.d/debian-openstack-backports.list'], 95 | notify => Exec['apt_update'], 96 | } 97 | apt::source { 'debian-openstack-backports': 98 | location => $deb_location, 99 | release => "${facts['os']['distro']['codename']}-${lowercase_release}-backports", 100 | repos => 'main', 101 | } 102 | -> apt::source { 'debian-openstack-backports-nochange': 103 | location => $deb_location, 104 | release => "${facts['os']['distro']['codename']}-${lowercase_release}-backports-nochange", 105 | repos => 'main', 106 | } 107 | } 108 | create_resources('apt::source', $source_hash, $source_defaults) 109 | } 110 | 111 | if $package_require { 112 | Exec['apt_update'] -> Package<||> 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /manifests/repo/debian/ubuntu.pp: -------------------------------------------------------------------------------- 1 | # == Class: openstack_extras::repo::debian::ubuntu 2 | # 3 | # This repo sets up apt sources for use with the debian 4 | # osfamily and ubuntu operatingsystem 5 | # 6 | # === Parameters: 7 | # 8 | # [*release*] 9 | # (optional) The OpenStack release to add an Ubuntu Cloud Archive APT source 10 | # for. 11 | # Defaults to 'epoxy' 12 | # 13 | # [*manage_uca*] 14 | # (optional) Whether or not to add the default Ubuntu Cloud Archive APT 15 | # source. 16 | # Defaults to true 17 | # 18 | # [*repo*] 19 | # (optional) Select with repository we want to use 20 | # Can be 'updates' or 'proposed' 21 | # 'proposed' to test upgrade to the next version 22 | # 'updates' to install the latest stable version 23 | # Defaults to 'updates' 24 | # 25 | # [*source_hash*] 26 | # (optional) A hash of apt::source resources to 27 | # create and manage 28 | # Defaults to {} 29 | # 30 | # [*source_defaults*] 31 | # (optional) A hash of defaults to use for all apt::source 32 | # resources created by this class 33 | # Defaults to {} 34 | # 35 | # [*package_require*] 36 | # (optional) Whether or not to run 'apt-get update' before 37 | # installing any packages. 38 | # Defaults to false 39 | # 40 | # [*uca_location*] 41 | # (optional) Ubuntu Cloud Archives repository location. 42 | # Defaults to $::openstack_extras::repo::debian::params::uca_location 43 | # 44 | class openstack_extras::repo::debian::ubuntu( 45 | String[1] $release = 'epoxy', 46 | Boolean $manage_uca = true, 47 | Enum['updates', 'proposed'] $repo = 'updates', 48 | Hash $source_hash = {}, 49 | Hash $source_defaults = {}, 50 | Boolean $package_require = false, 51 | String[1] $uca_location = 'http://ubuntu-cloud.archive.canonical.com/ubuntu', 52 | ) { 53 | 54 | if $manage_uca { 55 | exec { 'installing ubuntu-cloud-keyring': 56 | command => '/usr/bin/apt-get -y install ubuntu-cloud-keyring', 57 | logoutput => 'on_failure', 58 | tries => 3, 59 | try_sleep => 1, 60 | refreshonly => true, 61 | subscribe => File['/etc/apt/sources.list.d/ubuntu-cloud-archive.list'], 62 | notify => Exec['apt_update'], 63 | } 64 | apt::source { 'ubuntu-cloud-archive': 65 | location => $uca_location, 66 | release => "${facts['os']['distro']['codename']}-${repo}/${release}", 67 | repos => 'main', 68 | } 69 | } 70 | 71 | create_resources('apt::source', $source_hash, $source_defaults) 72 | 73 | if $package_require { 74 | Exec['apt_update'] -> Package<||> 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /manifests/repo/redhat/redhat.pp: -------------------------------------------------------------------------------- 1 | # == Class: openstack_extras::repo::redhat::redhat 2 | # 3 | # This class sets up repositories for use with the supported 4 | # operating systems in the RedHat OS family. 5 | # 6 | # === Parameters: 7 | # 8 | # [*release*] 9 | # (Optional) The OpenStack release to use. 10 | # Defaults to 'epoxy' 11 | # 12 | # [*manage_rdo*] 13 | # (Optional) Whether to create a yumrepo resource for the 14 | # RDO OpenStack repository. 15 | # Defaults to true 16 | # 17 | # [*repo_hash*] 18 | # (Optional) A hash of yumrepo resources that will be passed to 19 | # create_resource. See examples folder for some useful examples. 20 | # Defaults to {} 21 | # 22 | # [*repo_source_hash*] 23 | # (Optional) A hash of repo files. 24 | # Defaults to {} 25 | # 26 | # [*repo_replace*] 27 | # (Optional) Replace repo files when their contents are changed. 28 | # Defaults to true 29 | # 30 | # [*repo_defaults*] 31 | # (Optional) The defaults for the yumrepo resources that will be 32 | # created using create_resource. 33 | # Defaults to {} 34 | # 35 | # [*gpgkey_hash*] 36 | # (Optional) A hash of file resources that will be passed to 37 | # create_resources. See examples folder for some useful examples. 38 | # Defaults to {} 39 | # 40 | # [*gpgkey_defaults*] 41 | # (Optional) The default resource attributes to create gpgkeys with. 42 | # Defaults to {} 43 | # 44 | # [*purge_unmanaged*] 45 | # (Optional) Purge the yum.repos.d directory of all repositories 46 | # not managed by Puppet. 47 | # Defaults to false 48 | # 49 | # [*package_require*] 50 | # (Optional) Set all packages to require all yumrepos be set. 51 | # Defaults to false 52 | # 53 | # [*centos_mirror_url*] 54 | # (Optional) URL of CentOS mirror. 55 | # Defaults to 'http://mirror.stream.centos.org' 56 | # 57 | # [*update_packages*] 58 | # (Optional) Whether to update all packages after yum repositories are 59 | # configured. 60 | # Defaults to false 61 | # 62 | # [*update_timeout*] 63 | # (Optional) Timeout for package update. 64 | # Defaults to 600 65 | # 66 | # DEPRECATED PARAMETER 67 | # 68 | # [*manage_epel*] 69 | # (Optional) Whether to create a predefined yumrepo resource for 70 | # the EPEL repository. Note EPEL is not required for deploying 71 | # OpenStack with RDO. 72 | # Defaults to false 73 | # 74 | class openstack_extras::repo::redhat::redhat ( 75 | String[1] $release = 'epoxy', 76 | Boolean $manage_rdo = true, 77 | Hash $repo_hash = {}, 78 | Hash $repo_source_hash = {}, 79 | Boolean $repo_replace = true, 80 | Hash $repo_defaults = {}, 81 | Hash $gpgkey_hash = {}, 82 | Hash $gpgkey_defaults = {}, 83 | Boolean $purge_unmanaged = false, 84 | Boolean $package_require = false, 85 | String[1] $centos_mirror_url = 'http://mirror.stream.centos.org', 86 | Boolean $update_packages = false, 87 | Integer[0] $update_timeout = 600, 88 | # DEPRECATED PARAMETERS 89 | Boolean $manage_epel = false, 90 | ) { 91 | 92 | validate_yum_hash($repo_hash) 93 | 94 | $_repo_defaults = merge({ 95 | 'enabled' => '1', 96 | 'gpgcheck' => '1', 97 | 'mirrorlist' => 'absent', 98 | 'notify' => 'Exec[yum_refresh]', 99 | 'require' => 'Anchor[openstack_extras_redhat]', 100 | }, $repo_defaults) 101 | 102 | $_gpgkey_defaults = merge({ 103 | 'owner' => 'root', 104 | 'group' => 'root', 105 | 'mode' => '0644', 106 | 'before' => 'Anchor[openstack_extras_redhat]', 107 | }, $gpgkey_defaults) 108 | 109 | anchor { 'openstack_extras_redhat': } 110 | 111 | if $manage_rdo { 112 | $release_cap = capitalize($release) 113 | 114 | $rdo_baseurl = "${centos_mirror_url}/SIGs/\$stream/cloud/\$basearch/openstack-${release}/" 115 | 116 | $rdo_hash = { 117 | 'rdo-release' => { 118 | 'baseurl' => $rdo_baseurl, 119 | 'descr' => "OpenStack ${release_cap} Repository", 120 | 'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud', 121 | 'module_hotfixes' => true, 122 | } 123 | } 124 | 125 | $rdokey_hash = { 126 | '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud' => { 127 | 'source' => 'puppet:///modules/openstack_extras/RPM-GPG-KEY-CentOS-SIG-Cloud' 128 | } 129 | } 130 | 131 | create_resources('file', $rdokey_hash, $_gpgkey_defaults) 132 | create_resources('yumrepo', $rdo_hash, $_repo_defaults) 133 | } 134 | 135 | if $manage_epel { 136 | warning('The manage_epel parameter has been deprecated and will be removed in a future release') 137 | 138 | $epel_hash = { 139 | 'epel' => { 140 | 'metalink' => "https://mirrors.fedoraproject.org/metalink?repo=epel-${facts['os']['release']['major']}&arch=\$basearch", 141 | 'descr' => "Extra Packages for Enterprise Linux ${facts['os']['release']['major']} - \$basearch", 142 | 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${facts['os']['release']['major']}", 143 | 'failovermethod' => 'priority' 144 | } 145 | } 146 | 147 | $epelkey_hash = { 148 | "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${facts['os']['release']['major']}" => { 149 | 'source' => "puppet:///modules/openstack_extras/RPM-GPG-KEY-EPEL-${facts['os']['release']['major']}" 150 | } 151 | } 152 | 153 | create_resources('file', $epelkey_hash, $_gpgkey_defaults) 154 | create_resources('yumrepo', $epel_hash, $_repo_defaults) 155 | } 156 | 157 | create_resources('yumrepo', $repo_hash, $_repo_defaults) 158 | create_resources('file', $gpgkey_hash, $_gpgkey_defaults) 159 | 160 | $repo_source_hash.each |$filename, $url| { 161 | file { $filename: 162 | path => "/etc/yum.repos.d/${filename}", 163 | source => $url, 164 | replace => $repo_replace, 165 | notify => Exec['yum_refresh'], 166 | } 167 | } 168 | 169 | if $purge_unmanaged { 170 | resources { 'yumrepo': 171 | purge => true 172 | } 173 | } 174 | 175 | if $package_require { 176 | Yumrepo<||> -> Package<||> 177 | } 178 | 179 | exec { 'yum_refresh': 180 | command => '/usr/bin/dnf clean all', 181 | refreshonly => true, 182 | } 183 | 184 | if $update_packages { 185 | exec { 'yum_update': 186 | command => '/usr/bin/dnf update -y', 187 | refreshonly => true, 188 | timeout => $update_timeout, 189 | } 190 | 191 | Exec['yum_refresh'] ~> Exec['yum_update'] -> Package <||> 192 | } 193 | else { 194 | Exec['yum_refresh'] -> Package <||> 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "OpenStack Contributors", 3 | "dependencies": [ 4 | { 5 | "name": "puppetlabs/apt", 6 | "version_requirement": ">=1.8.0 <11.0.0" 7 | }, 8 | { 9 | "name": "puppetlabs/stdlib", 10 | "version_requirement": ">=5.0.0 <10.0.0" 11 | } 12 | ], 13 | "description": "Puppet module to add useful utilities for OpenStack deployments", 14 | "issues_url": "https://bugs.launchpad.net/puppet-openstack-extras", 15 | "license": "Apache-2.0", 16 | "name": "openstack-openstack_extras", 17 | "operatingsystem_support": [ 18 | { 19 | "operatingsystem": "Debian", 20 | "operatingsystemrelease": [ 21 | "12" 22 | ] 23 | }, 24 | { 25 | "operatingsystem": "RedHat", 26 | "operatingsystemrelease": [ 27 | "9" 28 | ] 29 | }, 30 | { 31 | "operatingsystem": "CentOS", 32 | "operatingsystemrelease": [ 33 | "9" 34 | ] 35 | }, 36 | { 37 | "operatingsystem": "Ubuntu", 38 | "operatingsystemrelease": [ 39 | "24.04" 40 | ] 41 | } 42 | ], 43 | "project_page": "https://launchpad.net/puppet-openstack-extras", 44 | "requirements": [ 45 | { 46 | "name": "puppet", 47 | "version_requirement": ">= 7.0.0 < 9.0.0" 48 | } 49 | ], 50 | "source": "https://opendev.org/openstack/puppet-openstack_extras.git", 51 | "summary": "Puppet OpenStack Extras Module", 52 | "version": "26.0.0" 53 | } 54 | -------------------------------------------------------------------------------- /releasenotes/notes/add-redhat-repo-stream-param-e07601e273aad56c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added ``stream`` parameter (defaulting to true) to the openstack_extras::repo::redhat::redhat 5 | class that instructs Puppet to create repositories for CentOS Stream. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/add_centos_mirror-079eb2b38940f583.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Allow to change CentOS mirror URL with a new parameter, centos_mirror_url. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/allow_change_uca_url-b855c119a693b583.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - When deploying UCA repositories, allow to customize the URL. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1969484-6e4864f8bcc56230.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | The advanced virtualization repository is no longer enabled in CentOS 5 | Stream 9, because the separate repository is no longer available. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1978332-8b223e30a7f30165.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | The ``openstack_extras::repos::redhat::redhat`` class now configures RDO 5 | repository properly in CentOS Stream 9. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/centos-9-support-ee1fc77ac7ac450c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Now this module supports CentOS 9 and Red Hat Enterprise Linux 9. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/debian-repo-updates-4aee254ef80e8dd7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | ```openstack_extras::repo::debian::debian::manage_whz``` has been drepcated. 5 | Use ```openstack_extras::repo::debian::debian::manage_deb``` instead. 6 | 7 | -------------------------------------------------------------------------------- /releasenotes/notes/debian-uses-extrepo-a77c672920581e4e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The class openstack_extras::repo::debian::debian has now a new parameter 5 | use_extrepo, which is true by default. If true, extrepo will be used for 6 | setting-up the OpenStack apt sources.list, and the parameters source_hash, 7 | source_defaults and deb_location are ignored. Beware that this is now 8 | the new default! 9 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-manage_epel-056acc6686886a4a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``openstack_extras::repo::redhat::redhat::manage_epel`` parameter has 5 | been deprecated and will be removed in a future release. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-pacemaker-service-b34268f01b39d676.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``openstack_extras::pacemaker::service`` defined resource type has been 5 | deprecated and will be removed in a future release. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-redhat-repo-manage-prio-429e39966b3f6f57.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The manage_priorities parameter in openstack_extras::repo::redhat::redhat 5 | is deprecated, has no effect and will be removed in a future release. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-tenant_name-d8feb61192e129f7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``openstack_extras::auth_file::tenant_name`` parameter has been 5 | deprecated. Use the ``project_name`` parameter instead. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/disable_epel-a07b06048465e7a1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - Disable EPEL repository setup by default. Keep the boolean if users 4 | want it, but add a note that EPEL is not required when deploying 5 | OpenStack with RDO repositories. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/mitaka_features-6358feed90cd0b0b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Keystone v3 support and enabled by default in openrc file. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/mitaka_upgrade-79294b892d21dfc7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Bump to Mitaka repositories by default. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/puppet-8-0a5de2c5ecbc6a35.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | This module now officially supports Puppet 8. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/rdo-virt-a9fb3681cbc8419e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - With a new boolean called manage_virt, allow to whether or not activate 4 | RDO CentOS QEMU EV repository that is required when deploying OpenStack 5 | Newton with RDO packaging. It's enabled by default to make deployments 6 | working out of the box, but can be disabled. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/redhat-repo-cleanup-antelope-ca46c38bbf3ee957.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following parameters of the ``openstack_extras::repo::redhat::redhat`` 5 | class have been removed. 6 | 7 | - ``stream`` 8 | - ``manage_virt`` 9 | -------------------------------------------------------------------------------- /releasenotes/notes/release-note-ubuntu-py3-3fea08087d957b35.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | In this release Ubuntu has moved all projects that supported it to python3 4 | which means that there will be a lot of changes. The Puppet OpenStack project 5 | does not test the upgrade path from python2 to python3 packages so there might 6 | be manual steps required when moving to the python3 packages. 7 | upgrade: 8 | - | 9 | Ubuntu packages are now using python3, the upgrade path is not tested by 10 | Puppet OpenStack. Manual steps may be required when upgrading. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-domain_name-2a9dee69a7334eab.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following parameters of the ``openstack_extras::auth_file`` class have 5 | been removed. 6 | 7 | - ``project_domain`` 8 | - ``user_domain`` 9 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-openrc-tenant_name-b3c39a6b1a758f05.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated ``openstack_extras::auth_file::tenant_name`` parameter has 5 | been removed. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-pacemaker-service-d1903561dea90fef.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``openstack_extras::pacemaker::service`` defined resource type has 5 | been removed. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-puppet-6-1feddecc3d99d0b1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Puppet 6 is no longer supported. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/rename-to-domain_name-d7bc8a7b44c619c8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The following parameters in ``openstack_extras::auth_file`` class has been 5 | deprecated and will be removed in a future release. Use new parameters 6 | instead. 7 | 8 | - ``user_domain`` (now renamed to ``user_domain_name``) 9 | - ``project_domain`` (now renamed to ``project_domain_name``) 10 | -------------------------------------------------------------------------------- /releasenotes/notes/repo-debian-remove-manage_whz-73b1326b754dfe30.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``openstack_extras::repo::debian::debian::manage_whz`` parameter has 5 | been removed. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/repo-redhat-deprecate-manage_virt-4a29a4b85390b4fc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``openstack_extras::repo::redhat::redhat::manage_virt`` parameter has 5 | been deprecated and has no effect now. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/repo-redhat-deprecate-stream-04b111eabe5d5df3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``openstack_extras::repo::redhat::redhat::stream`` parameter has been 5 | deprecate. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/repo-redhat-remove-manage_priorities-019ec005d1f98c46.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``openstack_extras::repo::redhat::redhat::manage_priorities`` parameter 5 | has been removed. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/repo-redhat-replace-9d475450f304ad94.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``openstack_extras::repo::redhat::redhat::repo_replace`` parameter 5 | has been added to enable or disable file replacement when original repo 6 | files are updated. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/repo-redhat-repofile-bfafdae3f8b158b2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``repo::redhat::redhat::repo_source_hash`` parameter has been 5 | added, so that repo file can be passed directly to configure yum 6 | repogitories on CentOS or RHEL nodes. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/repo-redhat-update_packages-d52c3fe93e97ac76.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``update_package`` parameter has been added to the 5 | ``openstack_extras::repo::redhat::redhat`` class. This parameter is set to 6 | false by default, but when it is set to true then all packages are updated 7 | once dnf/yum repositories are configured. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/set-module-hotfixes-redhat-repo-e03358eb341bf820.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The yumrepo resources for RDO and CentOS Advanced Virt in the 5 | openstack_extras::repo::redhat::redhat class now sets the new 6 | parameter module_hotfixes included since 6.15.0 if the Puppet 7 | version is supporting that. If you for some reason is using 8 | standalone Puppet that does not include vendored modules (i.e 9 | you are not using Puppet packages) you will need to make sure 10 | that yumrepo_core >= 1.0.7 is used. -------------------------------------------------------------------------------- /releasenotes/notes/ubuntu-jammy-fc64f281863a8de3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | This module now supports Ubuntu 22.04 (Jammy Jellyfish). 5 | 6 | upgrade: 7 | - | 8 | This module no longer supports Ubuntu 20.04 (Focal Fossa). 9 | -------------------------------------------------------------------------------- /releasenotes/notes/ubuntu-noble-f3fe04c4d190ed70.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Ubuntu 24.04 is now formally supported. 5 | 6 | upgrade: 7 | - | 8 | Ubuntu 22.04 is no longer supported. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/use-reno-1caaec4ba5aa4285.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Release notes are no longer maintained by hand, we now use the reno tool to 4 | manage them. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/yum-update-timeout-c68438aab2477331.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``openstack_extras::repo::redhat::redhat::update_timeout`` 5 | parameter has been added. This allows tuning timeout for `yum update -y` 6 | (or `dnf update -y`) command. 7 | -------------------------------------------------------------------------------- /releasenotes/source/2023.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/2023.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2023.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2023.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2025.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2025.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2025.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/_static/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/puppet-openstack_extras/c20a8fc5452d83a1d308e97ef1ffc978f17261d6/releasenotes/source/_static/.placeholder -------------------------------------------------------------------------------- /releasenotes/source/conf.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 10 | # implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | # 14 | 15 | # If extensions (or modules to document with autodoc) are in another directory, 16 | # add these directories to sys.path here. If the directory is relative to the 17 | # documentation root, use os.path.abspath to make it absolute, like shown here. 18 | #sys.path.insert(0, os.path.abspath('.')) 19 | 20 | # -- General configuration ------------------------------------------------ 21 | 22 | 23 | # If your documentation needs a minimal Sphinx version, state it here. 24 | #needs_sphinx = '1.0' 25 | 26 | # Add any Sphinx extension module names here, as strings. They can be 27 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 28 | # ones. 29 | extensions = [ 30 | 'openstackdocstheme', 31 | 'reno.sphinxext', 32 | ] 33 | 34 | # Add any paths that contain templates here, relative to this directory. 35 | templates_path = ['_templates'] 36 | 37 | # The suffix of source filenames. 38 | source_suffix = '.rst' 39 | 40 | # The encoding of source files. 41 | #source_encoding = 'utf-8-sig' 42 | 43 | # The master toctree document. 44 | master_doc = 'index' 45 | 46 | # General information about the project. 47 | copyright = '2017, Puppet OpenStack Developers' 48 | 49 | # The version info for the project you're documenting, acts as replacement for 50 | # |version| and |release|, also used in various other places throughout the 51 | # built documents. 52 | # 53 | # The short X.Y version. 54 | version = '' 55 | # The full version, including alpha/beta/rc tags. 56 | release = '' 57 | 58 | # The language for content autogenerated by Sphinx. Refer to documentation 59 | # for a list of supported languages. 60 | #language = None 61 | 62 | # There are two options for replacing |today|: either, you set today to some 63 | # non-false value, then it is used: 64 | #today = '' 65 | # Else, today_fmt is used as the format for a strftime call. 66 | #today_fmt = '%B %d, %Y' 67 | 68 | # List of patterns, relative to source directory, that match files and 69 | # directories to ignore when looking for source files. 70 | exclude_patterns = [] 71 | 72 | # The reST default role (used for this markup: `text`) to use for all 73 | # documents. 74 | #default_role = None 75 | 76 | # If true, '()' will be appended to :func: etc. cross-reference text. 77 | #add_function_parentheses = True 78 | 79 | # If true, the current module name will be prepended to all description 80 | # unit titles (such as .. function::). 81 | #add_module_names = True 82 | 83 | # If true, sectionauthor and moduleauthor directives will be shown in the 84 | # output. They are ignored by default. 85 | #show_authors = False 86 | 87 | # The name of the Pygments (syntax highlighting) style to use. 88 | pygments_style = 'native' 89 | 90 | # A list of ignored prefixes for module index sorting. 91 | #modindex_common_prefix = [] 92 | 93 | # If true, keep warnings as "system message" paragraphs in the built documents. 94 | #keep_warnings = False 95 | 96 | 97 | # -- Options for HTML output ---------------------------------------------- 98 | 99 | # The theme to use for HTML and HTML Help pages. See the documentation for 100 | # a list of builtin themes. 101 | html_theme = 'openstackdocs' 102 | 103 | # Theme options are theme-specific and customize the look and feel of a theme 104 | # further. For a list of options available for each theme, see the 105 | # documentation. 106 | #html_theme_options = {} 107 | 108 | # Add any paths that contain custom themes here, relative to this directory. 109 | # html_theme_path = [] 110 | 111 | # The name for this set of Sphinx documents. If None, it defaults to 112 | # " v documentation". 113 | #html_title = None 114 | 115 | # A shorter title for the navigation bar. Default is the same as html_title. 116 | #html_short_title = None 117 | 118 | # The name of an image file (relative to this directory) to place at the top 119 | # of the sidebar. 120 | #html_logo = None 121 | 122 | # The name of an image file (within the static path) to use as favicon of the 123 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 124 | # pixels large. 125 | #html_favicon = None 126 | 127 | # Add any paths that contain custom static files (such as style sheets) here, 128 | # relative to this directory. They are copied after the builtin static files, 129 | # so a file named "default.css" will overwrite the builtin "default.css". 130 | html_static_path = ['_static'] 131 | 132 | # Add any extra paths that contain custom files (such as robots.txt or 133 | # .htaccess) here, relative to this directory. These files are copied 134 | # directly to the root of the documentation. 135 | #html_extra_path = [] 136 | 137 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 138 | # using the given strftime format. 139 | 140 | # If true, SmartyPants will be used to convert quotes and dashes to 141 | # typographically correct entities. 142 | #html_use_smartypants = True 143 | 144 | # Custom sidebar templates, maps document names to template names. 145 | #html_sidebars = {} 146 | 147 | # Additional templates that should be rendered to pages, maps page names to 148 | # template names. 149 | #html_additional_pages = {} 150 | 151 | # If false, no module index is generated. 152 | #html_domain_indices = True 153 | 154 | # If false, no index is generated. 155 | #html_use_index = True 156 | 157 | # If true, the index is split into individual pages for each letter. 158 | #html_split_index = False 159 | 160 | # If true, links to the reST sources are added to the pages. 161 | #html_show_sourcelink = True 162 | 163 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 164 | #html_show_sphinx = True 165 | 166 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 167 | #html_show_copyright = True 168 | 169 | # If true, an OpenSearch description file will be output, and all pages will 170 | # contain a tag referring to it. The value of this option must be the 171 | # base URL from which the finished HTML is served. 172 | #html_use_opensearch = '' 173 | 174 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 175 | #html_file_suffix = None 176 | 177 | # Output file base name for HTML help builder. 178 | htmlhelp_basename = 'puppet-openstack_extrasReleaseNotesdoc' 179 | 180 | 181 | # -- Options for LaTeX output --------------------------------------------- 182 | 183 | # Grouping the document tree into LaTeX files. List of tuples 184 | # (source start file, target name, title, 185 | # author, documentclass [howto, manual, or own class]). 186 | latex_documents = [ 187 | ('index', 'puppet-openstack_extrasReleaseNotes.tex', 'puppet-openstack_extras Release Notes Documentation', 188 | '2017, Puppet OpenStack Developers', 'manual'), 189 | ] 190 | 191 | # The name of an image file (relative to this directory) to place at the top of 192 | # the title page. 193 | #latex_logo = None 194 | 195 | # For "manual" documents, if this is true, then toplevel headings are parts, 196 | # not chapters. 197 | #latex_use_parts = False 198 | 199 | # If true, show page references after internal links. 200 | #latex_show_pagerefs = False 201 | 202 | # If true, show URL addresses after external links. 203 | #latex_show_urls = False 204 | 205 | # Documents to append as an appendix to all manuals. 206 | #latex_appendices = [] 207 | 208 | # If false, no module index is generated. 209 | #latex_domain_indices = True 210 | 211 | 212 | # -- Options for manual page output --------------------------------------- 213 | 214 | # One entry per manual page. List of tuples 215 | # (source start file, name, description, authors, manual section). 216 | man_pages = [ 217 | ('index', 'puppet-openstack_extrasreleasenotes', 'puppet-openstack_extras Release Notes Documentation', 218 | ['2017, Puppet OpenStack Developers'], 1) 219 | ] 220 | 221 | # If true, show URL addresses after external links. 222 | #man_show_urls = False 223 | 224 | 225 | # -- Options for Texinfo output ------------------------------------------- 226 | 227 | # Grouping the document tree into Texinfo files. List of tuples 228 | # (source start file, target name, title, author, 229 | # dir menu entry, description, category) 230 | texinfo_documents = [ 231 | ('index', 'puppet-openstack_extrasReleaseNotes', 'puppet-openstack_extras Release Notes Documentation', 232 | '2017, Puppet OpenStack Developers', 'puppet-openstack_extrasReleaseNotes', 'One line description of project.', 233 | 'Miscellaneous'), 234 | ] 235 | 236 | # Documents to append as an appendix to all manuals. 237 | #texinfo_appendices = [] 238 | 239 | # If false, no module index is generated. 240 | #texinfo_domain_indices = True 241 | 242 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 243 | #texinfo_show_urls = 'footnote' 244 | 245 | # If true, do not generate a @detailmenu in the "Top" node's menu. 246 | #texinfo_no_detailmenu = False 247 | 248 | # -- Options for Internationalization output ------------------------------ 249 | locale_dirs = ['locale/'] 250 | 251 | # openstackdocstheme options 252 | openstackdocs_repo_name = 'openstack/puppet-openstack_extras' 253 | openstackdocs_auto_name = False 254 | -------------------------------------------------------------------------------- /releasenotes/source/index.rst: -------------------------------------------------------------------------------- 1 | ================================================= 2 | Welcome to puppet-openstack-extras Release Notes! 3 | ================================================= 4 | 5 | Contents 6 | ======== 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | unreleased 12 | 2025.1 13 | 2024.2 14 | 2024.1 15 | 2023.2 16 | 2023.1 17 | zed 18 | yoga 19 | xena 20 | wallaby 21 | victoria 22 | ussuri 23 | train 24 | stein 25 | rocky 26 | queens 27 | pike 28 | ocata 29 | newton 30 | mitaka 31 | 32 | 33 | Indices and tables 34 | ================== 35 | 36 | * :ref:`genindex` 37 | * :ref:`search` 38 | -------------------------------------------------------------------------------- /releasenotes/source/mitaka.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Mitaka Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/mitaka 7 | -------------------------------------------------------------------------------- /releasenotes/source/newton.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Newton Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/newton 7 | -------------------------------------------------------------------------------- /releasenotes/source/ocata.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Ocata Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/ocata 7 | -------------------------------------------------------------------------------- /releasenotes/source/pike.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Pike Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/pike 7 | -------------------------------------------------------------------------------- /releasenotes/source/queens.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Queens Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/queens 7 | -------------------------------------------------------------------------------- /releasenotes/source/rocky.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Rocky Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/rocky 7 | -------------------------------------------------------------------------------- /releasenotes/source/stein.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Stein Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/stein 7 | -------------------------------------------------------------------------------- /releasenotes/source/train.rst: -------------------------------------------------------------------------------- 1 | ========================== 2 | Train Series Release Notes 3 | ========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/train 7 | -------------------------------------------------------------------------------- /releasenotes/source/unreleased.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | Current Series Release Notes 3 | ============================== 4 | 5 | .. release-notes:: 6 | -------------------------------------------------------------------------------- /releasenotes/source/ussuri.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | Ussuri Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/ussuri 7 | -------------------------------------------------------------------------------- /releasenotes/source/victoria.rst: -------------------------------------------------------------------------------- 1 | ============================= 2 | Victoria Series Release Notes 3 | ============================= 4 | 5 | .. release-notes:: 6 | :branch: stable/victoria 7 | -------------------------------------------------------------------------------- /releasenotes/source/wallaby.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Wallaby Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/wallaby 7 | -------------------------------------------------------------------------------- /releasenotes/source/xena.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Xena Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/xena 7 | -------------------------------------------------------------------------------- /releasenotes/source/yoga.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Yoga Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/yoga 7 | -------------------------------------------------------------------------------- /releasenotes/source/zed.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Zed Series Release Notes 3 | ======================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/zed 7 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = puppet-openstack_extras 3 | summary = Puppet module for OpenStack Openstack_extras 4 | description_file = 5 | README.md 6 | author = OpenStack 7 | author_email = openstack-discuss@lists.openstack.org 8 | home_page = https://docs.openstack.org/puppet-openstack-guide/latest 9 | license = Apache License, Version 2.0 10 | classifier = 11 | Intended Audience :: Developers 12 | Intended Audience :: Information Technology 13 | Intended Audience :: System Administrators 14 | License :: OSI Approved :: Apache Software License 15 | Operating System :: POSIX :: Linux 16 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import setuptools 17 | 18 | setuptools.setup( 19 | setup_requires=['pbr>=2.0.0'], 20 | py_modules=[], 21 | pbr=True) 22 | -------------------------------------------------------------------------------- /spec/acceptance/openstack_extras_auth_file_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper_acceptance' 2 | 3 | describe 'openstack_extras::auth_file' do 4 | 5 | context 'default parameters' do 6 | 7 | it 'should work with no errors' do 8 | pp= <<-EOS 9 | class { 'openstack_extras::auth_file': 10 | password => 'secret', 11 | } 12 | EOS 13 | 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 file('/root/openrc') do 21 | it { is_expected.to be_file } 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /spec/acceptance/openstack_extras_repo_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper_acceptance' 2 | 3 | describe 'openstack_extras::repo::*' do 4 | 5 | context 'default parameters' do 6 | 7 | release = 'mitaka' 8 | it 'should work with no errors' do 9 | pp= <<-EOS 10 | include openstack_integration 11 | include openstack_integration::repos 12 | EOS 13 | 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 | it 'should be able to install openstack packages' do 21 | if os[:family] == 'Debian' 22 | expect(command('apt-get install -y python-openstackclient').exit_code).to be_zero 23 | expect(command('apt-cache policy python-openstackclient | grep -A 1 \*\*\*').stdout).to match(/#{release}/) 24 | elsif os[:family] == 'RedHat' 25 | expect(command('dnf install -y python-openstackclient').exit_code).to be_zero 26 | expect(command('dnf list python-openstackclient | grep -A 1 "Installed Packages"').stdout).to match(/@rdo-release/) 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /spec/classes/openstack_extras_auth_file_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'openstack_extras::auth_file' do 4 | shared_examples 'openstack_extras::auth_file' do 5 | context 'when only passing default class parameters' do 6 | let :params do 7 | { 8 | :password => 'admin' 9 | } 10 | end 11 | 12 | it { is_expected.to contain_file('/root/openrc').with( 13 | :owner => 'root', 14 | :group => 'root', 15 | :mode => '0700', 16 | :show_diff => false, 17 | :tag => ['openrc'], 18 | )} 19 | 20 | it { 21 | verify_contents(catalogue, '/root/openrc', [ 22 | 'export OS_NO_CACHE=\'true\'', 23 | 'export OS_PROJECT_NAME=\'openstack\'', 24 | 'export OS_USERNAME=\'admin\'', 25 | 'export OS_PASSWORD=\'admin\'', 26 | 'export OS_AUTH_URL=\'http://127.0.0.1:5000/v3/\'', 27 | 'export OS_AUTH_STRATEGY=\'keystone\'', 28 | 'export OS_REGION_NAME=\'RegionOne\'', 29 | 'export OS_PROJECT_DOMAIN_NAME=\'Default\'', 30 | 'export OS_USER_DOMAIN_NAME=\'Default\'', 31 | 'export OS_INTERFACE=\'public\'', 32 | 'export OS_ENDPOINT_TYPE=\'publicURL\'', 33 | 'export CINDER_ENDPOINT_TYPE=\'publicURL\'', 34 | 'export GLANCE_ENDPOINT_TYPE=\'publicURL\'', 35 | 'export KEYSTONE_ENDPOINT_TYPE=\'publicURL\'', 36 | 'export NOVA_ENDPOINT_TYPE=\'publicURL\'', 37 | 'export NEUTRON_ENDPOINT_TYPE=\'publicURL\'', 38 | 'export OS_IDENTITY_API_VERSION=\'3\'', 39 | ]) 40 | } 41 | end 42 | 43 | context 'when overriding parameters' do 44 | let :params do 45 | { 46 | :password => 'admin', 47 | :auth_url => 'http://127.0.0.2:5000/v3/', 48 | :service_token => 'servicetoken', 49 | :service_endpoint => 'http://127.0.0.2:5000/v3/', 50 | :username => 'myuser', 51 | :project_name => 'myproject', 52 | :region_name => 'myregion', 53 | :use_no_cache => 'false', 54 | :os_interface => 'internal', 55 | :os_endpoint_type => 'internalURL', 56 | :cinder_endpoint_type => 'internalURL', 57 | :glance_endpoint_type => 'internalURL', 58 | :keystone_endpoint_type => 'internalURL', 59 | :nova_endpoint_type => 'internalURL', 60 | :neutron_endpoint_type => 'internalURL', 61 | :auth_strategy => 'no_auth', 62 | :path => '/path/to/file', 63 | :user_domain_name => 'anotherdomain', 64 | :project_domain_name => 'anotherdomain', 65 | :compute_api_version => '2.1', 66 | :network_api_version => '2.0', 67 | :image_api_version => '2', 68 | :volume_api_version => '2', 69 | :identity_api_version => '3.1', 70 | :object_api_version => '1', 71 | } 72 | end 73 | 74 | it { is_expected.to contain_file('/path/to/file').with( 75 | :owner => 'root', 76 | :group => 'root', 77 | :mode => '0700', 78 | :show_diff => false, 79 | :tag => ['openrc'], 80 | )} 81 | 82 | it { 83 | verify_contents(catalogue, '/path/to/file', [ 84 | 'export OS_SERVICE_TOKEN=\'servicetoken\'', 85 | 'export OS_SERVICE_ENDPOINT=\'http://127.0.0.2:5000/v3/\'', 86 | 'export OS_NO_CACHE=\'false\'', 87 | 'export OS_PROJECT_NAME=\'myproject\'', 88 | 'export OS_USERNAME=\'myuser\'', 89 | 'export OS_PASSWORD=\'admin\'', 90 | 'export OS_AUTH_URL=\'http://127.0.0.2:5000/v3/\'', 91 | 'export OS_AUTH_STRATEGY=\'no_auth\'', 92 | 'export OS_REGION_NAME=\'myregion\'', 93 | 'export OS_PROJECT_DOMAIN_NAME=\'anotherdomain\'', 94 | 'export OS_USER_DOMAIN_NAME=\'anotherdomain\'', 95 | 'export OS_INTERFACE=\'internal\'', 96 | 'export OS_ENDPOINT_TYPE=\'internalURL\'', 97 | 'export CINDER_ENDPOINT_TYPE=\'internalURL\'', 98 | 'export GLANCE_ENDPOINT_TYPE=\'internalURL\'', 99 | 'export KEYSTONE_ENDPOINT_TYPE=\'internalURL\'', 100 | 'export NOVA_ENDPOINT_TYPE=\'internalURL\'', 101 | 'export NEUTRON_ENDPOINT_TYPE=\'internalURL\'', 102 | 'export OS_COMPUTE_API_VERSION=\'2.1\'', 103 | 'export OS_NETWORK_API_VERSION=\'2.0\'', 104 | 'export OS_IMAGE_API_VERSION=\'2\'', 105 | 'export OS_VOLUME_API_VERSION=\'2\'', 106 | 'export OS_IDENTITY_API_VERSION=\'3.1\'', 107 | 'export OS_OBJECT_API_VERSION=\'1\'', 108 | ]) 109 | } 110 | end 111 | 112 | context 'handle password and token with single quotes' do 113 | let :params do 114 | { 115 | :password => 'singlequote\'', 116 | :service_token => 'key\'stone' 117 | } 118 | end 119 | 120 | it { 121 | verify_contents(catalogue, '/root/openrc', [ 122 | 'export OS_SERVICE_TOKEN=\'key\\\'stone\'', 123 | 'export OS_PASSWORD=\'singlequote\\\'\'', 124 | ]) 125 | } 126 | end 127 | 128 | context 'when the file is in /tmp' do 129 | let :params do 130 | { 131 | :password => 'secret', 132 | :path => '/tmp/openrc' 133 | } 134 | end 135 | 136 | it { should contain_file('/tmp/openrc')} 137 | end 138 | end 139 | 140 | on_supported_os({ 141 | :supported_os => OSDefaults.get_supported_os 142 | }).each do |os,facts| 143 | context "on #{os}" do 144 | let (:facts) do 145 | facts.merge!(OSDefaults.get_facts()) 146 | end 147 | 148 | it_behaves_like 'openstack_extras::auth_file' 149 | end 150 | end 151 | end 152 | -------------------------------------------------------------------------------- /spec/classes/openstack_extras_repo_debian_debian_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'openstack_extras::repo::debian::debian' do 4 | shared_examples 'openstack_extras::repo::debian::debian' do 5 | let :class_params do 6 | { 7 | :manage_deb => true, 8 | :source_hash => {}, 9 | :source_defaults => {}, 10 | :package_require => false, 11 | :use_extrepo => false, 12 | } 13 | end 14 | 15 | let :paramclass_defaults do 16 | { 17 | :release => 'epoxy' 18 | } 19 | end 20 | 21 | let :default_params do 22 | class_params.merge!(paramclass_defaults) 23 | end 24 | 25 | context 'with default params' do 26 | it { should contain_exec('/usr/bin/extrepo enable openstack_epoxy').with( 27 | :command => "/bin/true # comment to satisfy puppet syntax requirements 28 | apt-get update 29 | apt-get install -y extrepo 30 | extrepo enable openstack_epoxy 31 | apt-get update 32 | ", 33 | )} 34 | end 35 | 36 | context 'wallaby with extrepo' do 37 | let :params do 38 | { 39 | :release => 'wallaby', 40 | :use_extrepo => true, 41 | } 42 | end 43 | it { should contain_exec('/usr/bin/extrepo enable openstack_wallaby').with( 44 | :command => "/bin/true # comment to satisfy puppet syntax requirements 45 | apt-get update 46 | apt-get install -y extrepo 47 | extrepo enable openstack_wallaby 48 | apt-get update 49 | ", 50 | )} 51 | end 52 | 53 | context 'with extrepo set to false' do 54 | let :params do 55 | { 56 | :use_extrepo => false, 57 | } 58 | end 59 | 60 | it { should contain_apt__source('debian-openstack-backports').with( 61 | :location => "http://#{facts[:os]['distro']['codename']}-epoxy.debian.net/debian", 62 | :release => "#{facts[:os]['distro']['codename']}-epoxy-backports", 63 | :repos => 'main', 64 | )} 65 | 66 | it { should contain_apt__source('debian-openstack-backports-nochange').with( 67 | :location => "http://#{facts[:os]['distro']['codename']}-epoxy.debian.net/debian", 68 | :release => "#{facts[:os]['distro']['codename']}-epoxy-backports-nochange", 69 | :repos => 'main' 70 | )} 71 | 72 | it { should contain_exec('installing openstack-backports-archive-keyring') } 73 | end 74 | 75 | context 'with overridden release' do 76 | let :params do 77 | default_params.merge!({ :release => 'pike' }) 78 | end 79 | 80 | it { should contain_apt__source('debian-openstack-backports').with( 81 | :location => "http://#{facts[:os]['distro']['codename']}-pike.debian.net/debian", 82 | :release => "#{facts[:os]['distro']['codename']}-pike-backports", 83 | :repos => 'main', 84 | )} 85 | 86 | it { should contain_apt__source('debian-openstack-backports-nochange').with( 87 | :location => "http://#{facts[:os]['distro']['codename']}-pike.debian.net/debian", 88 | :release => "#{facts[:os]['distro']['codename']}-pike-backports-nochange", 89 | :repos => 'main' 90 | )} 91 | 92 | it { should contain_exec('installing openstack-backports-archive-keyring') } 93 | end 94 | 95 | context 'when not managing openstack repo' do 96 | let :params do 97 | default_params.merge!({ :manage_deb => false }) 98 | end 99 | 100 | it { should_not contain_exec('installing openstack-backports-archive-keyring') } 101 | end 102 | 103 | context 'with overridden source hash' do 104 | let :params do 105 | default_params.merge!({ 106 | :source_hash => { 107 | 'debian_unstable' => { 108 | 'location' => 'http://mymirror/debian/', 109 | 'repos' => 'main', 110 | 'release' => 'unstable' 111 | }, 112 | 'puppetlabs' => { 113 | 'location' => 'http://apt.puppetlabs.com', 114 | 'repos' => 'main', 115 | 'release' => facts[:os]['distro']['codename'], 116 | 'key' => { 'id' => '4BD6EC30', 'server' => 'pgp.mit.edu' } 117 | } 118 | }, 119 | :use_extrepo => false 120 | }) 121 | end 122 | 123 | it { should contain_apt__source('debian_unstable').with( 124 | :location => 'http://mymirror/debian/', 125 | :release => 'unstable', 126 | :repos => 'main', 127 | )} 128 | 129 | it { should contain_apt__source('puppetlabs').with( 130 | :location => 'http://apt.puppetlabs.com', 131 | :repos => 'main', 132 | :release => facts[:os]['distro']['codename'], 133 | :key => { 'id' => '4BD6EC30', 'server' => 'pgp.mit.edu' }, 134 | )} 135 | 136 | it { should contain_exec('installing openstack-backports-archive-keyring') } 137 | end 138 | 139 | context 'with overridden source default' do 140 | let :params do 141 | default_params.merge!({ 142 | :source_hash => { 143 | 'debian_unstable' => { 144 | 'location' => 'http://mymirror/debian/', 145 | 'repos' => 'main', 146 | 'release' => 'unstable' 147 | }, 148 | }, 149 | :source_defaults => { 150 | 'include' => { 'src' => true } 151 | }, 152 | :use_extrepo => false 153 | }) 154 | end 155 | 156 | it { should contain_apt__source('debian_unstable').with( 157 | :include => { 'src' => true }, 158 | :location => 'http://mymirror/debian/', 159 | :release => 'unstable', 160 | :repos => 'main', 161 | )} 162 | 163 | it { should contain_exec('installing openstack-backports-archive-keyring') } 164 | end 165 | end 166 | 167 | on_supported_os({ 168 | :supported_os => OSDefaults.get_supported_os 169 | }).each do |os,facts| 170 | context "on #{os}" do 171 | let (:facts) do 172 | facts.merge!(OSDefaults.get_facts()) 173 | end 174 | 175 | if facts[:os]['name'] == 'Debian' 176 | it_behaves_like 'openstack_extras::repo::debian::debian' 177 | end 178 | end 179 | end 180 | end 181 | -------------------------------------------------------------------------------- /spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'openstack_extras::repo::debian::ubuntu' do 4 | shared_examples 'openstack_extras::repo::debian::ubuntu' do 5 | let :class_params do 6 | { 7 | :manage_uca => true, 8 | :source_hash => {}, 9 | :source_defaults => {}, 10 | :package_require => false 11 | } 12 | end 13 | 14 | let :paramclass_defaults do 15 | { 16 | :release => 'epoxy' 17 | } 18 | end 19 | 20 | let :default_params do 21 | class_params.merge!(paramclass_defaults) 22 | end 23 | 24 | context 'with default parameters' do 25 | let :params do 26 | {} 27 | end 28 | 29 | it { should contain_apt__source('ubuntu-cloud-archive').with( 30 | :location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu', 31 | :release => "#{facts[:os]['distro']['codename']}-updates/epoxy", 32 | :repos => 'main', 33 | )} 34 | 35 | it { should contain_exec('installing ubuntu-cloud-keyring') } 36 | end 37 | 38 | context 'with overridden release' do 39 | let :params do 40 | default_params.merge!({ :release => 'juno' }) 41 | end 42 | 43 | it { should contain_apt__source('ubuntu-cloud-archive').with( 44 | :location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu', 45 | :release => "#{facts[:os]['distro']['codename']}-updates/juno", 46 | :repos => 'main', 47 | )} 48 | 49 | it { should contain_exec('installing ubuntu-cloud-keyring') } 50 | end 51 | 52 | context 'when not managing UCA' do 53 | let :params do 54 | default_params.merge!({ :manage_uca => false }) 55 | end 56 | 57 | it { should_not contain_exec('installing ubuntu-cloud-keyring') } 58 | end 59 | 60 | context 'with overridden source hash' do 61 | let :params do 62 | default_params.merge!({ 63 | :source_hash => { 64 | 'local_mirror' => { 65 | 'location' => 'http://mymirror/ubuntu/', 66 | 'repos' => 'main', 67 | 'release' => facts[:os]['distro']['codename'], 68 | }, 69 | 'puppetlabs' => { 70 | 'location' => 'http://apt.puppetlabs.com', 71 | 'repos' => 'main', 72 | 'release' => facts[:os]['distro']['codename'], 73 | 'key' => { 74 | 'id' => '4BD6EC30', 'server' => 'pgp.mit.edu' 75 | } 76 | } 77 | } 78 | }) 79 | end 80 | 81 | it { should contain_apt__source('local_mirror').with( 82 | :location => 'http://mymirror/ubuntu/', 83 | :release => facts[:os]['distro']['codename'], 84 | :repos => 'main' 85 | )} 86 | 87 | it { should contain_apt__source('puppetlabs').with( 88 | :location => 'http://apt.puppetlabs.com', 89 | :release => facts[:os]['distro']['codename'], 90 | :repos => 'main', 91 | :key => { 'id' => '4BD6EC30', 'server' => 'pgp.mit.edu' } 92 | )} 93 | 94 | it { should contain_exec('installing ubuntu-cloud-keyring') } 95 | end 96 | 97 | context 'with overridden source default' do 98 | let :params do 99 | default_params.merge!({ 100 | :source_hash => { 101 | 'local_mirror' => { 102 | 'location' => 'http://mymirror/ubuntu/', 103 | 'repos' => 'main', 104 | 'release' => facts[:os]['distro']['codename'] 105 | } 106 | }, 107 | :source_defaults => { 108 | 'include' => { 'src' => true } 109 | } 110 | }) 111 | end 112 | 113 | it { should contain_apt__source('local_mirror').with( 114 | :include => { 'src' => true }, 115 | :location => 'http://mymirror/ubuntu/', 116 | :release => facts[:os]['distro']['codename'], 117 | :repos => 'main', 118 | )} 119 | 120 | it { should contain_exec('installing ubuntu-cloud-keyring') } 121 | end 122 | 123 | context 'with overridden uca repo name' do 124 | let :params do 125 | default_params.merge!({ 126 | :repo => 'proposed', 127 | :uca_location => 'http://mirror.dfw.rax.openstack.org/ubuntu-cloud-archive' 128 | }) 129 | end 130 | 131 | it { should contain_apt__source('ubuntu-cloud-archive').with( 132 | :location => 'http://mirror.dfw.rax.openstack.org/ubuntu-cloud-archive', 133 | :release => "#{facts[:os]['distro']['codename']}-proposed/epoxy", 134 | :repos => 'main', 135 | )} 136 | end 137 | end 138 | 139 | on_supported_os({ 140 | :supported_os => OSDefaults.get_supported_os 141 | }).each do |os,facts| 142 | context "on #{os}" do 143 | let (:facts) do 144 | facts.merge!(OSDefaults.get_facts()) 145 | end 146 | 147 | if facts[:os]['name'] == 'Ubuntu' 148 | it_behaves_like 'openstack_extras::repo::debian::ubuntu' 149 | end 150 | end 151 | end 152 | end 153 | -------------------------------------------------------------------------------- /spec/classes/openstack_extras_repo_redhat_redhat_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'openstack_extras::repo::redhat::redhat' do 4 | shared_examples 'openstack_extras::repo::redhat::redhat' do 5 | context 'with default parameters' do 6 | it { should contain_anchor('openstack_extras_redhat') } 7 | 8 | it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud').with( 9 | :source => 'puppet:///modules/openstack_extras/RPM-GPG-KEY-CentOS-SIG-Cloud', 10 | :owner => 'root', 11 | :group => 'root', 12 | :mode => '0644', 13 | :before => 'Anchor[openstack_extras_redhat]', 14 | )} 15 | it { should contain_yumrepo('rdo-release').with( 16 | :baseurl => "http://mirror.stream.centos.org/SIGs/$stream/cloud/$basearch/openstack-epoxy/", 17 | :descr => "OpenStack Epoxy Repository", 18 | :gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud', 19 | :enabled => '1', 20 | :gpgcheck => '1', 21 | :mirrorlist => 'absent', 22 | :module_hotfixes => true, 23 | :notify => 'Exec[yum_refresh]', 24 | :require => 'Anchor[openstack_extras_redhat]', 25 | )} 26 | 27 | it { should_not contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}") } 28 | it { should_not contain_yumrepo('epel') } 29 | 30 | it { should_not contain_resources('yumrepo').with_purge(true) } 31 | 32 | it { should contain_exec('yum_refresh').with( 33 | :command => '/usr/bin/dnf clean all', 34 | :refreshonly => true, 35 | )} 36 | 37 | it { should_not contain_exec('yum_update') } 38 | end 39 | 40 | context 'with parameters' do 41 | let :params do 42 | { 43 | :manage_rdo => false, 44 | :manage_epel => true, 45 | :purge_unmanaged => true, 46 | :package_require => true, 47 | :update_packages => true, 48 | } 49 | end 50 | 51 | it { should contain_anchor('openstack_extras_redhat') } 52 | 53 | it { should_not contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud') } 54 | it { should_not contain_yumrepo('rdo-release') } 55 | 56 | it { should contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}").with( 57 | :source => "puppet:///modules/openstack_extras/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}", 58 | :owner => 'root', 59 | :group => 'root', 60 | :mode => '0644', 61 | :before => 'Anchor[openstack_extras_redhat]', 62 | )} 63 | 64 | it { should contain_yumrepo('epel').with( 65 | :metalink => "https://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=\$basearch", 66 | :descr => "Extra Packages for Enterprise Linux #{facts[:os]['release']['major']} - \$basearch", 67 | :gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}", 68 | :failovermethod => 'priority', 69 | :enabled => '1', 70 | :gpgcheck => '1', 71 | :mirrorlist => 'absent', 72 | :notify => 'Exec[yum_refresh]', 73 | :require => 'Anchor[openstack_extras_redhat]', 74 | )} 75 | 76 | it { should contain_resources('yumrepo').with_purge(true) } 77 | 78 | it { should contain_exec('yum_refresh').with( 79 | :command => '/usr/bin/dnf clean all', 80 | :refreshonly => true, 81 | )} 82 | 83 | it { should contain_exec('yum_update').with( 84 | :command => '/usr/bin/dnf update -y', 85 | :refreshonly => true, 86 | :timeout => 600, 87 | )} 88 | end 89 | 90 | context 'with update_timeout' do 91 | let :params do 92 | { 93 | :update_packages => true, 94 | :update_timeout => 1200, 95 | } 96 | end 97 | 98 | 99 | it { should contain_exec('yum_update').with( 100 | :command => '/usr/bin/dnf update -y', 101 | :refreshonly => true, 102 | :timeout => 1200, 103 | )} 104 | end 105 | 106 | context 'with overridden release' do 107 | let :params do 108 | { 109 | :release => 'juno', 110 | :manage_rdo => true, 111 | } 112 | end 113 | 114 | it { should contain_yumrepo('rdo-release').with( 115 | :baseurl => "http://mirror.stream.centos.org/SIGs/$stream/cloud/$basearch/openstack-juno/", 116 | :descr => 'OpenStack Juno Repository', 117 | )} 118 | end 119 | 120 | context 'with centos_mirror_url' do 121 | let :params do 122 | { 123 | :manage_rdo => true, 124 | :centos_mirror_url => 'http://foo.bar', 125 | } 126 | end 127 | 128 | it { should contain_yumrepo('rdo-release').with( 129 | :baseurl => "http://foo.bar/SIGs/$stream/cloud/$basearch/openstack-epoxy/", 130 | )} 131 | end 132 | 133 | context 'with repo_defaults and gpgkey_defaults' do 134 | let :params do 135 | { 136 | :manage_rdo => true, 137 | :manage_epel => true, 138 | :repo_hash => { 139 | 'CentOS-Example' => { 140 | 'baseurl' => 'http://example.com/$releasever/os/$basearch/', 141 | 'descr' => 'CentOS-$releasever - Example', 142 | 'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Example', 143 | }, 144 | }, 145 | :gpgkey_hash => { 146 | '/etc/pki/rpm-gpg/RPM-GPG-KEY-Example' => { 147 | 'source' => 'puppet:///modules/openstack_extras/RPM-GPG-KEY-Example', 148 | } 149 | }, 150 | :repo_defaults => { 151 | 'proxy' => 'http://example.com:8000', 152 | }, 153 | :gpgkey_defaults => { 154 | 'owner' => 'steve', 155 | 'force' => true, 156 | }, 157 | } 158 | end 159 | 160 | it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud').with( 161 | :owner => 'steve', 162 | :group => 'root', 163 | :mode => '0644', 164 | :force => true, 165 | :before => 'Anchor[openstack_extras_redhat]', 166 | )} 167 | 168 | it { should contain_yumrepo('rdo-release').with( 169 | :enabled => '1', 170 | :gpgcheck => '1', 171 | :mirrorlist => 'absent', 172 | :proxy => 'http://example.com:8000', 173 | :notify => 'Exec[yum_refresh]', 174 | :require => 'Anchor[openstack_extras_redhat]', 175 | )} 176 | 177 | it { should contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}").with( 178 | :owner => 'steve', 179 | :group => 'root', 180 | :mode => '0644', 181 | :force => true, 182 | :before => 'Anchor[openstack_extras_redhat]', 183 | )} 184 | 185 | it { should contain_yumrepo('epel').with( 186 | :enabled => '1', 187 | :gpgcheck => '1', 188 | :mirrorlist => 'absent', 189 | :proxy => 'http://example.com:8000', 190 | :notify => 'Exec[yum_refresh]', 191 | :require => 'Anchor[openstack_extras_redhat]', 192 | )} 193 | 194 | it { should contain_yumrepo('CentOS-Example').with( 195 | :enabled => '1', 196 | :gpgcheck => '1', 197 | :mirrorlist => 'absent', 198 | :proxy => 'http://example.com:8000', 199 | :notify => 'Exec[yum_refresh]', 200 | :require => 'Anchor[openstack_extras_redhat]', 201 | )} 202 | 203 | it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-Example').with( 204 | :owner => 'steve', 205 | :group => 'root', 206 | :mode => '0644', 207 | :force => true, 208 | :before => 'Anchor[openstack_extras_redhat]', 209 | )} 210 | end 211 | 212 | context 'with overridden repo_hash and gpgkey_hash' do 213 | let :params do 214 | { 215 | :repo_hash => { 216 | 'CentOS-Base' => { 217 | 'baseurl' => 'http://mymirror/$releasever/os/$basearch/', 218 | 'descr' => 'CentOS-$releasever - Base', 219 | 'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS', 220 | }, 221 | 'CentOS-Updates' => { 222 | 'baseurl' => 'http://mymirror/$releasever/updates/$basearch/', 223 | 'descr' => 'CentOS-$releasever - Updates', 224 | 'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS', 225 | } 226 | }, 227 | :gpgkey_hash => { 228 | '/etc/pki/rpm-gpg/RPM-GPG-KEY-Something' => { 229 | 'source' => 'puppet:///modules/openstack_extras/RPM-GPG-KEY-Something', 230 | } 231 | }, 232 | } 233 | end 234 | 235 | it { should contain_yumrepo('CentOS-Base').with( 236 | :baseurl => 'http://mymirror/$releasever/os/$basearch/', 237 | :descr => 'CentOS-$releasever - Base', 238 | :enabled => '1', 239 | :gpgcheck => '1', 240 | :gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS', 241 | :mirrorlist => 'absent', 242 | :notify => 'Exec[yum_refresh]', 243 | :require => 'Anchor[openstack_extras_redhat]', 244 | )} 245 | 246 | it { should contain_yumrepo('CentOS-Updates').with( 247 | :baseurl => "http://mymirror/$releasever/updates/$basearch/", 248 | :descr => "CentOS-$releasever - Updates", 249 | :enabled => '1', 250 | :gpgcheck => '1', 251 | :gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS', 252 | :mirrorlist => 'absent', 253 | :notify => 'Exec[yum_refresh]', 254 | :require => 'Anchor[openstack_extras_redhat]', 255 | )} 256 | 257 | it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-Something').with( 258 | :source => 'puppet:///modules/openstack_extras/RPM-GPG-KEY-Something', 259 | :owner => 'root', 260 | :group => 'root', 261 | :mode => '0644', 262 | :before => 'Anchor[openstack_extras_redhat]', 263 | )} 264 | end 265 | 266 | context 'with repo_source_hash' do 267 | let :params do 268 | { 269 | :repo_source_hash => { 270 | 'delorean.repo' => 'https://trunk.rdoproject.org/centos/puppet-passed-ci/delorean.repo', 271 | 'delorean-deps.repo' => 'https://trunk.rdoproject.org/centos/delorean-deps.repo', 272 | }, 273 | } 274 | end 275 | 276 | it { should contain_file('delorean.repo').with( 277 | :path => '/etc/yum.repos.d/delorean.repo', 278 | :source => 'https://trunk.rdoproject.org/centos/puppet-passed-ci/delorean.repo', 279 | :replace => true, 280 | :notify => 'Exec[yum_refresh]', 281 | )} 282 | 283 | it { should contain_file('delorean-deps.repo').with( 284 | :path => '/etc/yum.repos.d/delorean-deps.repo', 285 | :source => 'https://trunk.rdoproject.org/centos/delorean-deps.repo', 286 | :replace => true, 287 | :notify => 'Exec[yum_refresh]', 288 | )} 289 | end 290 | 291 | context 'with repo_source_hash and repo_replace is false' do 292 | let :params do 293 | { 294 | :repo_source_hash => { 295 | 'thing.repo' => 'https://trunk.rdoproject.org/some/thing.repo', 296 | }, 297 | :repo_replace => false, 298 | } 299 | end 300 | 301 | it { should contain_file('thing.repo').with( 302 | :path => '/etc/yum.repos.d/thing.repo', 303 | :source => 'https://trunk.rdoproject.org/some/thing.repo', 304 | :replace => false, 305 | :notify => 'Exec[yum_refresh]', 306 | )} 307 | end 308 | end 309 | 310 | on_supported_os({ 311 | :supported_os => OSDefaults.get_supported_os 312 | }).each do |os,facts| 313 | context "on #{os}" do 314 | let (:facts) do 315 | facts.merge!(OSDefaults.get_facts()) 316 | end 317 | 318 | if facts[:os]['family'] == 'RedHat' 319 | it_behaves_like 'openstack_extras::repo::redhat::redhat' 320 | end 321 | end 322 | end 323 | end 324 | -------------------------------------------------------------------------------- /spec/functions/validate_yum_hash_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'validate_yum_hash' do 4 | it 'exists' do 5 | is_expected.not_to eq(nil) 6 | end 7 | 8 | it 'throws error with more than one argument' do 9 | is_expected.to run.with_params({'title' => {'key1' => 'value1'}, 'title2' => {'key2' => 'value2'}}).and_raise_error(Puppet::Error) 10 | end 11 | 12 | it 'fails with no arguments' do 13 | is_expected.to run.with_params.and_raise_error(Puppet::Error) 14 | end 15 | 16 | it 'fails with invalid hash' do 17 | is_expected.to run.with_params({'title' => {'invalid' => 'val'}}).and_raise_error(Puppet::Error) 18 | end 19 | 20 | it 'fails with invalid hash with multiple entries' do 21 | is_expected.to run.with_params({'title' => {'baseurl' => 'placeholder', 'invalid' => 'val'}}).and_raise_error(Puppet::Error) 22 | end 23 | 24 | it 'works with valid entry' do 25 | is_expected.to run.with_params({'title' => {'baseurl' => 'placeholder'}}) 26 | end 27 | 28 | it 'works with multiple valid entries' do 29 | is_expected.to run.with_params({'title' => {'baseurl' => 'placeholder', 'timeout' => 30}}) 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /spec/shared_examples.rb: -------------------------------------------------------------------------------- 1 | shared_examples_for "a Puppet::Error" do |description| 2 | it "with message matching #{description.inspect}" do 3 | expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'puppetlabs_spec_helper/module_spec_helper' 2 | require 'shared_examples' 3 | require 'puppet-openstack_spec_helper/facts' 4 | 5 | fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures')) 6 | 7 | RSpec.configure do |c| 8 | c.alias_it_should_behave_like_to :it_configures, 'configures' 9 | c.alias_it_should_behave_like_to :it_raises, 'raises' 10 | 11 | c.module_path = File.join(fixture_path, 'modules') 12 | end 13 | 14 | at_exit { RSpec::Puppet::Coverage.report! } 15 | -------------------------------------------------------------------------------- /spec/spec_helper_acceptance.rb: -------------------------------------------------------------------------------- 1 | require 'puppet-openstack_spec_helper/litmus_spec_helper' 2 | -------------------------------------------------------------------------------- /templates/openrc.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | <% if @service_token -%> 3 | export OS_SERVICE_TOKEN='<%= @service_token.gsub(/'/){ %q(\') } %>' 4 | export OS_SERVICE_ENDPOINT='<%= @service_endpoint %>' 5 | <% end -%> 6 | export OS_NO_CACHE='<%= @use_no_cache %>' 7 | <% if @project_name -%> 8 | export OS_PROJECT_NAME='<%= @project_name %>' 9 | <% end -%> 10 | export OS_USERNAME='<%= @username %>' 11 | export OS_PASSWORD='<%= @password.gsub(/'/){ %q(\') } %>' 12 | export OS_AUTH_URL='<%= @auth_url %>' 13 | export OS_AUTH_STRATEGY='<%= @auth_strategy %>' 14 | export OS_REGION_NAME='<%= @region_name %>' 15 | <% if @project_domain_name -%> 16 | export OS_PROJECT_DOMAIN_NAME='<%= @project_domain_name %>' 17 | <% end -%> 18 | <% if @user_domain_name -%> 19 | export OS_USER_DOMAIN_NAME='<%= @user_domain_name %>' 20 | <% end -%> 21 | <% if @auth_type -%> 22 | export OS_AUTH_TYPE='<%= @auth_type %>' 23 | <% end -%> 24 | export OS_INTERFACE='<%= @os_interface %>' 25 | export OS_ENDPOINT_TYPE='<%= @os_endpoint_type %>' 26 | export CINDER_ENDPOINT_TYPE='<%= @cinder_endpoint_type %>' 27 | export GLANCE_ENDPOINT_TYPE='<%= @glance_endpoint_type %>' 28 | export KEYSTONE_ENDPOINT_TYPE='<%= @keystone_endpoint_type %>' 29 | export NOVA_ENDPOINT_TYPE='<%= @nova_endpoint_type %>' 30 | export NEUTRON_ENDPOINT_TYPE='<%= @neutron_endpoint_type %>' 31 | <% if @compute_api_version -%> 32 | export OS_COMPUTE_API_VERSION='<%= @compute_api_version %>' 33 | <% end -%> 34 | <% if @network_api_version -%> 35 | export OS_NETWORK_API_VERSION='<%= @network_api_version %>' 36 | <% end -%> 37 | <% if @image_api_version -%> 38 | export OS_IMAGE_API_VERSION='<%= @image_api_version %>' 39 | <% end -%> 40 | <% if @volume_api_version -%> 41 | export OS_VOLUME_API_VERSION='<%= @volume_api_version %>' 42 | <% end -%> 43 | <% if @identity_api_version -%> 44 | export OS_IDENTITY_API_VERSION='<%= @identity_api_version %>' 45 | <% end -%> 46 | <% if @object_api_version -%> 47 | export OS_OBJECT_API_VERSION='<%= @object_api_version %>' 48 | <% end -%> 49 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | minversion = 3.1 3 | skipsdist = True 4 | envlist = releasenotes 5 | ignore_basepython_conflict = True 6 | 7 | [testenv] 8 | basepython = python3 9 | install_command = pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} 10 | 11 | [testenv:releasenotes] 12 | deps = -r{toxinidir}/doc/requirements.txt 13 | commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html 14 | --------------------------------------------------------------------------------