Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rspec] Adopt Hiera v3 lookups with RSpec tests
By design the SSH profile class, 'profiles::ssh', configures the OpenSSH server to accept public key authentication as the *only* mechanism for authentication. This constraint requires the user to provide either (or both) public key(s) or explicitly enable traditional password authentication. To satisfy Hiera lookups (as opposed to purely 'fact' based references) RSpec tests now have their own respective Hiera hierarchy defined at: 'site/profiles/fixtures/hiera.yaml'. All existing (and future) RSpec tests will now perform "Automatic Parameter Lookups" only falling back to in-class default values should the corresponding key not be found. The 'datadir' path to the RSpec test directory is relative to the 'Profiles' module's 'root' directory: 'site/profiles'. As of this commit the "data-in-module" pattern is not currently utilised for class default values and consequently dedicated RSpec specific Hiera data files are consumed. Unfortunately Hiera v3 had to be adopted as the Ruby gem 'rspec-puppet' utilised by `pdk` is unable to parse Hiera v5 configuration file syntax. Related links regarding Hiera v3 & puppet-rspec limitations: * rodjek/rspec-puppet#762 * rodjek/rspec-puppet#551 * https://tickets.puppetlabs.com/browse/HI-598
- Loading branch information