diff --git a/.onceover/Rakefile b/.onceover/Rakefile new file mode 100644 index 0000000..d22c5c9 --- /dev/null +++ b/.onceover/Rakefile @@ -0,0 +1,6 @@ +require 'puppetlabs_spec_helper/rake_tasks' + +desc "Run acceptance tests" +RSpec::Core::RakeTask.new(:acceptance) do |t| + t.pattern = 'spec/acceptance' +end \ No newline at end of file diff --git a/.onceover/etc/puppetlabs/code/environments/production/.gitignore b/.onceover/etc/puppetlabs/code/environments/production/.gitignore new file mode 100644 index 0000000..39781c2 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/.gitignore @@ -0,0 +1,2 @@ +modules/ +.onceover diff --git a/.onceover/etc/puppetlabs/code/environments/production/.onceover_manifest.json b/.onceover/etc/puppetlabs/code/environments/production/.onceover_manifest.json new file mode 100644 index 0000000..1aa8e18 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/.onceover_manifest.json @@ -0,0 +1 @@ +[".git",".gitignore",".onceover","CODEOWNERS","Gemfile","LICENSE","Puppetfile","README.md","Rakefile","data","data/common.yaml","data/environments","data/environments/test.yaml","data/nodes","data/nodes/example-node.yaml","data/nodes/peadm-01.pe.yaml","data/nodes/puppet.home.yaml","data/nodes/puppet.plaform9.puppet.net","data/secrets","data/secrets/node","data/secrets/node/peadm-01.pe.eyaml","data/secrets/node/puppet.home.eyaml","environment.conf","hiera.yaml","manifests","manifests/site.pp","scripts","scripts/config_version-r10k.rb","scripts/config_version-rugged.rb","scripts/config_version.sh","site-modules","site-modules/custom_files","site-modules/custom_files/7z1900-x64.exe","site-modules/custom_files/master.zip","site-modules/profile","site-modules/profile/.fixtures.yml","site-modules/profile/.gitattributes","site-modules/profile/.gitignore","site-modules/profile/.gitlab-ci.yml","site-modules/profile/.pdkignore","site-modules/profile/.puppet-lint.rc","site-modules/profile/.rspec","site-modules/profile/.rubocop.yml","site-modules/profile/.travis.yml","site-modules/profile/.vscode","site-modules/profile/.vscode/extensions.json","site-modules/profile/.yardopts","site-modules/profile/CHANGELOG.md","site-modules/profile/Gemfile","site-modules/profile/Gemfile.lock","site-modules/profile/README.md","site-modules/profile/Rakefile","site-modules/profile/appveyor.yml","site-modules/profile/bin","site-modules/profile/bin/metadata-json-lint","site-modules/profile/bin/puppet","site-modules/profile/bin/puppet-lint","site-modules/profile/bin/rubocop","site-modules/profile/data","site-modules/profile/data/common.yaml","site-modules/profile/hiera.yaml","site-modules/profile/manifests","site-modules/profile/manifests/base","site-modules/profile/manifests/base/motd.pp","site-modules/profile/manifests/base/resolv.pp","site-modules/profile/manifests/base/selinux.pp","site-modules/profile/manifests/base/ssh.pp","site-modules/profile/manifests/base/time.pp","site-modules/profile/manifests/base.pp","site-modules/profile/manifests/custom_windows","site-modules/profile/manifests/custom_windows/config_server.pp","site-modules/profile/manifests/custom_windows/define_user.pp","site-modules/profile/manifests/custom_windows/deploy_iis.pp","site-modules/profile/manifests/custom_windows/install_package.pp","site-modules/profile/manifests/custom_windows.pp","site-modules/profile/manifests/monitor.pp","site-modules/profile/manifests/patching","site-modules/profile/manifests/patching/patch_unix.pp","site-modules/profile/manifests/puppetserver","site-modules/profile/manifests/puppetserver/authority.pp","site-modules/profile/manifests/puppetserver/bootstrap.pp","site-modules/profile/manifests/puppetserver/nfs_export.pp","site-modules/profile/manifests/puppetserver.pp","site-modules/profile/manifests/tools","site-modules/profile/manifests/tools/docker_install.pp","site-modules/profile/manifests/tools/metrics_dashboard.pp","site-modules/profile/manifests/tools/nfs_mount.pp","site-modules/profile/manifests/windows","site-modules/profile/manifests/windows/account.pp","site-modules/profile/manifests/windows/base.pp","site-modules/profile/manifests/windows/chocolatey.pp","site-modules/profile/manifests/windows.pp","site-modules/profile/metadata.json","site-modules/profile/spec","site-modules/profile/spec/default_facts.yml","site-modules/profile/spec/spec_helper.rb","site-modules/role","site-modules/role/manifests","site-modules/role/manifests/custom_winodws.pp","site-modules/role/manifests/monitoring.pp","site-modules/role/manifests/node.pp","site-modules/role/manifests/puppetserver.pp","site-modules/role/manifests/windows.pp","spec","spec/factsets","spec/factsets/README.md","spec/onceover.yaml","spec/pre_conditions","spec/pre_conditions/README.md"] \ No newline at end of file diff --git a/.onceover/etc/puppetlabs/code/environments/production/CODEOWNERS b/.onceover/etc/puppetlabs/code/environments/production/CODEOWNERS new file mode 100644 index 0000000..d5aef52 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/CODEOWNERS @@ -0,0 +1 @@ +* @cs-arch diff --git a/.onceover/etc/puppetlabs/code/environments/production/Gemfile b/.onceover/etc/puppetlabs/code/environments/production/Gemfile new file mode 100644 index 0000000..1d7df03 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'onceover' diff --git a/.onceover/etc/puppetlabs/code/environments/production/LICENSE b/.onceover/etc/puppetlabs/code/environments/production/LICENSE new file mode 100644 index 0000000..8f71f43 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/.onceover/etc/puppetlabs/code/environments/production/Puppetfile b/.onceover/etc/puppetlabs/code/environments/production/Puppetfile new file mode 100644 index 0000000..ad00320 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/Puppetfile @@ -0,0 +1,63 @@ +forge 'https://forge.puppet.com' + +# Modules from the Puppet Forge +# Versions should be updated to be the latest at the time you start +mod 'puppetlabs/inifile', '4.0.0' +mod 'puppetlabs/stdlib', '6.2.0' +mod 'puppetlabs/concat', '6.1.0' +mod 'danieldreier-autosign', '0.2.0' +mod 'puppetlabs-package', '1.1.0' +mod 'puppetlabs-service', '1.2.0' +mod 'puppetlabs-ntp', '8.2.0' +mod 'puppetlabs-apache', '5.3.0' +mod 'ghoneycutt-ssh', '3.61.0' +mod 'puppet-selinux', '3.1.0' +mod 'puppetlabs-puppetserver_gem', '1.1.1' +mod 'puppetlabs-motd', '4.0.0' +mod 'puppetlabs-bootstrap', '2.0.0' +mod 'puppetlabs-windows', '6.1.0' +mod 'puppetlabs-registry', '3.1.0' +mod 'puppetlabs-powershell', '3.0.1' +mod 'puppet-windowsfeature', '3.2.2' +mod 'puppetlabs-chocolatey', '5.0.2' +mod 'puppetlabs-wsus_client', '3.1.0' +mod 'puppetlabs-accounts', '6.1.0' +mod 'puppetlabs-dism', '1.3.1' +mod 'puppetlabs-dsc', '1.9.4' +mod 'puppetlabs-dsc_lite', '3.0.1' +mod 'puppetlabs-acl', '3.1.0' +mod 'puppetlabs-iis', '7.0.0' +mod 'puppetlabs-pwshlib', '0.4.0' +mod 'puppet-archive', '4.4.0' +mod 'puppet-staging', '3.2.0' +mod 'puppetlabs-reboot', '2.4.0' +mod 'albatrossflavour-os_patching', '0.13.0' +mod 'fervid-secure_linux_cis', '2.1.10' +mod 'puppetlabs-puppet_metrics_collector', '5.3.0' +mod 'puppetlabs-puppet_metrics_dashboard', '2.0.1' +mod 'dylanratcliffe-facter_cache', '1.2.0' +mod 'puppetlabs-support_tasks', '1.1.1' +mod 'puppetlabs-puppet_agent', '3.0.2' +mod 'puppetlabs-apt', '7.4.1' +mod 'puppetlabs-translate', '2.2.0' +mod 'puppet-grafana', '6.1.0' +mod 'puppet-telegraf', '3.0.0' +mod 'derdanne-nfs', '2.1.2' +mod 'herculesteam-augeasproviders_core', '2.6.0' +mod 'herculesteam-augeasproviders_shellvar', '4.0.0' +mod 'puppetlabs-transition', '0.1.3' +mod 'puppetlabs-docker', '3.9.1' + +# Modules from Git +# Examples: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#examples +# mod 'apache', +# git: 'https://github.com/puppetlabs/puppetlabs-apache', +# commit: '1b6f89afdde0df7f9433a163d5c4b5328eac5779' + +# mod 'apache', +# git: 'https://github.com/puppetlabs/puppetlabs-apache', +# branch: 'docs_experiment' + +mod 'saz-resolv_conf', + :git => 'https://github.com/saz/puppet-resolv_conf.git', + :ref => 'v4.1.0' diff --git a/.onceover/etc/puppetlabs/code/environments/production/README.md b/.onceover/etc/puppetlabs/code/environments/production/README.md new file mode 100644 index 0000000..808091f --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/README.md @@ -0,0 +1,119 @@ +# A Puppet Control Repository + +* [What You Get From This control\-repo](#what-you-get-from-this-control-repo) +* [Copy This Repo Into Your Own Git Server](#copy-this-repo-into-your-own-git-server) + * [GitLab](#gitlab) + * [Bitbucket/Stash](#bitbucketstash) + * [Github](#github) +* [Code Manager Setup](#code-manager-setup) + + +## What You Get From This control-repo + +This is a template [control repository](https://puppet.com/docs/pe/latest/code_management/control_repo.html) that has the minimum amount of scaffolding to make it easy to get started with [r10k](https://puppet.com/docs/pe/latest/code_management/r10k.html) or Puppet Enterprise's [Code Manager](https://puppet.com/docs/pe/latest/code_management/code_mgr.html). + +The important files and items in this template are as follows: + +* Basic example of roles and profiles. +* An example Puppetfile with various module references. +* An example Hiera configuration file and data directory with pre-created common.yaml and nodes directory. + * These match the default hierarchy that ships with PE. +* An [environment.conf](https://puppet.com/docs/puppet/5.3/config_file_environment.html) that correctly implements: + * A site-modules directory for roles, profiles, and any custom modules for your organization. + * A config\_version script. +* An example [config\_version](https://puppet.com/docs/puppet/5.3/config_file_environment.html#configversion) script that outputs the git commit ID of the code that was used during a Puppet run. + +Here's a visual representation of the structure of this repository: + +``` +control-repo/ +├── data/ # Hiera data directory. +│   ├── nodes/ # Node-specific data goes here. +│   └── common.yaml # Common data goes here. +├── manifests/ +│   └── site.pp # The "main" manifest that contains a default node definition. +├── scripts/ +│   ├── code_manager_config_version.rb # A config_version script for Code Manager. +│   ├── config_version.rb # A config_version script for r10k. +│   └── config_version.sh # A wrapper that chooses the appropriate config_version script. +├── site-modules/ # This directory contains site-specific modules and is added to $modulepath. +│   ├── profile/ # The profile module. +│   └── role/ # The role module. +├── LICENSE +├── Puppetfile # A list of external Puppet modules to deploy with an environment. +├── README.md +├── environment.conf # Environment-specific settings. Configures the modulepath and config_version. +└── hiera.yaml # Hiera's configuration file. The Hiera hierarchy is defined here. +``` + +## Copy This Repo Into Your Own Git Server + +To get started with using the control-repo template in your own environment and git server, we've provided steps for the three most common servers we see: [GitLab](#gitlab), [BitBucket](#bitbucketstash), and [GitHub](#github). + +### GitLab + +1. Install GitLab. + * +1. After GitLab is installed you may sign in with the `root` user and password `5iveL!fe`. +1. Make a user for yourself. +1. Make an SSH key to link with your user. You’ll want to do this on the machine you intend to edit code from (most likely not your Puppet master, but your local workstation or laptop). + * + * +1. Create a group called `puppet` (this is case sensitive). + * +1. Add your user to the `puppet` group as well. +1. Create a project called `control-repo`, and set the Namespace to be the `puppet` group. +1. Clone this control repository to your laptop/workstation: + * `git clone ` + * `cd control-repo` +1. Remove this repository as the origin remote: + * `git remote remove origin` +1. Add your internal repository as the origin remote: + * `git remote add origin ` +1. Push the production branch of the repository from your machine up to your git server + * `git push origin production` + +### Bitbucket/Stash + +1. Install Bitbucket + * +1. Make a `Project` called `puppet` (with a short name of `PUP`) +1. Create a repository called `control-repo` +1. Create a user called `r10k` with a password of `puppet`. + * Make the r10k user an admin of the `PUP` project. +1. Either use the admin user to test pushing code, or create a user for yourself and add your SSH key to that user. + * If making a user for yourself, give your user account read/write or admin privilege to the `PUP` project. +1. Clone this control repository to your laptop/workstation + * `git clone ` + * `cd control-repo` +1. Remove this repository as the origin remote + * `git remote remove origin` +1. Add your internal repository as the origin remote + * `git remote add origin ` +1. Push the production branch of the repository from your machine up to your git server + * `git push origin production` + +### GitHub + +1. Prepare your local git client to authenticate with GitHub.com or a local GitHub Enterprise instance. + * + * +1. Create a repository called `control-repo` in your user account or organization. Ensure that "Initialize this repository with a README" is not selected. + * +1. Make a note of your repository URL (HTTPS or SSH, depending on your security configuration). +1. Clone this control repository to your laptop/workstation: + * `git clone ` + * `cd control-repo` +1. Remove this repository as the origin remote: + * `git remote remove origin` +1. Add your internal repository as the origin remote: + * `git remote add origin ` +1. Push the production branch of the repository from your machine up to your git server + * `git push origin production` + +## Code Manager Setup + +If you use Puppet Enterprise and have not yet enabled and configured Code Manager, in addition to reading the official [documentation](https://puppet.com/docs/pe/latest/code_management/code_mgr.html) for enabling it, you may want to look at the Ramp-Up Program's control repository instead of this one. It's similar to this repo except that it has batteries included, so to speak. There are pre-built profiles for configuring Code Manager, generating SSH keys, and setting up your Git server to work with Code Manager. + +* + diff --git a/.onceover/etc/puppetlabs/code/environments/production/Rakefile b/.onceover/etc/puppetlabs/code/environments/production/Rakefile new file mode 100644 index 0000000..d0372d4 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/Rakefile @@ -0,0 +1 @@ +require 'onceover/rake_tasks' diff --git a/.onceover/etc/puppetlabs/code/environments/production/data/common.yaml b/.onceover/etc/puppetlabs/code/environments/production/data/common.yaml new file mode 100644 index 0000000..c9e9852 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/data/common.yaml @@ -0,0 +1,16 @@ +--- +message: "This node is using common data" +profile::base::resolv: true +profile::base::resolv::nameservers: + - '8.8.8.8' + - '127.0.0.1' +profile::base::resolv::domainname: home +profile::base::selinux::mode: true +profile::base::selinux::mode: permissive +profile::base::time: true +profile::base::time::ntp_servers: + - 0.uk.pool.ntp.org + - 1.uk.pool.ntp.org + - 2.uk.pool.ntp.org +profile::base::ssh: true +profile::base::motd: true diff --git a/.onceover/etc/puppetlabs/code/environments/production/data/environments/test.yaml b/.onceover/etc/puppetlabs/code/environments/production/data/environments/test.yaml new file mode 100644 index 0000000..0ba4fa7 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/data/environments/test.yaml @@ -0,0 +1,2 @@ +--- +profile::base::ssh::permit_root_login: 'yes' diff --git a/.onceover/etc/puppetlabs/code/environments/production/data/nodes/example-node.yaml b/.onceover/etc/puppetlabs/code/environments/production/data/nodes/example-node.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/data/nodes/example-node.yaml @@ -0,0 +1 @@ +--- diff --git a/.onceover/etc/puppetlabs/code/environments/production/data/nodes/peadm-01.pe.yaml b/.onceover/etc/puppetlabs/code/environments/production/data/nodes/peadm-01.pe.yaml new file mode 100644 index 0000000..c5cd3f5 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/data/nodes/peadm-01.pe.yaml @@ -0,0 +1,7 @@ +--- +profile::puppetserver::authority: true +profile::puppetserver::authority::validity: '7200' +profile::puppetserver::nfs_export: true +puppet_enterprise::profile::master::r10k_remote: "git@github.com:chlawren/control-repo.git" +puppet_enterprise::profile::master::r10k_private_key: "/etc/puppetlabs/puppetserver/ssh/id-control_repo.rsa" +puppet_enterprise::profile::master::code_manager_auto_configure: true diff --git a/.onceover/etc/puppetlabs/code/environments/production/data/nodes/puppet.home.yaml b/.onceover/etc/puppetlabs/code/environments/production/data/nodes/puppet.home.yaml new file mode 100644 index 0000000..241d251 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/data/nodes/puppet.home.yaml @@ -0,0 +1,3 @@ +--- +profile::puppetserver::authority: true +profile::puppetserver::authority::validity: '7200' diff --git a/.onceover/etc/puppetlabs/code/environments/production/data/nodes/puppet.plaform9.puppet.net b/.onceover/etc/puppetlabs/code/environments/production/data/nodes/puppet.plaform9.puppet.net new file mode 100644 index 0000000..4d8b431 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/data/nodes/puppet.plaform9.puppet.net @@ -0,0 +1,6 @@ +--- +profile::puppetserver::authority: true +profile::puppetserver::authority::validity: '7200' +puppet_enterprise::profile::master::r10k_remote: "git@github.com:chlawren/control-repo.git" +puppet_enterprise::profile::master::r10k_private_key: "/etc/puppetlabs/puppetserver/ssh/id-control_repo.rsa" +puppet_enterprise::profile::master::code_manager_auto_configure: true diff --git a/.onceover/etc/puppetlabs/code/environments/production/data/secrets/node/peadm-01.pe.eyaml b/.onceover/etc/puppetlabs/code/environments/production/data/secrets/node/peadm-01.pe.eyaml new file mode 100644 index 0000000..3a17b35 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/data/secrets/node/peadm-01.pe.eyaml @@ -0,0 +1,2 @@ +--- +profile::puppetserver::authority::jwt_secret: ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEAEca4yGi5jZP7UAvhiEFDuAXXRHWwbwNz3Dj+/4nRYtZ0jbNWPh3VTT+XBZKCgeQcV3oTy3j3n0Ed4XzEYHZ8zM+ZPQ2m2En9qTzOJ8Fn4Kq2FxgTimjdqCKSLcQMcgzDDT45Gk4JjS/u6G4Vi1LrEdMf80TFcOCwvCq/ZZyzimmbCziW81kQ3tcdbY9yxkqJg8AGfRK5abF88M3R9DqsRcmKbnzwsYFfEUXUbuMdYSvQxAe4UyXYrM9GHNxjts+2WM431WXdX89DoMKsqJ4PulMub8TaXXQkxCvLmducz8mXh0s9AsSlx/DMOImIZTUdGdwS67xeCcc9Fq/omWO2bjBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBDx6u7YJTvRc0DlRtxtNoBAgCAqanEu5repqqcLyk+iuRi2Dw+4+/+7FCRKo6GT5SlB1A==] diff --git a/.onceover/etc/puppetlabs/code/environments/production/data/secrets/node/puppet.home.eyaml b/.onceover/etc/puppetlabs/code/environments/production/data/secrets/node/puppet.home.eyaml new file mode 100644 index 0000000..2e055b3 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/data/secrets/node/puppet.home.eyaml @@ -0,0 +1,2 @@ +--- +profile::puppetserver::authority::jwt_secret: "ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEAnLKlgSOslWvpo+tVP2Fd/ITPkWLc7GM2cXd3bI8tB2PqsnEDOfWYFh8Pp58nzOZTPomTVxtQ0ptud6A+VhGbQ55P5ha9GzW9Pra5q0pQEsoGjJQhLKVsbLlivYN5j+W0pfR3hAr6NgKVBX0qwESOAKKIrYth34qH7Fsrk19VDKLOUJPSbVCajwwbUdj3s0j+8k3CCkey8+FmzTDeqjNGDDMmSxcWAySfX0LfZI3GGgJDfHgo3HDia3MiN0PLfNIOpeIFWRgWnzNrzHbt3RnEV7HIp1R+W2lyr/OWCGgBPco6t7oddqk9n3i35/0pxTsKmZEjasZyNvf51/PNwKK2VjBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBAaFxUesvj7c9N47ru3WWyugCDAjwhS8BqA1n37yWGIGNCrdfQDUDr/dBMZTbmaoLAKLg==]" diff --git a/.onceover/etc/puppetlabs/code/environments/production/environment.conf b/.onceover/etc/puppetlabs/code/environments/production/environment.conf new file mode 100644 index 0000000..4944466 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/environment.conf @@ -0,0 +1,2 @@ +modulepath = site-modules:modules:$basemodulepath +config_version = 'scripts/config_version.sh $environmentpath $environment' diff --git a/.onceover/etc/puppetlabs/code/environments/production/hiera.yaml b/.onceover/etc/puppetlabs/code/environments/production/hiera.yaml new file mode 100644 index 0000000..a2677c8 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/hiera.yaml @@ -0,0 +1,21 @@ +--- +version: 5 +defaults: + datadir: data +hierarchy: +- name: 'Secret data: per-node, common' + lookup_key: eyaml_lookup_key + paths: + - secrets/node/%{trusted.certname}.eyaml + - secrets/role/%{trusted.extensions.pp_role}.eyaml + - common.eyaml + options: + pkcs7_private_key: "/etc/puppetlabs/puppet/eyaml/private_key.pkcs7.pem" + pkcs7_public_key: "/etc/puppetlabs/puppet/eyaml/public_key.pkcs7.pem" +- name: Yaml backend Data + data_hash: yaml_data + paths: + - nodes/%{trusted.certname}.yaml + - roles/%{trusted.extensions.pp_role}.yaml + - environments/%{trusted.extensions.pp_environment}.yaml + - common.yaml diff --git a/.onceover/etc/puppetlabs/code/environments/production/manifests/site.pp b/.onceover/etc/puppetlabs/code/environments/production/manifests/site.pp new file mode 100644 index 0000000..e0769a9 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/manifests/site.pp @@ -0,0 +1,47 @@ +## site.pp ## + +# This file (./manifests/site.pp) is the main entry point +# used when an agent connects to a master and asks for an updated configuration. +# https://puppet.com/docs/puppet/latest/dirs_manifest.html +# +# Global objects like filebuckets and resource defaults should go in this file, +# as should the default node definition if you want to use it. + +## Active Configurations ## + +# Disable filebucket by default for all File resources: +# https://github.com/puppetlabs/docs-archive/blob/master/pe/2015.3/release_notes.markdown#filebucket-resource-no-longer-created-by-default +File { backup => false } + +## Node Definitions ## + +# The default node definition matches any node lacking a more specific node +# definition. If there are no other node definitions in this file, classes +# and resources declared in the default node definition will be included in +# every node's catalog. +# +# Note that node definitions in this file are merged with node data from the +# Puppet Enterprise console and External Node Classifiers (ENC's). +# +# For more on node definitions, see: https://puppet.com/docs/puppet/latest/lang_node_definitions.html + +if $trusted['extensions']['pp_application'] == 'puppet/master' { + + include role::puppetserver +} + +node 'puppet' { + + include role::puppetserver + +} + +node default { + + if $trusted['extensions']['pp_role'] { + include "role::${trusted['extensions']['pp_role']}" + + } else { + include role::node + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version-r10k.rb b/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version-r10k.rb new file mode 100755 index 0000000..beacabc --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version-r10k.rb @@ -0,0 +1,19 @@ +#!/opt/puppetlabs/puppet/bin/ruby +require 'json' +require 'socket' + +environmentpath = ARGV[0] +environment = ARGV[1] + +# Get the hostname of the Puppet master compiling the catalog. +# Sometimes the hostname is the fqdn, so we'll take the first segment. +compiling_master = Socket.gethostname.split('.').first + +# Get the path to the Code Manager deployment info file. +r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.json') + +# Get the first 12 characters of the commit ID out of the deployment file. +commit_id = JSON.parse(File.read(r10k_deploy_file_path))['signature'][0...11] + +# Show the compiling master, environment name, and commit ID. +puts "#{compiling_master}-#{environment}-#{commit_id}" diff --git a/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version-rugged.rb b/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version-rugged.rb new file mode 100755 index 0000000..abb3390 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version-rugged.rb @@ -0,0 +1,25 @@ +#!/opt/puppetlabs/puppet/bin/ruby +begin + require 'rugged' + require 'socket' +rescue LoadError + t = Time.new + puts t.to_i +else + environmentpath = ARGV[0] + environment = ARGV[1] + + # Get the hostname of the Puppet master compiling the catalog. + # Sometimes the hostname is the fqdn, so we'll take the first segment. + compiling_master = Socket.gethostname.split('.').first + + # Get the path to the environment being compiled. + repo = Rugged::Repository.discover(File.join(environmentpath, environment)) + head = repo.head + + # First 12 characters of the sha1 hash of the newest commit. + commit_id = head.target_id[0...11] + + # Show the compiling master, environment name, and commit ID. + puts "#{compiling_master}-#{environment}-#{commit_id}" +end diff --git a/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version.sh b/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version.sh new file mode 100755 index 0000000..bdbc511 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/scripts/config_version.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# Usage +if [ $# -ne 2 -o ! -d "$1" -o ! -d "$1/$2" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# For portability, identify a preferred ruby executable to use +ruby() { + [ -x /opt/puppetlabs/puppet/bin/ruby ] \ + && /opt/puppetlabs/puppet/bin/ruby "$@" \ + || /usr/bin/env ruby "$@" +} + +# Determine how best to calculate a config_version +if [ -e $1/$2/.r10k-deploy.json ]; then + # The environment was deployed using r10k. We will calculate the config + # version using the r10k data. + ruby $1/$2/scripts/config_version-r10k.rb $1 $2 + +elif [ -e /opt/puppetlabs/server/pe_version ]; then + # This is a Puppet Enterprise system and we can rely on the rugged ruby gem + # being available. + ruby $1/$2/scripts/config_version-rugged.rb $1 $2 + +elif type git >/dev/null; then + # The git command is available. + git --git-dir $1/$2/.git rev-parse HEAD + +else + # Nothing else available; just use the date. + date +%s + +fi diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/custom_files/7z1900-x64.exe b/.onceover/etc/puppetlabs/code/environments/production/site-modules/custom_files/7z1900-x64.exe new file mode 100644 index 0000000..406b131 Binary files /dev/null and b/.onceover/etc/puppetlabs/code/environments/production/site-modules/custom_files/7z1900-x64.exe differ diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/custom_files/master.zip b/.onceover/etc/puppetlabs/code/environments/production/site-modules/custom_files/master.zip new file mode 100644 index 0000000..1b5d266 Binary files /dev/null and b/.onceover/etc/puppetlabs/code/environments/production/site-modules/custom_files/master.zip differ diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.fixtures.yml b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.fixtures.yml new file mode 100644 index 0000000..2296adb --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.fixtures.yml @@ -0,0 +1,6 @@ +# This file can be used to install module dependencies for unit testing +# See https://github.com/puppetlabs/puppetlabs_spec_helper#using-fixtures for details +--- +fixtures: + forge_modules: +# stdlib: "puppetlabs/stdlib" diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitattributes b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitattributes new file mode 100644 index 0000000..9032a01 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitattributes @@ -0,0 +1,5 @@ +*.rb eol=lf +*.erb eol=lf +*.pp eol=lf +*.sh eol=lf +*.epp eol=lf diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitignore b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitignore new file mode 100644 index 0000000..2767022 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitignore @@ -0,0 +1,27 @@ +.git/ +.*.sw[op] +.metadata +.yardoc +.yardwarns +*.iml +/.bundle/ +/.idea/ +/.vagrant/ +/coverage/ +/bin/ +/doc/ +/Gemfile.local +/Gemfile.lock +/junit/ +/log/ +/pkg/ +/spec/fixtures/manifests/ +/spec/fixtures/modules/ +/tmp/ +/vendor/ +/convert_report.txt +/update_report.txt +.DS_Store +.project +.envrc +/inventory.yaml diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitlab-ci.yml b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitlab-ci.yml new file mode 100644 index 0000000..81e6d76 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.gitlab-ci.yml @@ -0,0 +1,41 @@ +--- +stages: + - syntax + - unit + +cache: + paths: + - vendor/bundle + +before_script: + - bundle -v + - rm Gemfile.lock || true + - gem update --system $RUBYGEMS_VERSION + - gem --version + - bundle -v + - bundle install --without system_tests --path vendor/bundle --jobs $(nproc) + +syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.3-Puppet ~> 6: + stage: syntax + image: ruby:2.5.3 + script: + - bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop + variables: + PUPPET_GEM_VERSION: '~> 6' + +parallel_spec-Ruby 2.5.3-Puppet ~> 6: + stage: unit + image: ruby:2.5.3 + script: + - bundle exec rake parallel_spec + variables: + PUPPET_GEM_VERSION: '~> 6' + +parallel_spec-Ruby 2.4.5-Puppet ~> 5: + stage: unit + image: ruby:2.4.5 + script: + - bundle exec rake parallel_spec + variables: + PUPPET_GEM_VERSION: '~> 5' + diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.pdkignore b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.pdkignore new file mode 100644 index 0000000..e6215cd --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.pdkignore @@ -0,0 +1,42 @@ +.git/ +.*.sw[op] +.metadata +.yardoc +.yardwarns +*.iml +/.bundle/ +/.idea/ +/.vagrant/ +/coverage/ +/bin/ +/doc/ +/Gemfile.local +/Gemfile.lock +/junit/ +/log/ +/pkg/ +/spec/fixtures/manifests/ +/spec/fixtures/modules/ +/tmp/ +/vendor/ +/convert_report.txt +/update_report.txt +.DS_Store +.project +.envrc +/inventory.yaml +/appveyor.yml +/.fixtures.yml +/Gemfile +/.gitattributes +/.gitignore +/.gitlab-ci.yml +/.pdkignore +/Rakefile +/rakelib/ +/.rspec +/.rubocop.yml +/.travis.yml +/.yardopts +/spec/ +/.vscode/ diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.puppet-lint.rc b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.puppet-lint.rc new file mode 100644 index 0000000..cc96ece --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.puppet-lint.rc @@ -0,0 +1 @@ +--relative diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.rspec b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.rspec new file mode 100644 index 0000000..16f9cdb --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.rspec @@ -0,0 +1,2 @@ +--color +--format documentation diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.rubocop.yml b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.rubocop.yml new file mode 100644 index 0000000..bab25db --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.rubocop.yml @@ -0,0 +1,133 @@ +--- +require: +- rubocop-rspec +- rubocop-i18n +AllCops: + DisplayCopNames: true + TargetRubyVersion: '2.1' + Include: + - "./**/*.rb" + Exclude: + - bin/* + - ".vendor/**/*" + - "**/Gemfile" + - "**/Rakefile" + - pkg/**/* + - spec/fixtures/**/* + - vendor/**/* + - "**/Puppetfile" + - "**/Vagrantfile" + - "**/Guardfile" +Metrics/LineLength: + Description: People have wide screens, use them. + Max: 200 +GetText: + Enabled: false +GetText/DecorateString: + Description: We don't want to decorate test output. + Exclude: + - spec/**/* + Enabled: false +RSpec/BeforeAfterAll: + Description: Beware of using after(:all) as it may cause state to leak between tests. + A necessary evil in acceptance testing. + Exclude: + - spec/acceptance/**/*.rb +RSpec/HookArgument: + Description: Prefer explicit :each argument, matching existing module's style + EnforcedStyle: each +Style/BlockDelimiters: + Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to + be consistent then. + EnforcedStyle: braces_for_chaining +Style/ClassAndModuleChildren: + Description: Compact style reduces the required amount of indentation. + EnforcedStyle: compact +Style/EmptyElse: + Description: Enforce against empty else clauses, but allow `nil` for clarity. + EnforcedStyle: empty +Style/FormatString: + Description: Following the main puppet project's style, prefer the % format format. + EnforcedStyle: percent +Style/FormatStringToken: + Description: Following the main puppet project's style, prefer the simpler template + tokens over annotated ones. + EnforcedStyle: template +Style/Lambda: + Description: Prefer the keyword for easier discoverability. + EnforcedStyle: literal +Style/RegexpLiteral: + Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 + EnforcedStyle: percent_r +Style/TernaryParentheses: + Description: Checks for use of parentheses around ternary conditions. Enforce parentheses + on complex expressions for better readability, but seriously consider breaking + it up. + EnforcedStyle: require_parentheses_when_complex +Style/TrailingCommaInArguments: + Description: Prefer always trailing comma on multiline argument lists. This makes + diffs, and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/TrailingCommaInLiteral: + Description: Prefer always trailing comma on multiline literals. This makes diffs, + and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/SymbolArray: + Description: Using percent style obscures symbolic intent of array's contents. + EnforcedStyle: brackets +RSpec/MessageSpies: + EnforcedStyle: receive +Style/Documentation: + Exclude: + - lib/puppet/parser/functions/**/* + - spec/**/* +Style/WordArray: + EnforcedStyle: brackets +Style/CollectionMethods: + Enabled: true +Style/MethodCalledOnDoEndBlock: + Enabled: true +Style/StringMethods: + Enabled: true +GetText/DecorateFunctionMessage: + Enabled: false +GetText/DecorateStringFormattingUsingInterpolation: + Enabled: false +GetText/DecorateStringFormattingUsingPercent: + Enabled: false +Layout/EndOfLine: + Enabled: false +Layout/IndentHeredoc: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/ParameterLists: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +RSpec/DescribeClass: + Enabled: false +RSpec/ExampleLength: + Enabled: false +RSpec/MessageExpectation: + Enabled: false +RSpec/MultipleExpectations: + Enabled: false +RSpec/NestedGroups: + Enabled: false +Style/AsciiComments: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Style/SymbolProc: + Enabled: false diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.travis.yml b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.travis.yml new file mode 100644 index 0000000..ed27d4d --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.travis.yml @@ -0,0 +1,45 @@ +--- +dist: xenial +language: ruby +cache: bundler +before_install: + - bundle -v + - rm -f Gemfile.lock + - gem update --system $RUBYGEMS_VERSION + - gem --version + - bundle -v +script: + - 'bundle exec rake $CHECK' +bundler_args: --without system_tests +rvm: + - 2.5.3 +stages: + - static + - spec + - acceptance + - + if: tag =~ ^v\d + name: deploy +matrix: + fast_finish: true + include: + - + env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" + stage: static + - + env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec + rvm: 2.4.5 + stage: spec + - + env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec + rvm: 2.5.3 + stage: spec + - + env: DEPLOY_TO_FORGE=yes + stage: deploy +branches: + only: + - master + - /^v\d/ +notifications: + email: false diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.vscode/extensions.json b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.vscode/extensions.json new file mode 100644 index 0000000..6177782 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "jpogran.puppet-vscode", + "rebornix.Ruby" + ] +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.yardopts b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.yardopts new file mode 100644 index 0000000..29c933b --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/.yardopts @@ -0,0 +1 @@ +--markup markdown diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/CHANGELOG.md b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/CHANGELOG.md new file mode 100644 index 0000000..4c954cd --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## Release 0.1.0 + +**Features** + +**Bugfixes** + +**Known Issues** diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/Gemfile b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/Gemfile new file mode 100644 index 0000000..2aeab8e --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/Gemfile @@ -0,0 +1,72 @@ +source ENV['GEM_SOURCE'] || 'https://rubygems.org' + +def location_for(place_or_version, fake_version = nil) + git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} + file_url_regex = %r{\Afile:\/\/(?.*)} + + if place_or_version && (git_url = place_or_version.match(git_url_regex)) + [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact + elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) + ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] + else + [place_or_version, { require: false }] + end +end + +ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments +minor_version = ruby_version_segments[0..1].join('.') + +group :development do + gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0') + gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') + gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') + gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9') + gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby] + gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby] + gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] +end + +puppet_version = ENV['PUPPET_GEM_VERSION'] +facter_version = ENV['FACTER_GEM_VERSION'] +hiera_version = ENV['HIERA_GEM_VERSION'] + +gems = {} + +gems['puppet'] = location_for(puppet_version) + +# If facter or hiera versions have been specified via the environment +# variables + +gems['facter'] = location_for(facter_version) if facter_version +gems['hiera'] = location_for(hiera_version) if hiera_version + +if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)} + # If we're using a Puppet gem on Windows which handles its own win32-xxx gem + # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445). + gems['win32-dir'] = ['<= 0.4.9', require: false] + gems['win32-eventlog'] = ['<= 0.6.5', require: false] + gems['win32-process'] = ['<= 0.7.5', require: false] + gems['win32-security'] = ['<= 0.2.5', require: false] + gems['win32-service'] = ['0.8.8', require: false] +end + +gems.each do |gem_name, gem_params| + gem gem_name, *gem_params +end + +# Evaluate Gemfile.local and ~/.gemfile if they exist +extra_gemfiles = [ + "#{__FILE__}.local", + File.join(Dir.home, '.gemfile'), +] + +extra_gemfiles.each do |gemfile| + if File.file?(gemfile) && File.readable?(gemfile) + eval(File.read(gemfile), binding) + end +end +# vim: syntax=ruby diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/README.md b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/README.md new file mode 100644 index 0000000..5fb82ae --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/README.md @@ -0,0 +1,87 @@ +# profile + +Welcome to your new module. A short overview of the generated parts can be found in the PDK documentation at https://puppet.com/pdk/latest/pdk_generating_modules.html . + +The README template below provides a starting point with details about what information to include in your README. + +#### Table of Contents + +1. [Description](#description) +2. [Setup - The basics of getting started with profile](#setup) + * [What profile affects](#what-profile-affects) + * [Setup requirements](#setup-requirements) + * [Beginning with profile](#beginning-with-profile) +3. [Usage - Configuration options and additional functionality](#usage) +4. [Limitations - OS compatibility, etc.](#limitations) +5. [Development - Guide for contributing to the module](#development) + +## Description + +Briefly tell users why they might want to use your module. Explain what your module does and what kind of problems users can solve with it. + +This should be a fairly short description helps the user decide if your module is what they want. + +## Setup + +### What profile affects **OPTIONAL** + +If it's obvious what your module touches, you can skip this section. For example, folks can probably figure out that your mysql_instance module affects their MySQL instances. + +If there's more that they should know about, though, this is the place to mention: + +* Files, packages, services, or operations that the module will alter, impact, or execute. +* Dependencies that your module automatically installs. +* Warnings or other important notices. + +### Setup Requirements **OPTIONAL** + +If your module requires anything extra before setting up (pluginsync enabled, another module, etc.), mention it here. + +If your most recent release breaks compatibility or requires particular steps for upgrading, you might want to include an additional "Upgrading" section here. + +### Beginning with profile + +The very basic steps needed for a user to get the module up and running. This can include setup steps, if necessary, or it can be an example of the most basic use of the module. + +## Usage + +Include usage examples for common use cases in the **Usage** section. Show your users how to use your module to solve problems, and be sure to include code examples. Include three to five examples of the most important or common tasks a user can accomplish with your module. Show users how to accomplish more complex tasks that involve different types, classes, and functions working in tandem. + +## Reference + +This section is deprecated. Instead, add reference information to your code as Puppet Strings comments, and then use Strings to generate a REFERENCE.md in your module. For details on how to add code comments and generate documentation with Strings, see the Puppet Strings [documentation](https://puppet.com/docs/puppet/latest/puppet_strings.html) and [style guide](https://puppet.com/docs/puppet/latest/puppet_strings_style.html) + +If you aren't ready to use Strings yet, manually create a REFERENCE.md in the root of your module directory and list out each of your module's classes, defined types, facts, functions, Puppet tasks, task plans, and resource types and providers, along with the parameters for each. + +For each element (class, defined type, function, and so on), list: + + * The data type, if applicable. + * A description of what the element does. + * Valid values, if the data type doesn't make it obvious. + * Default value, if any. + +For example: + +``` +### `pet::cat` + +#### Parameters + +##### `meow` + +Enables vocalization in your cat. Valid options: 'string'. + +Default: 'medium-loud'. +``` + +## Limitations + +In the Limitations section, list any incompatibilities, known issues, or other warnings. + +## Development + +In the Development section, tell other users the ground rules for contributing to your project and how they should submit their work. + +## Release Notes/Contributors/Etc. **Optional** + +If you aren't using changelog, put your release notes here (though you should consider using changelog). You can also add any additional sections you feel are necessary or important to include here. Please use the `## ` header. diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/Rakefile b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/Rakefile new file mode 100644 index 0000000..395df54 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/Rakefile @@ -0,0 +1,86 @@ +require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-syntax/tasks/puppet-syntax' +require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? +require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? +require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? + +def changelog_user + return unless Rake.application.top_level_tasks.include? "changelog" + returnVal = nil || JSON.load(File.read('metadata.json'))['author'] + raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil? + puts "GitHubChangelogGenerator user:#{returnVal}" + returnVal +end + +def changelog_project + return unless Rake.application.top_level_tasks.include? "changelog" + + returnVal = nil + returnVal ||= begin + metadata_source = JSON.load(File.read('metadata.json'))['source'] + metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z}) + + metadata_source_match && metadata_source_match[1] + end + + raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil? + + puts "GitHubChangelogGenerator project:#{returnVal}" + returnVal +end + +def changelog_future_release + return unless Rake.application.top_level_tasks.include? "changelog" + returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version'] + raise "unable to find the future_release (version) in metadata.json" if returnVal.nil? + puts "GitHubChangelogGenerator future_release:#{returnVal}" + returnVal +end + +PuppetLint.configuration.send('disable_relative') + +if Bundler.rubygems.find_name('github_changelog_generator').any? + GitHubChangelogGenerator::RakeTask.new :changelog do |config| + raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? + config.user = "#{changelog_user}" + config.project = "#{changelog_project}" + config.future_release = "#{changelog_future_release}" + config.exclude_labels = ['maintenance'] + config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)." + config.add_pr_wo_labels = true + config.issues = false + config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM" + config.configure_sections = { + "Changed" => { + "prefix" => "### Changed", + "labels" => ["backwards-incompatible"], + }, + "Added" => { + "prefix" => "### Added", + "labels" => ["feature", "enhancement"], + }, + "Fixed" => { + "prefix" => "### Fixed", + "labels" => ["bugfix"], + }, + } + end +else + desc 'Generate a Changelog from GitHub' + task :changelog do + raise <= Gem::Version.new('2.2.2')" +EOM + end +end + diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/appveyor.yml b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/appveyor.yml new file mode 100644 index 0000000..ec38949 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/appveyor.yml @@ -0,0 +1,56 @@ +--- +version: 1.1.x.{build} +branches: + only: + - master + - release +skip_commits: + message: /^\(?doc\)?.*/ +clone_depth: 10 +init: + - SET + - 'mkdir C:\ProgramData\PuppetLabs\code && exit 0' + - 'mkdir C:\ProgramData\PuppetLabs\facter && exit 0' + - 'mkdir C:\ProgramData\PuppetLabs\hiera && exit 0' + - 'mkdir C:\ProgramData\PuppetLabs\puppet\var && exit 0' +environment: + matrix: + - + RUBY_VERSION: 24-x64 + CHECK: syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop + - + PUPPET_GEM_VERSION: ~> 5.0 + RUBY_VERSION: 24 + CHECK: parallel_spec + - + PUPPET_GEM_VERSION: ~> 5.0 + RUBY_VERSION: 24-x64 + CHECK: parallel_spec + - + PUPPET_GEM_VERSION: ~> 6.0 + RUBY_VERSION: 25 + CHECK: parallel_spec + - + PUPPET_GEM_VERSION: ~> 6.0 + RUBY_VERSION: 25-x64 + CHECK: parallel_spec +matrix: + fast_finish: true +install: + - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH% + - bundle install --jobs 4 --retry 2 --without system_tests + - type Gemfile.lock +build: off +test_script: + - bundle exec puppet -V + - ruby -v + - gem -v + - bundle -v + - bundle exec rake %CHECK% +notifications: + - provider: Email + to: + - nobody@nowhere.com + on_build_success: false + on_build_failure: false + on_build_status_changed: false diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/data/common.yaml b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/data/common.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/data/common.yaml @@ -0,0 +1 @@ +--- diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/hiera.yaml b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/hiera.yaml new file mode 100644 index 0000000..2251c23 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/hiera.yaml @@ -0,0 +1,21 @@ +--- +version: 5 + +defaults: # Used for any hierarchy level that omits these keys. + datadir: data # This path is relative to hiera.yaml's directory. + data_hash: yaml_data # Use the built-in YAML backend. + +hierarchy: + - name: "osfamily/major release" + paths: + - "os/%{facts.os.family}/%{facts.os.release.major}.yaml" + # Used for Solaris + - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml" + # Used to distinguish between Debian and Ubuntu + - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" + - name: "osfamily" + paths: + - "os/%{facts.os.family}.yaml" + - "os/%{facts.os.name}.yaml" + - name: 'common' + path: 'common.yaml' diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base.pp new file mode 100644 index 0000000..5256709 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base.pp @@ -0,0 +1,31 @@ +class profile::base ( + Boolean $firewall = false, + Boolean $time = false, + Boolean $repos = false, + Boolean $resolv = false, + Boolean $ssh = false, + Boolean $selinux = false, + Boolean $motd = false, +) { + if $motd { + class { '::motd': } + } + if $firewall { + class { '::profile::base::firewall': } + } + if $time { + class { '::profile::base::time': } + } + if $repos { + class { '::profile::base::repositories': } + } + if $resolv { + class { '::profile::base::resolv': } + } + if $ssh { + class { '::profile::base::ssh': } + } + if $selinux { + class { '::profile::base::selinux': } + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/motd.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/motd.pp new file mode 100644 index 0000000..c7a831a --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/motd.pp @@ -0,0 +1,5 @@ +class profile::base::motd ( +) { + class { '::motd': + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp new file mode 100644 index 0000000..b22a9c0 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp @@ -0,0 +1,17 @@ +# This class can be used to configure resolv.conf. +# +# @example when declaring the resolver class +# class { '::profiles::base::resolv': } +# +class profile::base::resolv ( + Optional[String] $domainname = undef, + Array[String] $nameservers = [], + Optional[String] $searchpath = undef, +) { + + class { '::resolv_conf': + domainname => $domainname, + nameservers => $nameservers, + searchpath => $searchpath, + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/selinux.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/selinux.pp new file mode 100644 index 0000000..cbb4f46 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/selinux.pp @@ -0,0 +1,7 @@ +class profile::base::selinux ( + String $mode = 'disabled', +) { + class { '::selinux': + mode => $mode, + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/ssh.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/ssh.pp new file mode 100644 index 0000000..d6520f8 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/ssh.pp @@ -0,0 +1,19 @@ +class profile::base::ssh ( + Hash $config_entries = {}, + String $permit_root_login = 'no', + String $ssh_config_forward_agent = 'no', + String $sshd_config_allowagentforwarding = 'no', + Hash $sshd_config_match = {}, + String $sshd_config_port = '22', + String $sshd_password_authentication = 'no' +) { + class { '::ssh': + config_entries => $config_entries, + permit_root_login => $permit_root_login, + ssh_config_forward_agent => $ssh_config_forward_agent, + sshd_config_allowagentforwarding => $sshd_config_allowagentforwarding, + sshd_config_match => $sshd_config_match, + sshd_config_port => $sshd_config_port, + sshd_password_authentication => $sshd_password_authentication, + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/time.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/time.pp new file mode 100644 index 0000000..93fc3a9 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/time.pp @@ -0,0 +1,16 @@ +class profile::base::time ( + String $default_timezone = 'Europe/London', + Array $ntp_servers = [], + Array $restrict = [], + Boolean $set_timezone = false, +) { + class { '::ntp': + servers => $ntp_servers, + restrict => $restrict, + } + if $set_timezone { + class { '::timezone': + default_timezone => $default_timezone, + } + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows.pp new file mode 100644 index 0000000..bf0532a --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows.pp @@ -0,0 +1,17 @@ +class profile::custom_windows ( + Boolean $config_server = true, + Boolean $install_package = true, + Boolean $deploy_iis = true, +) { + if $config_server { + class { '::profile::custom_windows::config_server': } + } + if $install_package { + class { '::profile::custom_windows::install_package': } + include chocolatey + include staging + } + if $deploy_iis { + class { '::profile::custom_windows::deploy_iis': } + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/config_server.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/config_server.pp new file mode 100644 index 0000000..6127dcb --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/config_server.pp @@ -0,0 +1,57 @@ +class profile::custom_windows::config_server ( + + $user_name = 'myuser', + $user_group = 'mygroup', + $user_groups = ['BUILTIN\Administrators', 'BUILTIN\Users'], + $user_home = "C:/Users/myuser", + $user_password = 'Puppetlabs01!', + $ensure = 'present', + $manage_home = true, + $user_dir = 'mydir', + +) { + + profile::custom_windows::define_user { 'myuser': + + user_name => $user_name, + user_group => $user_group, + user_groups => $user_groups, + user_home => $user_home, + user_password => $user_password, + ensure => $ensure, + manage_home => $manage_home, + user_dir => $user_dir, + } + + acl { "${user_home}/${user_dir}": + + permissions => [ + { identity => $user_name, rights => ['read','execute'] }, + { identity => $user_group, rights => ['read'] } + ], + } + + registry::value { 'Enable IEESC': + + key => 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}', + value => 'IsInstalled', + data => '1', + type => 'dword', + } + + registry::value { 'Enable shutdown tracker': + + key => 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability', + value => 'ShutdownReasonOn', + data => '1', + type => 'dword', + } + + registry::value { 'Enable shutdown tracker UI': + + key => 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability', + value => 'ShutdownReasonUI', + data => '1', + type => 'dword', + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/define_user.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/define_user.pp new file mode 100644 index 0000000..13466f4 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/define_user.pp @@ -0,0 +1,31 @@ +define profile::custom_windows::define_user ( + + String $user_name, + String $ensure, + String $user_group, + Optional[Array] $user_groups, + String $user_password, + String $user_dir, + String $user_home, + Boolean $manage_home, + +) { + file { "${user_home}/${user_dir}": + ensure => directory, + owner => $user_name, + require => User[$user_name], + } + + user { $user_name: + ensure => $ensure, + password => $user_password, + groups => $user_group, + managehome => $manage_home, + home => "C:/Users/$user_name", + require => Group[$user_group], + } + + group { $user_group: + ensure => $ensure, + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/deploy_iis.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/deploy_iis.pp new file mode 100644 index 0000000..9837b40 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/deploy_iis.pp @@ -0,0 +1,69 @@ +class profile::custom_windows::deploy_iis ( + + String $user_acl = $profile::custom_windows::config_server::user_name, + +) { + + dsc {'iis-web': + resource_name => 'WindowsFeature', + module => 'PSDesiredStateConfiguration', + properties => { + ensure => 'present', + name => 'Web-Server', + } + } + + iis_site {'Default Web Site': + ensure => absent, + require => Dsc['iis-web'], + } + + file { 'c:\\inetpub\\complete': + ensure => 'directory' + } + + acl { 'c:\\inetpub\\complete': + permissions => [ + {'identity' => $user_acl, 'rights' => ['read', 'execute']}, + ], + } + + iis_application_pool { 'complete_site_app_pool': + ensure => 'present', + state => 'started', + managed_pipeline_mode => 'Integrated', + managed_runtime_version => 'v4.0', + } + + iis_application_pool {'test_app_pool': + ensure => 'present', + enable32_bit_app_on_win64 => true, + managed_runtime_version => '', + managed_pipeline_mode => 'Classic', + start_mode => 'AlwaysRunning' + } + + iis_site { 'complete': + ensure => 'started', + physicalpath => 'c:\\inetpub\\complete', + applicationpool => 'complete_site_app_pool', + enabledprotocols => 'https', + bindings => [ + { + 'bindinginformation' => '*:443:', + 'protocol' => 'https', + 'certificatehash' => '3598FAE5ADDB8BA32A061C5579829B359409856F', + 'certificatestorename' => 'MY', + 'sslflags' => 1, + }, + ], + require => File['c:\\inetpub\\complete'], + notify => Reboot['dsc_reboot'], + } + + reboot { 'dsc_reboot' : + message => 'DSC has requested a reboot', + when => 'pending', + onlyif => 'pending_dsc_reboot', + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/install_package.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/install_package.pp new file mode 100644 index 0000000..288462a --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/custom_windows/install_package.pp @@ -0,0 +1,71 @@ +class profile::custom_windows::install_package ( + + String $package = 'undef', + String $version = 'undef', + String $package_provider = 'chocolatey', + String $choco_provider = 'windows', + String $install_dir = $profile::custom_windows::config_server::user_home, + +) { + + chocolateysource {'custom_source': + ensure => present, + + location => 'c:\packages', + provider => $choco_provider, + } + + chocolateyfeature {'allowEmptyChecksums': + ensure => enabled, + provider => $choco_provider, + } + + chocolateyconfig {'cacheLocation': + value => 'c:\ProgramData\choco-cache', + provider => $choco_provider, + } + + package { 'unzip': + ensure => '6.0', + provider => $package_provider, + } + + package { 'vim': + ensure => '8.2.0246', + provider => $package_provider, + } + + class { 'staging': + path => 'C:/tmp', + } + + staging::file { 'master.zip': + source => 'puppet:///custom_files/master.zip', + } + + staging::extract { 'master.zip': + target => "${install_dir}/downloads", + unless => 'cmd.exe /c type C:\tmp\7zip', + require => Staging::File['master.zip'], + notify => Exec['7z1900-x64'], + } + + exec { '7z1900-x64': + cwd => "${install_dir}/downloads", + command => 'cmd.exe /c C:\Users\myuser\Downloads\7z1900-x64.exe', + path => $::path, + unless => 'cmd.exe /c type C:\tmp\7zip', +# unless => '7z', + } + + file { 'C:/tmp/7zip': + ensure => present, + content => installed, + require => Exec['7z1900-x64'], + } + + reboot { 'post_exec': + apply => finished, + subscribe => File['C:/tmp/7zip'], + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/monitor.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/monitor.pp new file mode 100644 index 0000000..581c856 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/monitor.pp @@ -0,0 +1,11 @@ +class profile::monitoring ( + Boolean $docker_install = false, + Boolean $nfs_mount = false, +) { + if $docker_install { + class { '::profile::tools::docker_install': } + } + if $nfs_mount { + class { '::profile::tools::nfs_mount': } + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/patching/patch_unix.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/patching/patch_unix.pp new file mode 100644 index 0000000..e606663 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/patching/patch_unix.pp @@ -0,0 +1,59 @@ +#Provides automated patch management +class profile::patch_mgmt_nix ( + Array $blacklist = [], + Array $whitelist = [], + Optional[Hash] $patch_window = { + range => '01:00 - 14:00', + weekday => 'Sunday', + repeat => 3 + } +) { + include os_patching + if $facts['os_patching'] { + $updatescan = $facts['os_patching']['package_updates'] + } + else { + $updatescan = [] + } + if $whitelist.count > 0 { + $updates = $updatescan.filter |$item| { $item in $whitelist } + } elsif $blacklist.count > 0 { + $updates = $updatescan.filter |$item| { !($item in $blacklist) } + } else { + $updates = $updatescan + } + schedule { 'patch_window': + * => $patch_window + } + if $facts['os_patching']['reboots']['reboot_required'] == true { + Package { + require => Reboot['patch_window_reboot'] + } + notify { 'Reboot pending, rebooting node...': + schedule => 'patch_window', + notify => Reboot['patch_window_reboot'] + } + } else { + Package { + notify => Reboot['patch_window_reboot'] + } + } + reboot { 'patch_window_reboot': + apply => 'finished', + schedule => 'patch_window' + } + if $updates.size > 0 { + exec { 'Clean Yum before updates': + command => 'yum clean all', + path => '/usr/bin', + schedule => 'patch_window' + } + } + $updates.each | $package | { + package { $package: + ensure => 'latest', + schedule => 'patch_window', + require => Exec['Clean Yum before updates'], + } + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver.pp new file mode 100644 index 0000000..e2eb0f8 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver.pp @@ -0,0 +1,20 @@ +class profile::puppetserver ( + Boolean $puppetserver = true, + Boolean $authority = false, + Boolean $nfs_export = false, + Boolean $metrics_collect = false, +) { + if $puppetserver { + class { '::profile::puppetserver::bootstrap': } + } + if $authority { + class { '::profile::puppetserver::authority': } + } + if $nfs_export { + class { '::profile::puppetserver::nfs_export': } + } + if $metrics_collect { + include metrics_collector + fi + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/authority.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/authority.pp new file mode 100644 index 0000000..c0839d1 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/authority.pp @@ -0,0 +1,30 @@ +class profile::puppetserver::authority ( + + String $jwt_secret = 'undef', + String $loglevel = 'info', + String $validity = '0', + String $ensure = 'latest', + Hash $config = {}, + Hash $jwt_token = {}, +) { + ini_setting { 'policy-based autosigning': + setting => 'autosign', + path => "${settings::confdir}/puppet.conf", + section => 'master', + value => '/opt/puppetlabs/puppet/bin/autosign-validator', + notify => Service['pe-puppetserver'], + } + + class { '::autosign': + ensure => $ensure, + config => { + general => { + loglevel => $loglevel, + }, + jwt_token => { + secret => $jwt_secret, + validity => $validity, + } + }, + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/bootstrap.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/bootstrap.pp new file mode 100644 index 0000000..033650a --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/bootstrap.pp @@ -0,0 +1,34 @@ +class profile::puppetserver::bootstrap { + + ini_setting { 'hiera_config': + ensure => present, + path => $::settings::config, + section => 'master', + setting => 'hiera_config', + value => "${::settings::environmentpath}/production/hiera.yaml", + } + + file { "${::settings::confdir}/hiera.yaml": + ensure => absent, + } + + package { 'puppetserver hiera-eyaml': + ensure => present, + name => 'hiera-eyaml', + provider => 'puppetserver_gem', + notify => Service['pe-puppetserver'], + } + + package { 'puppet hiera-eyaml': + ensure => present, + name => 'hiera-eyaml', + provider => 'puppet_gem', + } + + file { ['/etc/puppetlabs/secure', '/etc/puppetlabs/secure/keys']: + ensure => directory, + owner => 'pe-puppet', + group => 'pe-puppet', + mode => '0750', + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/nfs_export.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/nfs_export.pp new file mode 100644 index 0000000..8b62124 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/puppetserver/nfs_export.pp @@ -0,0 +1,23 @@ +class profile::puppetserver::nfs_export ( + + $domain = $::domain, + $server_enabled = true, + $export_root = '/export', + $nfs_v4 = 'true', + $server_export = '/opt/puppetlabs/puppet-metrics-collector', + $export_mount = 'mounted', + +) { + class { '::nfs': + server_enabled => $server_enabled, + nfs_v4 => $nfs_v4, + nfs_v4_idmap_domain => $domain, + nfs_v4_export_root => '$export_root', + nfs_v4_export_root_clients => '*(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash)', + } + + nfs::server::export { $server_export: + ensure => $export_mount, + clients => '*(rw,insecure,async,no_root_squash,no_subtree_check)', + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/docker_install.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/docker_install.pp new file mode 100644 index 0000000..5df58de --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/docker_install.pp @@ -0,0 +1,17 @@ +class profile::tools::docker_install ( + $docker_version = '19.03', + $compose_version = '1.24', +) { + yumrepo { 'docker': + ensure => 'present', + baseurl => 'https://download.docker.com/linux/centos/7/x86_64/stable', + descr => 'Docker', + gpgcheck => 'True', + gpgkey => 'https://download.docker.com/linux/centos/gpg', +} + + class {'docker::compose': + ensure => present, + version => '$compose_version', + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/metrics_dashboard.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/metrics_dashboard.pp new file mode 100644 index 0000000..973576b --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/metrics_dashboard.pp @@ -0,0 +1,25 @@ +class profile::metrics_dashboard ( + +Boolean $dashboard_examples = true, +Boolean $overwrite_dashboards = false, +Optional[Array] $master_list = ['peadm-01.pe'], +Optional[Array] $puppetdb_list = ['peadm-01.pe'], +Optional[Array] $postgres_host_list = ['peadm-01.pe'], + +) { + class { 'puppet_metrics_dashboard': + add_dashboard_examples => $dashboard_examples, + overwrite_dashboards => $overwrite_dashboards, + master_list => $master_list, + puppetdb_list => $puppetdb_list, + postgres_host_list => $postgres_host_list, + } + + class { 'docker': + version => 'latest', + } + + class {'docker::compose': + version => 'latest', + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/nfs_mount.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/nfs_mount.pp new file mode 100644 index 0000000..06b801b --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/tools/nfs_mount.pp @@ -0,0 +1,15 @@ +class profile::tools::nfs_mount ( + $server = 'puppet', +) { + class { '::nfs': + server_enabled => false, + client_enabled => true, + nfs_v4_client => false, + nfs_v4_idmap_domain => $::domain, + } + + nfs::client::mount { '/mnt/puppet-metrics-collector': + server => $server, + share => '/export/puppet-metrics-collector', + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows.pp new file mode 100644 index 0000000..a2c5286 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows.pp @@ -0,0 +1,11 @@ +class profile::windows ( + Boolean $base = false, + Boolean $account = false, +) { + if $base { + class { '::profile::windows::base': } + } + if $account { + class { '::profile::windows::account': } + } +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows/account.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows/account.pp new file mode 100644 index 0000000..e69de29 diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows/base.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows/base.pp new file mode 100644 index 0000000..e69de29 diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows/chocolatey.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/windows/chocolatey.pp new file mode 100644 index 0000000..e69de29 diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/metadata.json b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/metadata.json new file mode 100644 index 0000000..4eeef0d --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/metadata.json @@ -0,0 +1,65 @@ +{ + "name": "chlawren-profile", + "version": "0.1.0", + "author": "chris lawrence", + "summary": "", + "license": "Apache-2.0", + "source": "", + "dependencies": [ + + ], + "operatingsystem_support": [ + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "7" + ] + }, + { + "operatingsystem": "OracleLinux", + "operatingsystemrelease": [ + "7" + ] + }, + { + "operatingsystem": "RedHat", + "operatingsystemrelease": [ + "8" + ] + }, + { + "operatingsystem": "Scientific", + "operatingsystemrelease": [ + "7" + ] + }, + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ + "9" + ] + }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "18.04" + ] + }, + { + "operatingsystem": "windows", + "operatingsystemrelease": [ + "2019", + "10" + ] + } + ], + "requirements": [ + { + "name": "puppet", + "version_requirement": ">= 4.10.0 < 7.0.0" + } + ], + "pdk-version": "1.14.1", + "template-url": "pdk-default#1.14.1", + "template-ref": "1.14.1-0-g0b5b39b" +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/spec/default_facts.yml b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/spec/default_facts.yml new file mode 100644 index 0000000..f777abf --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/spec/default_facts.yml @@ -0,0 +1,8 @@ +# Use default_module_facts.yml for module specific facts. +# +# Facts specified here will override the values provided by rspec-puppet-facts. +--- +ipaddress: "172.16.254.254" +ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" +is_pe: false +macaddress: "AA:AA:AA:AA:AA:AA" diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/spec/spec_helper.rb b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/spec/spec_helper.rb new file mode 100644 index 0000000..feb5720 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/spec/spec_helper.rb @@ -0,0 +1,54 @@ +require 'puppetlabs_spec_helper/module_spec_helper' +require 'rspec-puppet-facts' + +require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) + +include RspecPuppetFacts + +default_facts = { + puppetversion: Puppet.version, + facterversion: Facter.version, +} + +default_fact_files = [ + File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')), + File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')), +] + +default_fact_files.each do |f| + next unless File.exist?(f) && File.readable?(f) && File.size?(f) + + begin + default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) + rescue => e + RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" + end +end + +# read default_facts and merge them over what is provided by facterdb +default_facts.each do |fact, value| + add_custom_fact fact, value +end + +RSpec.configure do |c| + c.default_facts = default_facts + c.before :each do + # set to strictest setting for testing + # by default Puppet runs at warning level + Puppet.settings[:strict] = :warning + end + c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT'] + c.after(:suite) do + end +end + +# Ensures that a module is defined +# @param module_name Name of the module +def ensure_module_defined(module_name) + module_name.split('::').reduce(Object) do |last_module, next_module| + last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false) + last_module.const_get(next_module, false) + end +end + +# 'spec_overrides' from sync.yml will appear below this line diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/custom_winodws.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/custom_winodws.pp new file mode 100644 index 0000000..cbcc9ce --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/custom_winodws.pp @@ -0,0 +1,5 @@ +class role::custom_windows { + + include profile::custom_windows + +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/monitoring.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/monitoring.pp new file mode 100644 index 0000000..fcc1eef --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/monitoring.pp @@ -0,0 +1,6 @@ +class role::metrics { + + include profile::base + include profile::tools::nfs_mount + include profile::tools::docker_install +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/node.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/node.pp new file mode 100644 index 0000000..9a5dc59 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/node.pp @@ -0,0 +1,5 @@ +class role::node { + + include profile::base + +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/puppetserver.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/puppetserver.pp new file mode 100644 index 0000000..facdd72 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/puppetserver.pp @@ -0,0 +1,6 @@ +class role::puppetserver { + + include profile::base + include profile::puppetserver + +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/windows.pp b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/windows.pp new file mode 100644 index 0000000..ca7f28e --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/site-modules/role/manifests/windows.pp @@ -0,0 +1,5 @@ +class role::windows { + + include profile::windows + +} diff --git a/.onceover/etc/puppetlabs/code/environments/production/spec/factsets/README.md b/.onceover/etc/puppetlabs/code/environments/production/spec/factsets/README.md new file mode 100644 index 0000000..dd72566 --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/spec/factsets/README.md @@ -0,0 +1,7 @@ +# Factsets + +This directory is where we put any custom factsets that we want to use. They can be generated by running `puppet facts` on the target system. + +**Hot tip:** If you already have factsets in here when you run `onceover init` they will be picked up and added to the config file Automatically + +More info: https://github.com/dylanratcliffe/onceover#factsets diff --git a/.onceover/etc/puppetlabs/code/environments/production/spec/onceover.yaml b/.onceover/etc/puppetlabs/code/environments/production/spec/onceover.yaml new file mode 100644 index 0000000..598b2fe --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/spec/onceover.yaml @@ -0,0 +1,61 @@ +# Classes to be tested +classes: + - role::metrics + - role::puppetserver + - role::windows + - role::node + - role::custom_windows + +# Nodes to tests classes on, this refers to a 'factset' or 'nodeset' +# depending on whether you are running 'spec' or 'acceptance' tests +nodes: + - AIX-7.1-powerpc + - SLES-12.1-64 + - Debian-6.0.10-32 + - CentOS-6.6-64 + - Ubuntu-12.04-32 + - Amazon-2018.03 + - Ubuntu-12.04-64 + - CentOS-6.6-32 + - Debian-6.0.10-64 + - AIX-6.1-powerpc + - Windows_Server-2012r2-64 + - Ubuntu-18.04-64 + - RHEL-7.4 + - Debian-7.8-32 + - windows-10-64 + - Windows_Server-2008r2-64 + - SLES-11.3-64 + - Debian-7.8-64 + - solaris-10_u9-sparc-64 + - solaris-11.2-sparc-64 + - Ubuntu-14.04-32 + - CentOS-5.11-64 + - CentOS-5.11-32 + - RHEL-6.7 + - CentOS-7.0-64 + - Ubuntu-14.04-64 + +# You can group classes here to save typing +class_groups: + +# You can group nodes here to save typing +# We have created a 'non_windows_nodes' group because we can't +# give you Windows vagrant boxes to test with because licensing, +# we can give you fact sets though so go crazy with spec testing! +node_groups: + windows_nodes: + - Windows_Server-2012r2-64 + - windows-10-64 + - Windows_Server-2008r2-64 + non_windows_nodes: + include: 'all_nodes' + exclude: 'windows_nodes' + +test_matrix: + - all_nodes: + classes: 'all_classes' + tests: 'spec' + - non_windows_nodes: + classes: 'all_classes' + tests: 'acceptance' \ No newline at end of file diff --git a/.onceover/etc/puppetlabs/code/environments/production/spec/pre_conditions/README.md b/.onceover/etc/puppetlabs/code/environments/production/spec/pre_conditions/README.md new file mode 100644 index 0000000..f0a81bf --- /dev/null +++ b/.onceover/etc/puppetlabs/code/environments/production/spec/pre_conditions/README.md @@ -0,0 +1,24 @@ +# Pre Conditions + +This folder should contain any \*.pp files that you want to be included in every test. + +A common use of this is defining resources that may not exist in the catalog when you are running tests. For example, if we are using a resource that tries to restart the `pe-puppetserver` service, unless it is compiled on a Puppet Maser the `pe-puppetserver` service will not exist and the catalog will fail to compile. To get around this we can create a .pp file and define the resource like so: + +``` puppet +# We are not going to actually have this service anywhere on our servers but +# our code needs to refresh it. This is to trick puppet into doing nothing +service { 'pe-puppetserver': + ensure => 'running', + enable => false, + hasrestart => false, # Force Puppet to use start and stop to restart + start => 'echo "Start"', # This will always exit 0 + stop => 'echo "Stop"', # This will also always exit 0 + hasstatus => false, # Force puppet to use our command for status + status => 'echo "Status"', # This will always exit 0 and therefore Puppet will think the service is running + provider => 'base', +} +``` + +This will mean that the `pe-puppetserver` service is in the catalog for spec testing and will even allow you to try to restart it during acceptance tests without the service actually being present. + +More info: https://github.com/dylanratcliffe/onceover#using-workarounds diff --git a/.onceover/spec.xml b/.onceover/spec.xml new file mode 100644 index 0000000..88b5aa4 --- /dev/null +++ b/.onceover/spec.xml @@ -0,0 +1,344 @@ + + + + + +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_AIX-6.1-powerpc_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_AIX-7.1-powerpc_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Amazon-2018.03_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_CentOS-5.11-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_CentOS-5.11-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_CentOS-6.6-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_CentOS-6.6-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_CentOS-7.0-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Debian-6.0.10-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Debian-6.0.10-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Debian-7.8-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Debian-7.8-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_RHEL-6.7_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_RHEL-7.4_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_SLES-11.3-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_SLES-12.1-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Ubuntu-12.04-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Ubuntu-12.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Ubuntu-14.04-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Ubuntu-14.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Ubuntu-18.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Windows_Server-2008r2-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_Windows_Server-2012r2-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_solaris-10_u9-sparc-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_solaris-11.2-sparc-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::custom_windows for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__custom_windows_on_windows-10-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_AIX-6.1-powerpc_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_AIX-7.1-powerpc_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Amazon-2018.03_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_CentOS-5.11-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_CentOS-5.11-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_CentOS-6.6-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_CentOS-6.6-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_CentOS-7.0-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Debian-6.0.10-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Debian-6.0.10-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Debian-7.8-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Debian-7.8-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_RHEL-6.7_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_RHEL-7.4_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_SLES-11.3-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_SLES-12.1-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Ubuntu-12.04-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Ubuntu-12.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Ubuntu-14.04-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Ubuntu-14.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Ubuntu-18.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Windows_Server-2008r2-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_Windows_Server-2012r2-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_solaris-10_u9-sparc-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_solaris-11.2-sparc-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::metrics for christophers-macbook-pro.local (line: 11, column: 1) on node christophers-macbook-pro.local +./spec/classes/role__metrics_on_windows-10-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, ssh supports osfamilies RedHat, Suse, Debian and Solaris. Detected osfamily is <AIX>. (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 389, column: 7) on node christophers-macbook-pro.local +./spec/classes/role__node_on_AIX-6.1-powerpc_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, ssh supports osfamilies RedHat, Suse, Debian and Solaris. Detected osfamily is <AIX>. (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 389, column: 7) on node christophers-macbook-pro.local +./spec/classes/role__node_on_AIX-7.1-powerpc_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Amazon-2018.03_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_CentOS-5.11-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_CentOS-5.11-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_CentOS-6.6-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_CentOS-6.6-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_CentOS-7.0-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 6.0.10 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Debian-6.0.10-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 6.0.10 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Debian-6.0.10-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Debian-7.8-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Debian-7.8-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_RHEL-6.7_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_RHEL-7.4_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_SLES-11.3-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_SLES-12.1-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 12.04 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Ubuntu-12.04-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 12.04 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Ubuntu-12.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 14.04 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Ubuntu-14.04-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 14.04 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Ubuntu-14.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Ubuntu-18.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Resolv_conf]: expects a value for parameter 'config_file' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp, line: 12, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Windows_Server-2008r2-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Resolv_conf]: expects a value for parameter 'config_file' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp, line: 12, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_Windows_Server-2012r2-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_solaris-10_u9-sparc-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_solaris-11.2-sparc-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Resolv_conf]: expects a value for parameter 'config_file' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp, line: 12, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__node_on_windows-10-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, ssh supports osfamilies RedHat, Suse, Debian and Solaris. Detected osfamily is <AIX>. (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 389, column: 7) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_AIX-6.1-powerpc_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, ssh supports osfamilies RedHat, Suse, Debian and Solaris. Detected osfamily is <AIX>. (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 389, column: 7) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_AIX-7.1-powerpc_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Amazon-2018.03_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_CentOS-5.11-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_CentOS-5.11-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_CentOS-6.6-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_CentOS-6.6-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_CentOS-7.0-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 6.0.10 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Debian-6.0.10-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 6.0.10 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Debian-6.0.10-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Debian-7.8-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Debian-7.8-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_RHEL-6.7_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_RHEL-7.4_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_SLES-11.3-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_SLES-12.1-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 12.04 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Ubuntu-12.04-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 12.04 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Ubuntu-12.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 14.04 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Ubuntu-14.04-32_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Function Call, Operating System : 14.04 not supported (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 332, column: 20) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Ubuntu-14.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Ubuntu-18.04-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Resolv_conf]: expects a value for parameter 'config_file' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp, line: 12, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Windows_Server-2008r2-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Resolv_conf]: expects a value for parameter 'config_file' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp, line: 12, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_Windows_Server-2012r2-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_solaris-10_u9-sparc-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'sshkey' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules/ssh/manifests/init.pp, line: 1089, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_solaris-11.2-sparc-64_spec.rb:37:in `block (3 levels) in <top (required)>' +Failure/Error: it { should compile } + error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Resolv_conf]: expects a value for parameter 'config_file' (file: /Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/site-modules/profile/manifests/base/resolv.pp, line: 12, column: 3) on node christophers-macbook-pro.local +./spec/classes/role__puppetserver_on_windows-10-64_spec.rb:37:in `block (3 levels) in <top (required)>' + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.onceover/spec/classes/role__custom_windows_on_AIX-6.1-powerpc_spec.rb b/.onceover/spec/classes/role__custom_windows_on_AIX-6.1-powerpc_spec.rb new file mode 100644 index 0000000..3087d81 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_AIX-6.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set AIX-6.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.8.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.5.0", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-61-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.35", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.35", "ipaddress_lo0"=>"127.0.0.1", "kernel"=>"AIX", "kernelmajversion"=>"6100", "kernelrelease"=>"6100-07-04-1216", "kernelversion"=>"6100", "macaddress"=>"66:a4:d9:f8:4a:04", "macaddress_en0"=>"66:a4:d9:f8:4a:04", "memory"=>{"swap"=>{"available"=>"410.43 MiB", "available_bytes"=>430366720, "capacity"=>"19.84%", "total"=>"512.00 MiB", "total_bytes"=>536870912, "used"=>"101.57 MiB", "used_bytes"=>106504192}, "system"=>{"available"=>"10.88 MiB", "available_bytes"=>11403264, "capacity"=>"98.94%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1013.13 MiB", "used_bytes"=>1062338560}}, "memoryfree"=>"10.88 MiB", "memoryfree_mb"=>10.875, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-61-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.35", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"6100", "operatingsystemrelease"=>"6100-07-04-1216", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"6100-07-04-1216", "major"=>"6100"}}, "osfamily"=>"AIX", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppetversion"=>"4.8.1", "ruby"=>{"platform"=>"powerpc-aix6.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix6.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2", "sha256"=>"SSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d", "sha256"=>"SSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY=", "sshfp_dsa"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2\nSSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945", "sshfp_rsa"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d\nSSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch", "swapfree"=>"410.43 MiB", "swapfree_mb"=>410.4296875, "swapsize"=>"512.00 MiB", "swapsize_mb"=>512.0, "system_uptime"=>{"days"=>418, "hours"=>10035, "seconds"=>36127200, "uptime"=>"418 days"}, "timezone"=>"PST", "uptime"=>"418 days", "uptime_days"=>418, "uptime_hours"=>10035, "uptime_seconds"=>36127200, "clientcert"=>"pe-aix-61-se.delivery.puppetlabs.net", "clientversion"=>"4.8.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'AIX-6.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_AIX-7.1-powerpc_spec.rb b/.onceover/spec/classes/role__custom_windows_on_AIX-7.1-powerpc_spec.rb new file mode 100644 index 0000000..b2c3c06 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_AIX-7.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set AIX-7.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.5.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.2.0", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-71-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.36", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.36", "ipaddress_lo0"=>"127.0.0.1", "is_pe"=>false, "kernel"=>"AIX", "kernelmajversion"=>"7100", "kernelrelease"=>"7100-01-05-1228", "kernelversion"=>"7100", "macaddress"=>"66:a4:dc:28:bf:04", "macaddress_en0"=>"66:a4:dc:28:bf:04", "memory"=>{"swap"=>{"available"=>"1007.14 MiB", "available_bytes"=>1056063488, "capacity"=>"1.65%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"16.86 MiB", "used_bytes"=>17678336}, "system"=>{"available"=>"16.84 MiB", "available_bytes"=>17653760, "capacity"=>"98.36%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1007.16 MiB", "used_bytes"=>1056088064}}, "memoryfree"=>"16.84 MiB", "memoryfree_mb"=>16.8359375, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-71-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.36", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"7100", "operatingsystemrelease"=>"7100-01-05-1228", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"7100-01-05-1228", "major"=>"7100"}}, "osfamily"=>"AIX", "package_provider"=>"aix", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppet_environmentpath"=>"/etc/puppetlabs/code/environments", "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.5.2", "root_home"=>"/root", "ruby"=>{"platform"=>"powerpc-aix7.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix7.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "service_provider"=>"src", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c", "sha256"=>"SSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5", "sha256"=>"SSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y=", "sshfp_dsa"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c\nSSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a", "sshfp_rsa"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5\nSSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB", "swapfree"=>"1007.14 MiB", "swapfree_mb"=>1007.140625, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1024.0, "system_uptime"=>{"days"=>160, "hours"=>3847, "seconds"=>13852500, "uptime"=>"160 days"}, "timezone"=>"PST", "uptime"=>"160 days", "uptime_days"=>160, "uptime_hours"=>3847, "uptime_seconds"=>13852500, "clientcert"=>"pe-aix-71-se.delivery.puppetlabs.net", "clientversion"=>"4.5.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'AIX-7.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Amazon-2018.03_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Amazon-2018.03_spec.rb new file mode 100644 index 0000000..0addc95 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Amazon-2018.03_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Amazon-2018.03" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"10/16/2017", "bios_vendor"=>"Amazon EC2", "bios_version"=>"1.0", "blockdevice_nvme0n1_model"=>"Amazon Elastic Block Store", "blockdevice_nvme0n1_size"=>8589934592, "blockdevices"=>"nvme0n1", "boardassettag"=>"i-0816d4c53ff8dc6a2", "boardmanufacturer"=>"Amazon EC2", "chassisassettag"=>"Amazon EC2", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"172.31.0.1", "system"=>"172.31.0.1"}, "disks"=>{"nvme0n1"=>{"model"=>"Amazon Elastic Block Store", "size"=>"8.00 GiB", "size_bytes"=>8589934592}}, "dmi"=>{"bios"=>{"release_date"=>"10/16/2017", "vendor"=>"Amazon EC2", "version"=>"1.0"}, "board"=>{"asset_tag"=>"i-0816d4c53ff8dc6a2", "manufacturer"=>"Amazon EC2"}, "chassis"=>{"asset_tag"=>"Amazon EC2", "type"=>"Other"}, "manufacturer"=>"Amazon EC2", "product"=>{"name"=>"t3a.xlarge", "serial_number"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA"}}, "domain"=>"us-west-2.compute.internal", "ec2_metadata"=>{"ami-id"=>"ami-01e24be29428c15b2", "ami-launch-index"=>"0", "ami-manifest-path"=>"(unknown)", "block-device-mapping"=>{"ami"=>"xvda", "root"=>"/dev/xvda"}, "events"=>{"maintenance"=>{"history"=>"[]", "scheduled"=>"[]"}}, "hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "identity-credentials"=>{"ec2"=>{"info"=>"{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2019-05-07T01:03:28Z\",\n \"AccountId\" : \"581165678935\"\n}"}}, "instance-action"=>"none", "instance-id"=>"i-0816d4c53ff8dc6a2", "instance-type"=>"t3a.xlarge", "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "metrics"=>{"vhostmd"=>""}, "network"=>{"interfaces"=>{"macs"=>{"0a:ca:e0:39:c1:f6"=>{"device-number"=>"0", "interface-id"=>"eni-04e7710af3cf1699c", "ipv4-associations"=>{"34.209.204.164"=>"172.31.3.153"}, "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4s"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "owner-id"=>"581165678935", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4s"=>"34.209.204.164", "security-group-ids"=>"sg-05a2c52388c24f3ae", "security-groups"=>"launch-wizard-2", "subnet-id"=>"subnet-3bafc660", "subnet-ipv4-cidr-block"=>"172.31.0.0/20", "vpc-id"=>"vpc-287af44e", "vpc-ipv4-cidr-block"=>"172.31.0.0/16", "vpc-ipv4-cidr-blocks"=>"172.31.0.0/16"}}}}, "placement"=>{"availability-zone"=>"us-west-2c"}, "profile"=>"default-hvm", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4"=>"34.209.204.164", "public-keys"=>{"0"=>{"openssh-key"=>"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDk1QR+MwLPRohIOiWbCC8xjJKFYeCjIh2g2wAKnZFCkPjCG9BD3L4URnszJXdv+5XylfWO1y9O1Z95etjWfObApRZ5Ej22Dz1EExWWRNOKl9QdrEfCACSlc5gbT5rflHd/He9eD5OFRHlMY8fNIApEKdQrlxZgr1/NOusVQggoS/MiszxCl0dob3kz86XX6PrAmMyGfv7j/mPeeEUzP3bGxtjJyaZGcwukjPvlgq1yI4AzZlveY8fnokRsh9uDHXUEVB2hLNaBBZB/Evw261J/+QsnKopAuqQpwct/n/ulbg+w1h/2ZBiDXDBK8DQ8kOC4zuum6qwri1KNKdX9zIif thinkpad"}}, "reservation-id"=>"r-0b89c0e198506ec1f", "security-groups"=>"launch-wizard-2", "services"=>{"domain"=>"amazonaws.com", "partition"=>"aws"}}, "facterversion"=>"3.12.4", "filesystems"=>"ext3,ext4", "fips_enabled"=>false, "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ip-172-31-3-153", "hypervisors"=>{"kvm"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"172.31.3.153", "ipaddress6"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_eth0"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"172.31.3.153", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.14", "kernelrelease"=>"4.14.77-70.59.amzn1.x86_64", "kernelversion"=>"4.14.77", "load_averages"=>{"15m"=>0.02, "1m"=>0.12, "5m"=>0.06}, "macaddress"=>"0a:ca:e0:39:c1:f6", "macaddress_eth0"=>"0a:ca:e0:39:c1:f6", "manufacturer"=>"Amazon EC2", "memory"=>{"system"=>{"available"=>"15.36 GiB", "available_bytes"=>16489611264, "capacity"=>"1.10%", "total"=>"15.53 GiB", "total_bytes"=>16673153024, "used"=>"175.04 MiB", "used_bytes"=>183541760}}, "memoryfree"=>"15.36 GiB", "memoryfree_mb"=>15725.71875, "memorysize"=>"15.53 GiB", "memorysize_mb"=>15900.7578125, "mountpoints"=>{"/"=>{"available"=>"6.55 GiB", "available_bytes"=>7033344000, "capacity"=>"15.45%", "device"=>"/dev/nvme0n1p1", "filesystem"=>"ext4", "options"=>["rw", "noatime", "data=ordered"], "size"=>"7.75 GiB", "size_bytes"=>8318783488, "used"=>"1.20 GiB", "used_bytes"=>1285439488}, "/dev/shm"=>{"available"=>"7.76 GiB", "available_bytes"=>8336576512, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"7.76 GiB", "size_bytes"=>8336576512, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>9001, "mtu_lo"=>65536, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.240.0", "netmask_lo"=>"255.0.0.0", "network"=>"172.31.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"172.31.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"172.31.0.1", "domain"=>"us-west-2.compute.internal", "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "hostname"=>"ip-172-31-3-153", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"172.31.3.153", "netmask"=>"255.255.240.0", "network"=>"172.31.0.0"}], "bindings6"=>[{"address"=>"fe80::8ca:e0ff:fe39:c1f6", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"172.31.0.1", "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"Amazon", "operatingsystemmajrelease"=>"2018", "operatingsystemrelease"=>"2018.03", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"Amazon", "release"=>{"full"=>"2018.03", "major"=>"2018", "minor"=>"03"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/nvme0n1p1"=>{"filesystem"=>"ext4", "label"=>"/", "mount"=>"/", "partlabel"=>"Linux", "partuuid"=>"893c59db-bd86-4d67-b40f-221bc82c14c8", "size"=>"8.00 GiB", "size_bytes"=>8587820544, "uuid"=>"f25f5092-0401-4edb-9fac-c57f3c673803"}, "/dev/nvme0n1p128"=>{"partlabel"=>"BIOS Boot Partition", "partuuid"=>"9d1c14c8-e25b-4405-9171-de3c756f61b2", "size"=>"1.00 MiB", "size_bytes"=>1048576}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin", "physicalprocessorcount"=>1, "processor0"=>"AMD EPYC 7571", "processor1"=>"AMD EPYC 7571", "processor2"=>"AMD EPYC 7571", "processor3"=>"AMD EPYC 7571", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571"], "physicalcount"=>1}, "productname"=>"t3a.xlarge", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>false, "serialnumber"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd", "sha256"=>"SSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f"}, "key"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4", "sha256"=>"SSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc", "sha256"=>"SSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28", "sha256"=>"SSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "sshfp_dsa"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd\nSSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f", "sshfp_ecdsa"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4\nSSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b", "sshfp_ed25519"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc\nSSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f", "sshfp_rsa"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28\nSSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>136, "uptime"=>"0:02 hours"}, "timezone"=>"UTC", "uptime"=>"0:02 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>136, "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA", "virtual"=>"kvm", "clientcert"=>"ip-172-31-3-153.us-west-2.compute.internal", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Amazon-2018.03' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_CentOS-5.11-32_spec.rb b/.onceover/spec/classes/role__custom_windows_on_CentOS-5.11-32_spec.rb new file mode 100644 index 0000000..c76b58b --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_CentOS-5.11-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set CentOS-5.11-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>0, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>0}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:febf:56", "ipaddress6_eth0"=>"fe80::a00:27ff:febf:56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.11, "1m"=>0.28, "5m"=>0.22}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:bf:00:56", "macaddress_eth0"=>"08:00:27:bf:00:56", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"429.48 MiB", "available_bytes"=>450342912, "capacity"=>"14.58%", "total"=>"502.80 MiB", "total_bytes"=>527220736, "used"=>"73.32 MiB", "used_bytes"=>76877824}}, "memoryfree"=>"429.48 MiB", "memoryfree_mb"=>429.48046875, "memorysize"=>"502.80 MiB", "memorysize_mb"=>502.796875, "mountpoints"=>{"/"=>{"available"=>"1.09 GiB", "available_bytes"=>1171632128, "capacity"=>"52.22%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"2.28 GiB", "size_bytes"=>-1842671616, "used"=>"1.19 GiB", "used_bytes"=>1280663552}, "/boot"=>{"available"=>"86.58 MiB", "available_bytes"=>90790912, "capacity"=>"12.29%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.13 MiB", "used_bytes"=>12721152}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f", "sha256"=>"SSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940"}, "key"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5", "sha256"=>"SSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo=", "sshfp_dsa"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f\nSSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940", "sshfp_rsa"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5\nSSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1067, "uptime"=>"0:17 hours"}, "timezone"=>"UTC", "uptime"=>"0:17 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1067, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'CentOS-5.11-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_CentOS-5.11-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_CentOS-5.11-64_spec.rb new file mode 100644 index 0000000..62d8062 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_CentOS-5.11-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set CentOS-5.11-64" do + node_facts = {"architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>21474836480, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>21474836480}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_eth0"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:3e:49:87", "macaddress_eth0"=>"08:00:27:3e:49:87", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"389.45 MiB", "available_bytes"=>408363008, "capacity"=>"21.76%", "total"=>"497.78 MiB", "total_bytes"=>521961472, "used"=>"108.34 MiB", "used_bytes"=>113598464}}, "memoryfree"=>"389.45 MiB", "memoryfree_mb"=>389.4453125, "memorysize"=>"497.78 MiB", "memorysize_mb"=>497.78125, "mountpoints"=>{"/"=>{"available"=>"16.96 GiB", "available_bytes"=>18212638720, "capacity"=>"7.23%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"18.28 GiB", "size_bytes"=>19632164864, "used"=>"1.32 GiB", "used_bytes"=>1419526144}, "/boot"=>{"available"=>"86.04 MiB", "available_bytes"=>90215424, "capacity"=>"12.85%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.68 MiB", "used_bytes"=>13296640}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d", "sha256"=>"SSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7", "sha256"=>"SSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ==", "sshfp_dsa"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d\nSSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb", "sshfp_rsa"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7\nSSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>847, "uptime"=>"0:14 hours"}, "timezone"=>"UTC", "uptime"=>"0:14 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>847, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'CentOS-5.11-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_CentOS-6.6-32_spec.rb b/.onceover/spec/classes/role__custom_windows_on_CentOS-6.6-32_spec.rb new file mode 100644 index 0000000..4a03264 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_CentOS-6.6-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set CentOS-6.6-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_eth0"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.el6.i686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:ff:42:e5", "macaddress_eth0"=>"08:00:27:ff:42:e5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.00 GiB", "available_bytes"=>1073737728, "capacity"=>"0%", "total"=>"1.00 GiB", "total_bytes"=>1073737728, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"451.91 MiB", "available_bytes"=>473862144, "capacity"=>"9.40%", "total"=>"498.82 MiB", "total_bytes"=>523051008, "used"=>"46.91 MiB", "used_bytes"=>49188864}}, "memoryfree"=>"451.91 MiB", "memoryfree_mb"=>451.91015625, "memorysize"=>"498.82 MiB", "memorysize_mb"=>498.8203125, "mountpoints"=>{"/"=>{"available"=>"1.02 GiB", "available_bytes"=>1099689984, "capacity"=>"51.05%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"2.09 GiB", "size_bytes"=>-2048442368, "used"=>"1.07 GiB", "used_bytes"=>1146834944}, "/boot"=>{"available"=>"450.39 MiB", "available_bytes"=>472266752, "capacity"=>"5.42%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"25.83 MiB", "used_bytes"=>27088896}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"i386", "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"bc353fb2-82b1-4d41-a43e-6512030a2a28"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"eb19f39e-a1cc-4e43-bf33-809fa7f52044"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"51727e98-6cd5-4fba-8a1f-7d4dfb575e1f"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>-525336576, "uuid"=>"vkG7sJ-bfu3-Cko3-YJ7v-jPys-3uHe-vki0jZ"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe", "sha256"=>"SSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877"}, "key"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8", "sha256"=>"SSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow==", "sshfp_dsa"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe\nSSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877", "sshfp_rsa"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8\nSSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw==", "swapfree"=>"1.00 GiB", "swapfree_mb"=>1023.99609375, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1023.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>430, "uptime"=>"0:07 hours"}, "timezone"=>"UTC", "uptime"=>"0:07 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>430, "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'CentOS-6.6-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_CentOS-6.6-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_CentOS-6.6-64_spec.rb new file mode 100644 index 0000000..350fb8a --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_CentOS-6.6-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set CentOS-6.6-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos6a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.7", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth0"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth1"=>"fe80::a00:27ff:fe66:988a", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.88", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.7", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.8.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:0f:d2:76", "macaddress_eth0"=>"08:00:27:0f:d2:76", "macaddress_eth1"=>"08:00:27:66:98:8a", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"992.00 MiB", "available_bytes"=>1040183296, "capacity"=>"0%", "total"=>"992.00 MiB", "total_bytes"=>1040183296, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"348.41 MiB", "available_bytes"=>365338624, "capacity"=>"28.95%", "total"=>"490.39 MiB", "total_bytes"=>514215936, "used"=>"141.98 MiB", "used_bytes"=>148877312}}, "memoryfree"=>"348.41 MiB", "memoryfree_mb"=>348.4140625, "memorysize"=>"490.39 MiB", "memorysize_mb"=>490.39453125, "mountpoints"=>{"/"=>{"available"=>"16.94 GiB", "available_bytes"=>18193268736, "capacity"=>"6.51%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"18.12 GiB", "size_bytes"=>19459338240, "used"=>"1.18 GiB", "used_bytes"=>1266069504}, "/boot"=>{"available"=>"448.35 MiB", "available_bytes"=>470125568, "capacity"=>"5.85%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"27.88 MiB", "used_bytes"=>29230080}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8555670, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "hostname"=>"centos6a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.88", "ip6"=>"fe80::a00:27ff:fe66:988a", "mac"=>"08:00:27:66:98:8a", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"a29409f8-0b58-4271-a348-032caefec8b8"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b30b464a-8ac9-492a-a1c5-2da75bb7488a"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"da946872-1406-4ac1-9a4d-f7ce5f7be47e"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"nRdWPh-INkA-aHPs-TNtk-HjJG-SxBU-DdqI8a"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-6-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8", "sha256"=>"SSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745"}, "key"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef", "sha256"=>"SSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg==", "sshfp_dsa"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8\nSSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745", "sshfp_rsa"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef\nSSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ==", "staging_http_get"=>"curl", "swapfree"=>"992.00 MiB", "swapfree_mb"=>991.99609375, "swapsize"=>"992.00 MiB", "swapsize_mb"=>991.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>352, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>352, "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C", "virtual"=>"virtualbox", "clientcert"=>"centos6a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'CentOS-6.6-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_CentOS-7.0-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_CentOS-7.0-64_spec.rb new file mode 100644 index 0000000..03011e2 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_CentOS-7.0-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set CentOS-7.0-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"sydney", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "enp0s8"=>"192.168.56.100", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF"}}, "domain"=>"syd.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"xfs", "fqdn"=>"centos7b.syd.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos7b", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,enp0s8,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s3"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s8"=>"fe80::a00:27ff:fe39:832c", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_enp0s8"=>"10.20.1.92", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-123.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.26, "5m"=>0.12}, "macaddress"=>"08:00:27:39:18:3c", "macaddress_enp0s3"=>"08:00:27:39:18:3c", "macaddress_enp0s8"=>"08:00:27:39:83:2c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.03 GiB", "available_bytes"=>1107292160, "capacity"=>"0%", "total"=>"1.03 GiB", "total_bytes"=>1107292160, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"297.76 MiB", "available_bytes"=>312225792, "capacity"=>"39.28%", "total"=>"490.41 MiB", "total_bytes"=>514228224, "used"=>"192.64 MiB", "used_bytes"=>202002432}}, "memoryfree"=>"297.76 MiB", "memoryfree_mb"=>297.76171875, "memorysize"=>"490.41 MiB", "memorysize_mb"=>490.40625, "mountpoints"=>{"/"=>{"available"=>"17.30 GiB", "available_bytes"=>18574749696, "capacity"=>"6.32%", "device"=>"/dev/mapper/centos-root", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"18.47 GiB", "size_bytes"=>19828572160, "used"=>"1.17 GiB", "used_bytes"=>1253822464}, "/boot"=>{"available"=>"393.11 MiB", "available_bytes"=>412209152, "capacity"=>"20.85%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.67 MiB", "size_bytes"=>520794112, "used"=>"103.55 MiB", "used_bytes"=>108584960}}, "mtu_enp0s3"=>1500, "mtu_enp0s8"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8563388, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s8"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_enp0s8"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_enp0s8"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_enp0s8"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"syd.puppetlabs.demo", "fqdn"=>"centos7b.syd.puppetlabs.demo", "hostname"=>"centos7b", "interfaces"=>{"enp0s3"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "enp0s8"=>{"dhcp"=>"192.168.56.100", "ip"=>"10.20.1.92", "ip6"=>"fe80::a00:27ff:fe39:832c", "mac"=>"08:00:27:39:83:2c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.0.1406", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"7.0.1406", "major"=>"7", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/centos-root"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"db651e5f-a2c2-4236-9570-6226f63e1fcd"}, "/dev/mapper/centos-swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"ff4ec16c-28c0-4715-846d-11e7c9b4e53b"}, "/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"39ce4ad1-4e9d-49a4-bce0-8a30b459490a"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"pg7zVv-M3hI-zpjY-eYlZ-06aD-ZRO2-J30GLd"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-7-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb", "sha256"=>"SSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581", "sha256"=>"SSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4=", "sshfp_ecdsa"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb\nSSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba", "sshfp_rsa"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581\nSSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1", "staging_http_get"=>"curl", "swapfree"=>"1.03 GiB", "swapfree_mb"=>1055.99609375, "swapsize"=>"1.03 GiB", "swapsize_mb"=>1055.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>78, "uptime"=>"0:01 hours"}, "timezone"=>"UTC", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>78, "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF", "virtual"=>"virtualbox", "clientcert"=>"centos7b.syd.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'CentOS-7.0-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Debian-6.0.10-32_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Debian-6.0.10-32_spec.rb new file mode 100644 index 0000000..1dad79c --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Debian-6.0.10-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Debian-6.0.10-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_eth0"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:ad:dc:1c", "macaddress_eth0"=>"08:00:27:ad:dc:1c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"434.46 MiB", "available_bytes"=>455565312, "capacity"=>"13.56%", "total"=>"502.63 MiB", "total_bytes"=>527040512, "used"=>"68.16 MiB", "used_bytes"=>71475200}}, "memoryfree"=>"434.46 MiB", "memoryfree_mb"=>434.4609375, "memorysize"=>"502.63 MiB", "memorysize_mb"=>502.625, "mountpoints"=>{"/"=>{"available"=>"1.69 GiB", "available_bytes"=>1819041792, "capacity"=>"35.07%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"937.10 MiB", "used_bytes"=>982618112}, "/boot"=>{"available"=>"213.27 MiB", "available_bytes"=>223632384, "capacity"=>"6.35%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"14.45 MiB", "used_bytes"=>15155200}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"092d5625-eb03-443c-953f-006bec7d5476"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"f9e1cf7c-ab54-4949-8e55-290adc8d853f"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"2c798378-1738-426f-a847-c929a507fc73"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"cG2Syv-bT1d-2TyA-Wqgz-33I2-RnTz-jA2LxS"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57", "sha256"=>"SSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09"}, "key"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b", "sha256"=>"SSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g==", "sshfp_dsa"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57\nSSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09", "sshfp_rsa"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b\nSSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1441, "uptime"=>"0:24 hours"}, "timezone"=>"PST", "uptime"=>"0:24 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1441, "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Debian-6.0.10-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Debian-6.0.10-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Debian-6.0.10-64_spec.rb new file mode 100644 index 0000000..e29b6ff --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Debian-6.0.10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Debian-6.0.10-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_eth0"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-amd64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:62:fa:69", "macaddress_eth0"=>"08:00:27:62:fa:69", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.43 MiB", "available_bytes"=>401010688, "capacity"=>"23.04%", "total"=>"496.90 MiB", "total_bytes"=>521035776, "used"=>"114.46 MiB", "used_bytes"=>120025088}}, "memoryfree"=>"382.43 MiB", "memoryfree_mb"=>382.43359375, "memorysize"=>"496.90 MiB", "memorysize_mb"=>496.8984375, "mountpoints"=>{"/"=>{"available"=>"17.65 GiB", "available_bytes"=>18949697536, "capacity"=>"5.16%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"984.03 MiB", "used_bytes"=>1031831552}, "/boot"=>{"available"=>"212.24 MiB", "available_bytes"=>222552064, "capacity"=>"6.80%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"15.48 MiB", "used_bytes"=>16235520}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"d2763d16-5203-4625-8733-a6f2ecc94f5a"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b5661448-0339-4ba3-8593-21cc6a049d33"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"415531d6-6955-433f-921e-8f266ab56649"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vGb2LM-M1SP-IynO-OZJV-sYKl-Pcfo-fAFbiz"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f", "sha256"=>"SSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad"}, "key"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2", "sha256"=>"SSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ", "sshfp_dsa"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f\nSSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad", "sshfp_rsa"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2\nSSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1211, "uptime"=>"0:20 hours"}, "timezone"=>"PST", "uptime"=>"0:20 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1211, "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Debian-6.0.10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Debian-7.8-32_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Debian-7.8-32_spec.rb new file mode 100644 index 0000000..f3166f3 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Debian-7.8-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Debian-7.8-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_eth0"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-686-pae", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:18:59:a5", "macaddress_eth0"=>"08:00:27:18:59:a5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"432.02 MiB", "available_bytes"=>453001216, "capacity"=>"14.00%", "total"=>"502.32 MiB", "total_bytes"=>526725120, "used"=>"70.31 MiB", "used_bytes"=>73723904}}, "memoryfree"=>"432.02 MiB", "memoryfree_mb"=>432.015625, "memorysize"=>"502.32 MiB", "memorysize_mb"=>502.32421875, "mountpoints"=>{"/"=>{"available"=>"1.52 GiB", "available_bytes"=>1633996800, "capacity"=>"41.68%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"1.09 GiB", "used_bytes"=>1167663104}, "/boot"=>{"available"=>"211.24 MiB", "available_bytes"=>221499392, "capacity"=>"7.24%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"16.49 MiB", "used_bytes"=>17288192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c87cb2c9-ffb8-48d1-bc31-024a57d3e44e"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"864df30a-fc50-4a93-8cfd-4624251c1589"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"b8ab8500-a238-4554-8d11-9c194ebba70c"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"NvdPwA-esP3-xUuv-n9OR-Ep7r-kQAr-qyUAzr"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa", "sha256"=>"SSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906"}, "key"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4", "sha256"=>"SSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d", "sha256"=>"SSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA=", "sshfp_dsa"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa\nSSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906", "sshfp_ecdsa"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4\nSSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480", "sshfp_rsa"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d\nSSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>800, "uptime"=>"0:13 hours"}, "timezone"=>"PST", "uptime"=>"0:13 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>800, "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Debian-7.8-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Debian-7.8-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Debian-7.8-64_spec.rb new file mode 100644 index 0000000..202fe1d --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Debian-7.8-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Debian-7.8-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_eth0"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-amd64", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:83:ad:56", "macaddress_eth0"=>"08:00:27:83:ad:56", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.02 MiB", "available_bytes"=>400576512, "capacity"=>"23.13%", "total"=>"496.96 MiB", "total_bytes"=>521101312, "used"=>"114.94 MiB", "used_bytes"=>120524800}}, "memoryfree"=>"382.02 MiB", "memoryfree_mb"=>382.01953125, "memorysize"=>"496.96 MiB", "memorysize_mb"=>496.9609375, "mountpoints"=>{"/"=>{"available"=>"17.49 GiB", "available_bytes"=>18781380608, "capacity"=>"6.01%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"1.12 GiB", "used_bytes"=>1200148480}, "/boot"=>{"available"=>"210.36 MiB", "available_bytes"=>220575744, "capacity"=>"7.63%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"17.37 MiB", "used_bytes"=>18211840}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"7b853135-fb91-48ff-a25c-8d34ada8d549"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"486756ce-bdd1-45f4-864d-e4b6fce59b9d"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"8aa50802-2811-43ec-9686-a30f6a1c3ade"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"eGBBBU-DZw3-wy0f-OMxw-Sf5d-jDyA-ctqcpx"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac", "sha256"=>"SSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a", "sha256"=>"SSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37", "sha256"=>"SSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI=", "sshfp_dsa"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac\nSSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144", "sshfp_ecdsa"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a\nSSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6", "sshfp_rsa"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37\nSSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>650, "uptime"=>"0:10 hours"}, "timezone"=>"PST", "uptime"=>"0:10 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>650, "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Debian-7.8-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_RHEL-6.7_spec.rb b/.onceover/spec/classes/role__custom_windows_on_RHEL-6.7_spec.rb new file mode 100644 index 0000000..d5c2d9c --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_RHEL-6.7_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set RHEL-6.7" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"sr0,sdb,sda", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-9727-3914-2228-1494-64", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-9727-3914-2228-1494-64"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0016-4348-2410-5386-3288-39", "uuid"=>"723914E4-94CB-0743-9847-001D218884D8"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext4,iso9660,udf", "fips_enabled"=>false, "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel6box", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.5", "ipaddress6"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_eth0"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.5", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-573.45.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.06, "1m"=>0.15, "5m"=>0.14}, "lsbdistcodename"=>"Santiago", "lsbdistdescription"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "lsbdistid"=>"RedHatEnterpriseServer", "lsbdistrelease"=>"6.7", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"7", "lsbrelease"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch", "macaddress"=>"00:0d:3a:96:ed:47", "macaddress_eth0"=>"00:0d:3a:96:ed:47", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.55 GiB", "available_bytes"=>8103010304, "capacity"=>"3.24%", "total"=>"7.80 GiB", "total_bytes"=>8374747136, "used"=>"259.15 MiB", "used_bytes"=>271736832}}, "memoryfree"=>"7.55 GiB", "memoryfree_mb"=>7727.6328125, "memorysize"=>"7.80 GiB", "memorysize_mb"=>7986.78125, "mountpoints"=>{"/"=>{"available"=>"27.90 GiB", "available_bytes"=>29956210688, "capacity"=>"9.68%", "device"=>"/dev/sda2", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"30.89 GiB", "size_bytes"=>33168420864, "used"=>"2.99 GiB", "used_bytes"=>3212210176}, "/boot"=>{"available"=>"402.87 MiB", "available_bytes"=>422435840, "capacity"=>"15.40%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"73.36 MiB", "used_bytes"=>76919808}, "/dev/shm"=>{"available"=>"3.90 GiB", "available_bytes"=>4187373568, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "rootcontext=\"system_u:object_r:tmpfs_t:s0\""], "size"=>"3.90 GiB", "size_bytes"=>4187373568, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506543104, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"49.09 GiB", "size_bytes"=>52708372480, "used"=>"2.05 GiB", "used_bytes"=>2201829376}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel6box", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.5", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe96:ed47", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.7", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Santiago", "description"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "id"=>"RedHatEnterpriseServer", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "specification"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "selinux"=>{"config_mode"=>"enforcing", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"24"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"ce2ad98e-bb9f-4603-abce-3db7fd857a6c"}, "/dev/sda2"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"be4cc18d-b110-4914-a6f9-52dc0dc66f68"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"aafc7ffe-f0b2-4872-8174-a05f24f6c3d4"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"24", "serialnumber"=>"0000-0016-4348-2410-5386-3288-39", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce", "sha256"=>"SSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd"}, "key"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "type"=>"ssh-dss"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d", "sha256"=>"SSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "sshfp_dsa"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce\nSSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd", "sshfp_rsa"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d\nSSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>239, "uptime"=>"0:03 hours"}, "timezone"=>"EDT", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>239, "uuid"=>"723914E4-94CB-0743-9847-001D218884D8", "virtual"=>"hyperv", "clientcert"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'RHEL-6.7' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_RHEL-7.4_spec.rb b/.onceover/spec/classes/role__custom_windows_on_RHEL-7.4_spec.rb new file mode 100644 index 0000000..0b7f25e --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_RHEL-7.4_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set RHEL-7.4" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_fd0_size"=>4096, "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"fd0,sda,sdb,sr0", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-6006-7746-5828-7871-43", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"fd0"=>{"size"=>"4.00 KiB", "size_bytes"=>4096}, "sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-6006-7746-5828-7871-43"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0017-8302-7891-2115-8198-39", "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext2,ext3,ext4,udf,xfs", "fips_enabled"=>false, "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel7test", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.6", "ipaddress6"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_eth0"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.6", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-693.46.1.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.08, "1m"=>0.32, "5m"=>0.19}, "macaddress"=>"00:0d:3a:90:57:80", "macaddress_eth0"=>"00:0d:3a:90:57:80", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.42 GiB", "available_bytes"=>7963906048, "capacity"=>"4.67%", "total"=>"7.78 GiB", "total_bytes"=>8353742848, "used"=>"371.78 MiB", "used_bytes"=>389836800}}, "memoryfree"=>"7.42 GiB", "memoryfree_mb"=>7594.97265625, "memorysize"=>"7.78 GiB", "memorysize_mb"=>7966.75, "mountpoints"=>{"/"=>{"available"=>"29.95 GiB", "available_bytes"=>32156790784, "capacity"=>"4.91%", "device"=>"/dev/sda2", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"31.50 GiB", "size_bytes"=>33817882624, "used"=>"1.55 GiB", "used_bytes"=>1661091840}, "/boot"=>{"available"=>"393.75 MiB", "available_bytes"=>412880896, "capacity"=>"20.72%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.66 MiB", "size_bytes"=>520785920, "used"=>"102.91 MiB", "used_bytes"=>107905024}, "/dev/shm"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506170368, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw", "seclabel", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52708212736, "used"=>"2.05 GiB", "used_bytes"=>2202042368}, "/run"=>{"available"=>"3.88 GiB", "available_bytes"=>4168146944, "capacity"=>"0.21%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"8.32 MiB", "used_bytes"=>8724480}, "/run/user/1000"=>{"available"=>"796.68 MiB", "available_bytes"=>835375104, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "relatime", "size=815796k", "mode=700", "uid=1000", "gid=1000"], "size"=>"796.68 MiB", "size_bytes"=>835375104, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "seclabel", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel7test", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.6", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe90:5780", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.4", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"7.4", "major"=>"7", "minor"=>"4"}, "selinux"=>{"config_mode"=>"enforcing", "config_policy"=>"targeted", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"28"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"b3f65ad5-0571-4ae4-937a-13ef2fda43e3"}, "/dev/sda2"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"e9643aa4-b339-43c4-afc5-fcac22af1584"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"07908b37-1661-4130-9d5a-e1fdb0a4bdb2"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_config_policy"=>"targeted", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"28", "serialnumber"=>"0000-0017-8302-7891-2115-8198-39", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7", "sha256"=>"SSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929", "sha256"=>"SSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a", "sha256"=>"SSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "type"=>"ssh-rsa"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "sshfp_ecdsa"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7\nSSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2", "sshfp_ed25519"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929\nSSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282", "sshfp_rsa"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a\nSSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>215, "uptime"=>"0:03 hours"}, "timezone"=>"UTC", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>215, "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7", "virtual"=>"hyperv", "clientcert"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'RHEL-7.4' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_SLES-11.3-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_SLES-11.3-64_spec.rb new file mode 100644 index 0000000..60b9048 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_SLES-11.3-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set SLES-11.3-64" do + node_facts = {"aio_agent_version"=>"1.8.3", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D"}}, "domain"=>"lan.asio", "facterversion"=>"3.5.1", "filesystems"=>"ext3,iso9660,squashfs", "fqdn"=>"sles11-sp3.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles11-sp3", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe48:617f", "ipaddress6_eth0"=>"fe80::216:3eff:fe48:617f", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.0", "kernelrelease"=>"3.0.101-0.47.67-default", "kernelversion"=>"3.0.101", "load_averages"=>{"15m"=>0.06, "1m"=>0.18, "5m"=>0.08}, "macaddress"=>"00:16:3e:48:61:7f", "macaddress_eth0"=>"00:16:3e:48:61:7f", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"354.30 MiB", "available_bytes"=>371511296, "capacity"=>"27.78%", "total"=>"490.61 MiB", "total_bytes"=>514437120, "used"=>"136.30 MiB", "used_bytes"=>142925824}}, "memoryfree"=>"354.30 MiB", "memoryfree_mb"=>354.30078125, "memorysize"=>"490.61 MiB", "memorysize_mb"=>490.60546875, "mountpoints"=>{"/"=>{"available"=>"47.14 GiB", "available_bytes"=>50611761152, "capacity"=>"4.22%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=continue", "barrier=1", "data=ordered"], "size"=>"49.21 GiB", "size_bytes"=>52843638784, "used"=>"2.08 GiB", "used_bytes"=>2231877632}, "/dev/shm"=>{"available"=>"245.29 MiB", "available_bytes"=>257208320, "capacity"=>"0.00%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"245.30 MiB", "size_bytes"=>257216512, "used"=>"8.00 KiB", "used_bytes"=>8192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"lan.asio", "fqdn"=>"sles11-sp3.lan.asio", "hostname"=>"sles11-sp3", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe48:617f", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, {"address"=>"127.0.0.2", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.3", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"11.3", "major"=>"11", "minor"=>"3"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"586adc21-9cfc-4e12-93e6-c711ab2400b1"}}, "path"=>"/usr/bin:/bin:/usr/sbin:/sbin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.8.2", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5", "sha256"=>"SSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11"}, "key"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17", "sha256"=>"SSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41", "sha256"=>"SSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY=", "sshfp_dsa"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5\nSSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11", "sshfp_ecdsa"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17\nSSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e", "sshfp_rsa"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41\nSSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>524, "uptime"=>"0:08 hours"}, "timezone"=>"UTC", "uptime"=>"0:08 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>524, "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D", "virtual"=>"virtualbox", "clientcert"=>"sles11-sp3.lan.asio", "clientversion"=>"4.8.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'SLES-11.3-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_SLES-12.1-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_SLES-12.1-64_spec.rb new file mode 100644 index 0000000..3570c33 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_SLES-12.1-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set SLES-12.1-64" do + node_facts = {"aio_agent_build"=>"1.7.2", "aio_agent_version"=>"1.7.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E"}}, "domain"=>"openstack.site", "facterversion"=>"3.4.2", "filesystems"=>"ext2,ext3,ext4", "fqdn"=>"sles12-sp1.openstack.site", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles12-sp1", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth0"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth1"=>"fe80::a00:27ff:fe60:90e", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"192.168.33.15", "ipaddress_lo"=>"127.0.0.1", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.12", "kernelrelease"=>"3.12.62-60.64.8-default", "kernelversion"=>"3.12.62", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.02}, "macaddress"=>"00:16:3e:72:f1:21", "macaddress_eth0"=>"00:16:3e:72:f1:21", "macaddress_eth1"=>"08:00:27:60:09:0e", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.78 GiB", "available_bytes"=>1907027968, "capacity"=>"68.84%", "total"=>"5.70 GiB", "total_bytes"=>6119927808, "used"=>"3.92 GiB", "used_bytes"=>4212899840}}, "memoryfree"=>"1.78 GiB", "memoryfree_mb"=>1818.68359375, "memorysize"=>"5.70 GiB", "memorysize_mb"=>5836.41796875, "mountpoints"=>{"/"=>{"available"=>"45.34 GiB", "available_bytes"=>48682504192, "capacity"=>"7.64%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52709421056, "used"=>"3.75 GiB", "used_bytes"=>4026916864}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"192.168.33.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"openstack.site", "fqdn"=>"sles12-sp1.openstack.site", "hostname"=>"sles12-sp1", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe72:f121", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"bindings"=>[{"address"=>"192.168.33.15", "netmask"=>"255.255.255.0", "network"=>"192.168.33.0"}], "bindings6"=>[{"address"=>"fe80::a00:27ff:fe60:90e", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"192.168.33.15", "ip6"=>"fe80::a00:27ff:fe60:90e", "mac"=>"08:00:27:60:09:0e", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"192.168.33.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"12", "operatingsystemrelease"=>"12.1", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"12.1", "major"=>"12", "minor"=>"1"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "label"=>"ROOT", "mount"=>"/", "partuuid"=>"3d2745bf-01", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"dcf2494f-2b02-466b-aa2c-9e7c01bdbdd7"}}, "path"=>"/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/games", "pe_build"=>"2016.4.3", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_server_version"=>"2016.4.3", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"sles-12-x86_64", "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppetversion"=>"4.7.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1", "sha256"=>"SSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b", "sha256"=>"SSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459", "sha256"=>"SSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51", "sha256"=>"SSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx", "sshfp_dsa"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1\nSSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5", "sshfp_ecdsa"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b\nSSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd", "sshfp_ed25519"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459\nSSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf", "sshfp_rsa"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51\nSSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/", "staging_http_get"=>"curl", "system_uptime"=>{"days"=>1, "hours"=>41, "seconds"=>148058, "uptime"=>"1 day"}, "timezone"=>"UTC", "uptime"=>"1 day", "uptime_days"=>1, "uptime_hours"=>41, "uptime_seconds"=>148058, "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E", "virtual"=>"virtualbox", "clientcert"=>"sles12-sp1.openstack.site", "clientversion"=>"4.7.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'SLES-12.1-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Ubuntu-12.04-32_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-12.04-32_spec.rb new file mode 100644 index 0000000..3dbc8d1 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-12.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Ubuntu-12.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_eth0"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.23, "5m"=>0.09}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:8d:61:88", "macaddress_eth0"=>"08:00:27:8d:61:88", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"407.73 MiB", "available_bytes"=>427540480, "capacity"=>"17.64%", "total"=>"495.05 MiB", "total_bytes"=>519102464, "used"=>"87.32 MiB", "used_bytes"=>91561984}}, "memoryfree"=>"407.73 MiB", "memoryfree_mb"=>407.734375, "memorysize"=>"495.05 MiB", "memorysize_mb"=>495.0546875, "mountpoints"=>{"/"=>{"available"=>"1.81 GiB", "available_bytes"=>1940865024, "capacity"=>"36.14%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.02 GiB", "used_bytes"=>1098407936}, "/boot"=>{"available"=>"203.56 MiB", "available_bytes"=>213447680, "capacity"=>"13.50%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"31.76 MiB", "used_bytes"=>33307648}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"3fff8935-622f-4e9a-944f-38108c71af34"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"185fbdf2-880c-4aa6-ada8-8dade7aa3fc6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"31f2e84f-0e99-4531-9ecb-2b151fc6ce31"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"S8Vl05-TIfO-rk5Y-gIDu-TIwj-L8Ub-3OjoJb"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b", "sha256"=>"SSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0"}, "key"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21", "sha256"=>"SSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f", "sha256"=>"SSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0=", "sshfp_dsa"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b\nSSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0", "sshfp_ecdsa"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21\nSSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668", "sshfp_rsa"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f\nSSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>60, "uptime"=>"0:01 hours"}, "timezone"=>"PST", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>60, "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Ubuntu-12.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Ubuntu-12.04-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-12.04-64_spec.rb new file mode 100644 index 0000000..e010406 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-12.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Ubuntu-12.04-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_eth0"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:5f:df:27", "macaddress_eth0"=>"08:00:27:5f:df:27", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"350.97 MiB", "available_bytes"=>368017408, "capacity"=>"28.33%", "total"=>"489.72 MiB", "total_bytes"=>513507328, "used"=>"138.75 MiB", "used_bytes"=>145489920}}, "memoryfree"=>"350.97 MiB", "memoryfree_mb"=>350.96875, "memorysize"=>"489.72 MiB", "memorysize_mb"=>489.71875, "mountpoints"=>{"/"=>{"available"=>"17.68 GiB", "available_bytes"=>18981703680, "capacity"=>"6.12%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.15 GiB", "used_bytes"=>1237438464}, "/boot"=>{"available"=>"202.55 MiB", "available_bytes"=>212389888, "capacity"=>"13.93%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"32.77 MiB", "used_bytes"=>34365440}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"96092a10-847b-4a55-b5dc-87d2cc56ee5e"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"50695407-158d-4b0e-975a-b575fa5f5359"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"829f03e2-ceb8-4f8d-9f32-e1336456f719"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"P6GCnD-xaHj-APeE-m1Em-fr5a-z3Kk-iFVziN"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630", "sha256"=>"SSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420", "sha256"=>"SSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740", "sha256"=>"SSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q=", "sshfp_dsa"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630\nSSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f", "sshfp_ecdsa"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420\nSSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00", "sshfp_rsa"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740\nSSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>368, "uptime"=>"0:06 hours"}, "timezone"=>"PST", "uptime"=>"0:06 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>368, "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Ubuntu-12.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Ubuntu-14.04-32_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-14.04-32_spec.rb new file mode 100644 index 0000000..c9c6a9a --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-14.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Ubuntu-14.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_eth0"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.07}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:71:89:45", "macaddress_eth0"=>"08:00:27:71:89:45", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"414.97 MiB", "available_bytes"=>435126272, "capacity"=>"16.34%", "total"=>"496.04 MiB", "total_bytes"=>520130560, "used"=>"81.07 MiB", "used_bytes"=>85004288}}, "memoryfree"=>"414.97 MiB", "memoryfree_mb"=>414.96875, "memorysize"=>"496.04 MiB", "memorysize_mb"=>496.03515625, "mountpoints"=>{"/"=>{"available"=>"1.72 GiB", "available_bytes"=>1846272000, "capacity"=>"39.25%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.11 GiB", "used_bytes"=>1193000960}, "/boot"=>{"available"=>"200.06 MiB", "available_bytes"=>209779712, "capacity"=>"14.98%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"35.26 MiB", "used_bytes"=>36975616}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b31f5de0-8805-43da-b3f2-da9e51c3401b"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"569bc4ac-b4e8-4e62-8503-551a63285383"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"f00f661b-b4b5-4e6f-bba3-3dcacf85fd8e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"vF1RtV-BHmi-b0UW-QR1z-tJ48-g6Tn-aGgEn7"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf", "sha256"=>"SSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1", "sha256"=>"SSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7", "sha256"=>"SSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae", "sha256"=>"SSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq", "sshfp_dsa"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf\nSSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375", "sshfp_ecdsa"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1\nSSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474", "sshfp_ed25519"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7\nSSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d", "sshfp_rsa"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae\nSSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>354, "uptime"=>"0:05 hours"}, "timezone"=>"PST", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>354, "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Ubuntu-14.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Ubuntu-14.04-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-14.04-64_spec.rb new file mode 100644 index 0000000..ba42951 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-14.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Ubuntu-14.04-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"ubuntu1404a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth0"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth1"=>"fe80::a00:27ff:fe61:1916", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.93", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.06, "1m"=>0.49, "5m"=>0.17}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:ea:20:27", "macaddress_eth0"=>"08:00:27:ea:20:27", "macaddress_eth1"=>"08:00:27:61:19:16", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"331.30 MiB", "available_bytes"=>347394048, "capacity"=>"32.35%", "total"=>"489.74 MiB", "total_bytes"=>513531904, "used"=>"158.44 MiB", "used_bytes"=>166137856}}, "memoryfree"=>"331.30 MiB", "memoryfree_mb"=>331.30078125, "memorysize"=>"489.74 MiB", "memorysize_mb"=>489.7421875, "mountpoints"=>{"/"=>{"available"=>"17.58 GiB", "available_bytes"=>18880684032, "capacity"=>"6.62%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.25 GiB", "used_bytes"=>1338458112}, "/boot"=>{"available"=>"198.65 MiB", "available_bytes"=>208301056, "capacity"=>"15.58%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"36.67 MiB", "used_bytes"=>38454272}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8608807, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "hostname"=>"ubuntu1404a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.93", "ip6"=>"fe80::a00:27ff:fe61:1916", "mac"=>"08:00:27:61:19:16", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c94f234c-f947-450d-aaaf-d32be1b7f27f"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"5501b007-e44b-46cf-b22b-177428cbe5d6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"3a97a5b0-ebd0-4ce6-ba62-d39b4fd0719e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vgfiUo-lVmS-57wx-qv4m-N3fR-efa0-iBI6Cn"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"ubuntu-14.04-amd64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c", "sha256"=>"SSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad", "sha256"=>"SSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234", "sha256"=>"SSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51", "sha256"=>"SSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP", "sshfp_dsa"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c\nSSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4", "sshfp_ecdsa"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad\nSSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8", "sshfp_ed25519"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234\nSSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05", "sshfp_rsa"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51\nSSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv", "staging_http_get"=>"curl", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>47, "uptime"=>"0:00 hours"}, "timezone"=>"PDT", "uptime"=>"0:00 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>47, "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115", "virtual"=>"virtualbox", "clientcert"=>"ubuntu1404a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Ubuntu-14.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Ubuntu-18.04-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-18.04-64_spec.rb new file mode 100644 index 0000000..2387372 --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Ubuntu-18.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Ubuntu-18.04-64" do + node_facts = {"aio_agent_version"=>"6.14.0", "architecture"=>"amd64", "augeas"=>{"version"=>"1.12.0"}, "augeasversion"=>"1.12.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>10737418240, "blockdevice_sda_vendor"=>"VBOX", "blockdevice_sdb_model"=>"HARDDISK", "blockdevice_sdb_size"=>10485760, "blockdevice_sdb_vendor"=>"VBOX", "blockdevices"=>"sdb,sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"10.00 GiB", "size_bytes"=>10737418240, "vendor"=>"VBOX"}, "sdb"=>{"model"=>"HARDDISK", "size"=>"10.00 MiB", "size_bytes"=>10485760, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3"}}, "domain"=>"lan.asio", "facterversion"=>"3.14.9", "filesystems"=>"btrfs,ext2,ext3,ext4,iso9660,squashfs,vfat", "fips_enabled"=>false, "fqdn"=>"ubuntu-bionic.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ubuntu-bionic", "hypervisors"=>{"virtualbox"=>{"revision"=>"133895", "version"=>"6.0.14"}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_enp0s3"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.15", "kernelrelease"=>"4.15.0-54-generic", "kernelversion"=>"4.15.0", "load_averages"=>{"15m"=>0.1, "1m"=>0.31, "5m"=>0.23}, "lsbdistcodename"=>"bionic", "lsbdistdescription"=>"Ubuntu 18.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"18.04", "lsbmajdistrelease"=>"18.04", "macaddress"=>"02:bb:7d:e8:e9:23", "macaddress_enp0s3"=>"02:bb:7d:e8:e9:23", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"776.53 MiB", "available_bytes"=>814247936, "capacity"=>"21.19%", "total"=>"985.26 MiB", "total_bytes"=>1033121792, "used"=>"208.73 MiB", "used_bytes"=>218873856}}, "memoryfree"=>"776.53 MiB", "memoryfree_mb"=>776.52734375, "memorysize"=>"985.26 MiB", "memorysize_mb"=>985.26171875, "mountpoints"=>{"/"=>{"available"=>"8.14 GiB", "available_bytes"=>8742756352, "capacity"=>"15.32%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw", "relatime", "data=ordered"], "size"=>"9.63 GiB", "size_bytes"=>10340794368, "used"=>"1.47 GiB", "used_bytes"=>1581260800}, "/dev"=>{"available"=>"480.22 MiB", "available_bytes"=>503545856, "capacity"=>"0%", "device"=>"udev", "filesystem"=>"devtmpfs", "options"=>["rw", "nosuid", "relatime", "size=491744k", "nr_inodes=122936", "mode=755"], "size"=>"480.22 MiB", "size_bytes"=>503545856, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/hugepages"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"hugetlbfs", "filesystem"=>"hugetlbfs", "options"=>["rw", "relatime", "pagesize=2M"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/mqueue"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mqueue", "filesystem"=>"mqueue", "options"=>["rw", "relatime"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/pts"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"devpts", "filesystem"=>"devpts", "options"=>["rw", "nosuid", "noexec", "relatime", "gid=5", "mode=620", "ptmxmode=000"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/shm"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/run"=>{"available"=>"97.93 MiB", "available_bytes"=>102690816, "capacity"=>"0.60%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "noexec", "relatime", "size=100892k", "mode=755"], "size"=>"98.53 MiB", "size_bytes"=>103313408, "used"=>"608.00 KiB", "used_bytes"=>622592}, "/run/lock"=>{"available"=>"5.00 MiB", "available_bytes"=>5242880, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "noexec", "relatime", "size=5120k"], "size"=>"5.00 MiB", "size_bytes"=>5242880, "used"=>"0 bytes", "used_bytes"=>0}, "/run/user/1000"=>{"available"=>"98.52 MiB", "available_bytes"=>103309312, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "relatime", "size=100888k", "mode=700", "uid=1000", "gid=1000"], "size"=>"98.52 MiB", "size_bytes"=>103309312, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/vagrant"=>{"available"=>"122.93 GiB", "available_bytes"=>131996221440, "capacity"=>"85.01%", "device"=>"vagrant", "filesystem"=>"vboxsf", "options"=>["rw", "nodev", "relatime", "iocharset=utf8", "uid=1000", "gid=1000"], "size"=>"820.33 GiB", "size_bytes"=>880824786944, "used"=>"697.40 GiB", "used_bytes"=>748828565504}, "/var/lib/lxcfs"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"lxcfs", "filesystem"=>"fuse.lxcfs", "options"=>["rw", "nosuid", "nodev", "relatime", "user_id=0", "group_id=0", "allow_other"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_enp0s3"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"lan.asio", "fqdn"=>"ubuntu-bionic.lan.asio", "hostname"=>"ubuntu-bionic", "interfaces"=>{"enp0s3"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::bb:7dff:fee8:e923", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "scope6"=>"link"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1", "scope6"=>"host"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"enp0s3", "scope6"=>"link"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"18.04", "operatingsystemrelease"=>"18.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"bionic", "description"=>"Ubuntu 18.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "label"=>"cloudimg-rootfs", "mount"=>"/", "partuuid"=>"654c6dc7-01", "size"=>"10.00 GiB", "size_bytes"=>10736352768, "uuid"=>"8de716dd-d9b2-477f-b818-bb0b1eb036ce"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"6.14.0", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.7"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.7", "scope6"=>"link", "scope6_enp0s3"=>"link", "scope6_lo"=>"host", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c", "sha256"=>"SSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9", "sha256"=>"SSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f", "sha256"=>"SSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622", "sha256"=>"SSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "sshfp_dsa"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c\nSSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656", "sshfp_ecdsa"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9\nSSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99", "sshfp_ed25519"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f\nSSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4", "sshfp_rsa"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622\nSSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>336, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>336, "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3", "virtual"=>"virtualbox", "clientcert"=>"ubuntu-bionic.lan.asio", "clientversion"=>"6.14.0", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Ubuntu-18.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Windows_Server-2008r2-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Windows_Server-2008r2-64_spec.rb new file mode 100644 index 0000000..c4ebfab --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Windows_Server-2008r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Windows_Server-2008r2-64" do + node_facts = {"agent_specified_environment"=>"production", "aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x64", "common_appdata"=>"C:\\ProgramData", "concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"Local Area Connection"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "domain"=>"pdx.puppetlabs.demo", "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.0.2", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"server2008r2a", "id"=>"SERVER2008R2A\\vagrant", "identity"=>{"user"=>"SERVER2008R2A\\vagrant"}, "iis_version"=>"Get-ItemProperty : Cannot find path 'HKLM:\\SOFTWARE\\Microsoft\\InetStp\\' because it does not exist.\nAt line:1 char:18\n+ (Get-ItemProperty <<<< HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString(8,3)\n + CategoryInfo : ObjectNotFound: (HKLM:\\SOFTWARE\\Microsoft\\InetStp\\:String) [Get-ItemProperty], ItemNotFo \n undException\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\n \nYou cannot call a method on a null-valued expression.\nAt line:1 char:97\n+ (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString <<<< (8,3)\n + CategoryInfo : InvalidOperation: (SubString:String) [], RuntimeException\n + FullyQualifiedErrorId : InvokeMethodOnNull\n \n", "interfaces"=>"Local Area Connection 2,Local Area Connection", "ipaddress"=>"10.20.1.101", "ipaddress6"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress6_Local Area Connection"=>"fe80::50f8:86eb:f103:75b%12", "ipaddress6_Local Area Connection 2"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress_Local Area Connection"=>"10.0.2.15", "ipaddress_Local Area Connection 2"=>"10.20.1.101", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.1", "kernelrelease"=>"6.1.7600", "kernelversion"=>"6.1.7600", "macaddress"=>"08:00:27:7B:C7:40", "macaddress_Local Area Connection"=>"08:00:27:AB:52:FB", "macaddress_Local Area Connection 2"=>"08:00:27:7B:C7:40", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"448.14 MiB", "available_bytes"=>469909504, "capacity"=>"56.22%", "total"=>"1023.55 MiB", "total_bytes"=>1073274880, "used"=>"575.41 MiB", "used_bytes"=>603365376}}, "memoryfree"=>"448.14 MiB", "memoryfree_mb"=>448.140625, "memorysize"=>"1023.55 MiB", "memorysize_mb"=>1023.5546875, "mtu_Local Area Connection"=>1500, "mtu_Local Area Connection 2"=>1500, "mysql_server_id"=>8583088, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection 2"=>"ffff:ffff:ffff:ffff::", "netmask_Local Area Connection"=>"255.255.255.0", "netmask_Local Area Connection 2"=>"255.255.255.0", "network"=>"10.20.1.0", "network6"=>"fe80::%13", "network6_Local Area Connection"=>"fe80::%12", "network6_Local Area Connection 2"=>"fe80::%13", "network_Local Area Connection"=>"10.0.2.0", "network_Local Area Connection 2"=>"10.20.1.0", "networking"=>{"domain"=>"pdx.puppetlabs.demo", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hostname"=>"server2008r2a", "interfaces"=>{"Local Area Connection"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::50f8:86eb:f103:75b%12", "mac"=>"08:00:27:AB:52:FB", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}, "Local Area Connection 2"=>{"ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}}, "ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2008 R2", "operatingsystemrelease"=>"2008 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2008 R2", "major"=>"2008 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\ProgramData\\chocolatey\\bin;", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>false, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "serialnumber"=>"0", "staging_http_get"=>"powershell", "staging_windir"=>"C:\\ProgramData\\staging", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>266, "uptime"=>"0:04 hours"}, "timezone"=>"Pacific Daylight Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>266, "virtual"=>"virtualbox", "clientcert"=>"server2008r2a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Windows_Server-2008r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_Windows_Server-2012r2-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_Windows_Server-2012r2-64_spec.rb new file mode 100644 index 0000000..f326e3b --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_Windows_Server-2012r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set Windows_Server-2012r2-64" do + node_facts = {"agent_specified_environment"=>"production", "architecture"=>"x64", "dhcp_servers"=>{"Ethernet"=>"10.0.2.2", "system"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.1.1", "fqdn"=>"WIN-E5K8TM30719", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"WIN-E5K8TM30719", "id"=>"WIN-E5K8TM30719\\vagrant", "identity"=>{"user"=>"WIN-E5K8TM30719\\vagrant"}, "interfaces"=>"Ethernet", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress6_Ethernet"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress_Ethernet"=>"10.0.2.15", "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.3", "kernelrelease"=>"6.3.9600", "kernelversion"=>"6.3.9600", "macaddress"=>"08:00:27:81:38:FA", "macaddress_Ethernet"=>"08:00:27:81:38:FA", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.42 GiB", "available_bytes"=>1521610752, "capacity"=>"29.13%", "total"=>"2.00 GiB", "total_bytes"=>2147012608, "used"=>"596.43 MiB", "used_bytes"=>625401856}}, "memoryfree"=>"1.42 GiB", "memoryfree_mb"=>1451.12109375, "memorysize"=>"2.00 GiB", "memorysize_mb"=>2047.55078125, "mtu_Ethernet"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Ethernet"=>"ffff:ffff:ffff:ffff::", "netmask_Ethernet"=>"255.255.255.0", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "network6_Ethernet"=>"fe80::%12", "network_Ethernet"=>"10.0.2.0", "networking"=>{"dhcp"=>"10.0.2.2", "fqdn"=>"WIN-E5K8TM30719", "hostname"=>"WIN-E5K8TM30719", "interfaces"=>{"Ethernet"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::a180:36e0:3a6e:1005%12", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::%12"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "primary"=>"Ethernet"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2012 R2", "operatingsystemrelease"=>"2012 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2012 R2", "major"=>"2012 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Git\\cmd;C:\\Program Files (x86)\\Git\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.3", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.7"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.7", "serialnumber"=>"0", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>287, "uptime"=>"0:04 hours"}, "timezone"=>"Coordinated Universal Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>287, "virtual"=>"virtualbox", "clientcert"=>"win-e5k8tm30719", "clientversion"=>"4.2.3", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'Windows_Server-2012r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_solaris-10_u9-sparc-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_solaris-10_u9-sparc-64_spec.rb new file mode 100644 index 0000000..da431ba --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_solaris-10_u9-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set solaris-10_u9-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-10_u9-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.42", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.42", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"Generic_Virtual", "kernelrelease"=>"5.10", "kernelversion"=>"Generic_Virtual", "load_averages"=>{"15m"=>1.015625, "1m"=>1.89453125, "5m"=>1.25390625}, "macaddress"=>"02:08:20:f1:97:4b", "macaddress_net0"=>"02:08:20:f1:97:4b", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"3.25 GiB", "available_bytes"=>-806297600, "capacity"=>"78.94%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"12.18 GiB", "used_bytes"=>194560000}}, "memoryfree"=>"3.25 GiB", "memoryfree_mb"=>3327.0546875, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"1.14%", "device"=>"rpool/ROOT/zbe-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950161"], "size"=>"480.01 GiB", "size_bytes"=>13566464, "used"=>"5.49 GiB", "used_bytes"=>1602503680}, "/.SUNWnative/lib"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/lib", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/platform"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/platform", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/sbin"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/sbin", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/usr"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/usr", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc10", "nozonemod", "sharezone=36", "dev=8e0001b"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=9040025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e80025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/svc/volatile"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}, "/export"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950163"], "size"=>"474.52 GiB", "size_bytes"=>-1588904448, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950164"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8dc0024"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950165"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e40025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8f00025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/tmp"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.70%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec004a"], "size"=>"5.52 GiB", "size_bytes"=>1632608256, "used"=>"39.52 MiB", "used_bytes"=>41435136}, "/var"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.03%", "device"=>"rpool/ROOT/zbe-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/var", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950162"], "size"=>"474.66 GiB", "size_bytes"=>-1436724224, "used"=>"145.16 MiB", "used_bytes"=>152212992}, "/var/run"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"/etc/svc/volatile/", "filesystem"=>"lofs", "options"=>["rstchown", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"domain"=>"puppet.example", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "hostname"=>"solaris-10_u9-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.42", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10_u9", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"10_u9", "major"=>"10", "minor"=>"9"}}, "osfamily"=>"Solaris", "path"=>"/usr/local/bin:/usr/local/sbin:/opt/csw/bin:PATH:/opt/puppetlabs/bin:/usr/local/bin:/usr/local/sbin:/opt/csw/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-10-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>" SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.10", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.10", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"solaris-10_u9-sparc-t4-64", "zones"=>{"solaris-10_u9-sparc-t4-64"=>{"brand"=>"solaris10", "id"=>"36", "ip_type"=>"excl", "path"=>"/", "status"=>"running"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798", "sha256"=>"SSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15"}, "key"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4", "sha256"=>"SSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg==", "sshfp_dsa"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798\nSSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15", "sshfp_rsa"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4\nSSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U=", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1860, "uptime"=>"0:31 hours"}, "timezone"=>"PDT", "uptime"=>"0:31 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1860, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc10_brand"=>"solaris10", "zone_cisparc10_id"=>"36", "zone_cisparc10_iptype"=>"excl", "zone_cisparc10_name"=>"solaris-10_u9-sparc-t4-64", "zone_cisparc10_path"=>"/", "zone_cisparc10_status"=>"running", "zonename"=>"solaris-10_u9-sparc-t4-64", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-10_u9-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'solaris-10_u9-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_solaris-11.2-sparc-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_solaris-11.2-sparc-64_spec.rb new file mode 100644 index 0000000..8b25e9a --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_solaris-11.2-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set solaris-11.2-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "dhcp_servers"=>{"net0"=>"10.32.22.10", "system"=>"10.32.22.10"}, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-11_2-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.68", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.68", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"11", "kernelrelease"=>"5.11", "kernelversion"=>"11.2", "load_averages"=>{"15m"=>1.0234375, "1m"=>1.21875, "5m"=>1.28125}, "macaddress"=>"02:08:20:41:26:8c", "macaddress_net0"=>"02:08:20:41:26:8c", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"2.34 GiB", "available_bytes"=>-1777401856, "capacity"=>"84.80%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"13.09 GiB", "used_bytes"=>1165664256}}, "memoryfree"=>"2.34 GiB", "memoryfree_mb"=>2400.9375, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.18%", "device"=>"rpool/ROOT/solaris-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017b"], "size"=>"476.16 GiB", "size_bytes"=>175171072, "used"=>"889.53 MiB", "used_bytes"=>932736000}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc", "nozonemod", "sharezone=38", "dev=8e0001c"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=9040027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/dfs/sharetab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"sharefs", "filesystem"=>"sharefs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f40016"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e80027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/export"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017f"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950180"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8dc0026"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950181"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e40027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f00027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/volatile"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004d"], "size"=>"4.53 GiB", "size_bytes"=>572342272, "used"=>"576.00 KiB", "used_bytes"=>589824}, "/tmp"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.95%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004e"], "size"=>"4.58 GiB", "size_bytes"=>618414080, "used"=>"44.50 MiB", "used_bytes"=>46661632}, "/var"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.05%", "device"=>"rpool/ROOT/solaris-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/var", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017d"], "size"=>"475.51 GiB", "size_bytes"=>-521269760, "used"=>"225.35 MiB", "used_bytes"=>236295168}, "/var/share"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017e"], "size"=>"475.30 GiB", "size_bytes"=>-756610048, "used"=>"932.50 KiB", "used_bytes"=>954880}, "/var/share/pkg"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950182"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/var/share/pkg/repositories"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg/repositories", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950183"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"dhcp"=>"10.32.22.10", "domain"=>"puppet.example", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "hostname"=>"solaris-11_2-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.68", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "dhcp"=>"10.32.22.10", "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.2", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"11.2", "major"=>"11", "minor"=>"2"}}, "osfamily"=>"Solaris", "path"=>"PATH:/opt/puppetlabs/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-11-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>"SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.11", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.11", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"cisparc", "zones"=>{"cisparc"=>{"brand"=>"solaris", "id"=>"38", "ip_type"=>"excl", "path"=>"/", "status"=>"running", "uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f", "sha256"=>"SSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607"}, "key"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3", "sha256"=>"SSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA=", "sshfp_dsa"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f\nSSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607", "sshfp_rsa"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3\nSSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw==", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>2, "hours"=>62, "seconds"=>225780, "uptime"=>"2 days"}, "timezone"=>"PDT", "uptime"=>"2 days", "uptime_days"=>2, "uptime_hours"=>62, "uptime_seconds"=>225780, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc_brand"=>"solaris", "zone_cisparc_id"=>"38", "zone_cisparc_iptype"=>"excl", "zone_cisparc_name"=>"cisparc", "zone_cisparc_path"=>"/", "zone_cisparc_status"=>"running", "zone_cisparc_uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782", "zonename"=>"cisparc", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-11_2-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'solaris-11.2-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__custom_windows_on_windows-10-64_spec.rb b/.onceover/spec/classes/role__custom_windows_on_windows-10-64_spec.rb new file mode 100644 index 0000000..8c0914f --- /dev/null +++ b/.onceover/spec/classes/role__custom_windows_on_windows-10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::custom_windows" do + + context "using fact set windows-10-64" do + node_facts = {"puppetversion"=>"6.0.2", "puppet_inventory_metadata"=>{"packages"=>{"collection_enabled"=>false, "last_collection_time"=>"0.0s"}}, "package_provider"=>"windows", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "is_pe"=>false, "platform_symlink_writable"=>false, "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppet_environmentpath"=>"C:/ProgramData/PuppetLabs/code/environments", "puppet_server"=>"pe-puppet.localdomain", "service_provider"=>"windows", "staging_http_get"=>"curl", "common_appdata"=>"C:\\ProgramData", "architecture"=>"x64", "kernel"=>"windows", "virtual"=>"vmware", "is_virtual"=>true, "hardwaremodel"=>"x64", "operatingsystem"=>"windows", "os"=>{"name"=>"windows", "family"=>"windows", "release"=>{"major"=>"10", "full"=>"10"}}, "facterversion"=>"2.5.1", "fqdn"=>"VAGRANT-HB9G3RD", "hostname"=>"VAGRANT-HB9G3RD", "id"=>"vagrant-hb9g3rd\\vagrant", "interfaces"=>"Ethernet0_2", "ipaddress_ethernet0_2"=>"192.168.43.174", "ipaddress6_ethernet0_2"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "macaddress_ethernet0_2"=>"00:0C:29:A3:53:54", "netmask_ethernet0_2"=>"255.255.255.0", "mtu_ethernet0_2"=>0, "ipaddress"=>"192.168.43.174", "ipaddress6"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "kernelmajversion"=>"10.0", "kernelrelease"=>"10.0.17134", "kernelversion"=>"10.0.17134", "macaddress"=>"00:0C:29:A3:53:54", "manufacturer"=>"Phoenix Technologies LTD", "serialnumber"=>"VMware-56 4d 36 2e 2e a4 81 f9-0d 05 ae d0 e5 a3 53 54", "productname"=>"VMware Virtual Platform", "memorysize"=>"4.00 GB", "memoryfree"=>"2.30 GB", "memorysize_mb"=>"4095.49", "memoryfree_mb"=>"2360.00", "netmask"=>"255.255.255.0", "network_ethernet0_2"=>"192.168.43.0", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10", "osfamily"=>"windows", "path"=>"C:\\tools\\ruby24\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files (x86)\\vim\\vim80;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Users\\vagrant\\AppData\\Local\\Microsoft\\WindowsApps;", "physicalprocessorcount"=>4, "processors"=>{"models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "count"=>4, "physicalcount"=>4}, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "ps"=>"tasklist.exe", "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/tools/ruby24/lib/ruby/site_ruby/2.4.0", "rubyversion"=>"2.4.3", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"seconds"=>1113359, "hours"=>309, "days"=>12, "uptime"=>"12 days"}, "timezone"=>"GMT Standard Time", "uptime"=>"12 days", "uptime_days"=>12, "uptime_hours"=>309, "uptime_seconds"=>1113359, "clientcert"=>"vagrant-hb9g3rd.lan.asio", "clientversion"=>"6.0.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::custom_windows' +$onceover_node = 'windows-10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_AIX-6.1-powerpc_spec.rb b/.onceover/spec/classes/role__metrics_on_AIX-6.1-powerpc_spec.rb new file mode 100644 index 0000000..207aec7 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_AIX-6.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set AIX-6.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.8.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.5.0", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-61-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.35", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.35", "ipaddress_lo0"=>"127.0.0.1", "kernel"=>"AIX", "kernelmajversion"=>"6100", "kernelrelease"=>"6100-07-04-1216", "kernelversion"=>"6100", "macaddress"=>"66:a4:d9:f8:4a:04", "macaddress_en0"=>"66:a4:d9:f8:4a:04", "memory"=>{"swap"=>{"available"=>"410.43 MiB", "available_bytes"=>430366720, "capacity"=>"19.84%", "total"=>"512.00 MiB", "total_bytes"=>536870912, "used"=>"101.57 MiB", "used_bytes"=>106504192}, "system"=>{"available"=>"10.88 MiB", "available_bytes"=>11403264, "capacity"=>"98.94%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1013.13 MiB", "used_bytes"=>1062338560}}, "memoryfree"=>"10.88 MiB", "memoryfree_mb"=>10.875, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-61-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.35", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"6100", "operatingsystemrelease"=>"6100-07-04-1216", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"6100-07-04-1216", "major"=>"6100"}}, "osfamily"=>"AIX", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppetversion"=>"4.8.1", "ruby"=>{"platform"=>"powerpc-aix6.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix6.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2", "sha256"=>"SSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d", "sha256"=>"SSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY=", "sshfp_dsa"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2\nSSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945", "sshfp_rsa"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d\nSSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch", "swapfree"=>"410.43 MiB", "swapfree_mb"=>410.4296875, "swapsize"=>"512.00 MiB", "swapsize_mb"=>512.0, "system_uptime"=>{"days"=>418, "hours"=>10035, "seconds"=>36127200, "uptime"=>"418 days"}, "timezone"=>"PST", "uptime"=>"418 days", "uptime_days"=>418, "uptime_hours"=>10035, "uptime_seconds"=>36127200, "clientcert"=>"pe-aix-61-se.delivery.puppetlabs.net", "clientversion"=>"4.8.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'AIX-6.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_AIX-7.1-powerpc_spec.rb b/.onceover/spec/classes/role__metrics_on_AIX-7.1-powerpc_spec.rb new file mode 100644 index 0000000..d7c7c76 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_AIX-7.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set AIX-7.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.5.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.2.0", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-71-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.36", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.36", "ipaddress_lo0"=>"127.0.0.1", "is_pe"=>false, "kernel"=>"AIX", "kernelmajversion"=>"7100", "kernelrelease"=>"7100-01-05-1228", "kernelversion"=>"7100", "macaddress"=>"66:a4:dc:28:bf:04", "macaddress_en0"=>"66:a4:dc:28:bf:04", "memory"=>{"swap"=>{"available"=>"1007.14 MiB", "available_bytes"=>1056063488, "capacity"=>"1.65%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"16.86 MiB", "used_bytes"=>17678336}, "system"=>{"available"=>"16.84 MiB", "available_bytes"=>17653760, "capacity"=>"98.36%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1007.16 MiB", "used_bytes"=>1056088064}}, "memoryfree"=>"16.84 MiB", "memoryfree_mb"=>16.8359375, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-71-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.36", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"7100", "operatingsystemrelease"=>"7100-01-05-1228", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"7100-01-05-1228", "major"=>"7100"}}, "osfamily"=>"AIX", "package_provider"=>"aix", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppet_environmentpath"=>"/etc/puppetlabs/code/environments", "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.5.2", "root_home"=>"/root", "ruby"=>{"platform"=>"powerpc-aix7.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix7.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "service_provider"=>"src", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c", "sha256"=>"SSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5", "sha256"=>"SSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y=", "sshfp_dsa"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c\nSSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a", "sshfp_rsa"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5\nSSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB", "swapfree"=>"1007.14 MiB", "swapfree_mb"=>1007.140625, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1024.0, "system_uptime"=>{"days"=>160, "hours"=>3847, "seconds"=>13852500, "uptime"=>"160 days"}, "timezone"=>"PST", "uptime"=>"160 days", "uptime_days"=>160, "uptime_hours"=>3847, "uptime_seconds"=>13852500, "clientcert"=>"pe-aix-71-se.delivery.puppetlabs.net", "clientversion"=>"4.5.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'AIX-7.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Amazon-2018.03_spec.rb b/.onceover/spec/classes/role__metrics_on_Amazon-2018.03_spec.rb new file mode 100644 index 0000000..d87e477 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Amazon-2018.03_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Amazon-2018.03" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"10/16/2017", "bios_vendor"=>"Amazon EC2", "bios_version"=>"1.0", "blockdevice_nvme0n1_model"=>"Amazon Elastic Block Store", "blockdevice_nvme0n1_size"=>8589934592, "blockdevices"=>"nvme0n1", "boardassettag"=>"i-0816d4c53ff8dc6a2", "boardmanufacturer"=>"Amazon EC2", "chassisassettag"=>"Amazon EC2", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"172.31.0.1", "system"=>"172.31.0.1"}, "disks"=>{"nvme0n1"=>{"model"=>"Amazon Elastic Block Store", "size"=>"8.00 GiB", "size_bytes"=>8589934592}}, "dmi"=>{"bios"=>{"release_date"=>"10/16/2017", "vendor"=>"Amazon EC2", "version"=>"1.0"}, "board"=>{"asset_tag"=>"i-0816d4c53ff8dc6a2", "manufacturer"=>"Amazon EC2"}, "chassis"=>{"asset_tag"=>"Amazon EC2", "type"=>"Other"}, "manufacturer"=>"Amazon EC2", "product"=>{"name"=>"t3a.xlarge", "serial_number"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA"}}, "domain"=>"us-west-2.compute.internal", "ec2_metadata"=>{"ami-id"=>"ami-01e24be29428c15b2", "ami-launch-index"=>"0", "ami-manifest-path"=>"(unknown)", "block-device-mapping"=>{"ami"=>"xvda", "root"=>"/dev/xvda"}, "events"=>{"maintenance"=>{"history"=>"[]", "scheduled"=>"[]"}}, "hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "identity-credentials"=>{"ec2"=>{"info"=>"{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2019-05-07T01:03:28Z\",\n \"AccountId\" : \"581165678935\"\n}"}}, "instance-action"=>"none", "instance-id"=>"i-0816d4c53ff8dc6a2", "instance-type"=>"t3a.xlarge", "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "metrics"=>{"vhostmd"=>""}, "network"=>{"interfaces"=>{"macs"=>{"0a:ca:e0:39:c1:f6"=>{"device-number"=>"0", "interface-id"=>"eni-04e7710af3cf1699c", "ipv4-associations"=>{"34.209.204.164"=>"172.31.3.153"}, "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4s"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "owner-id"=>"581165678935", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4s"=>"34.209.204.164", "security-group-ids"=>"sg-05a2c52388c24f3ae", "security-groups"=>"launch-wizard-2", "subnet-id"=>"subnet-3bafc660", "subnet-ipv4-cidr-block"=>"172.31.0.0/20", "vpc-id"=>"vpc-287af44e", "vpc-ipv4-cidr-block"=>"172.31.0.0/16", "vpc-ipv4-cidr-blocks"=>"172.31.0.0/16"}}}}, "placement"=>{"availability-zone"=>"us-west-2c"}, "profile"=>"default-hvm", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4"=>"34.209.204.164", "public-keys"=>{"0"=>{"openssh-key"=>"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDk1QR+MwLPRohIOiWbCC8xjJKFYeCjIh2g2wAKnZFCkPjCG9BD3L4URnszJXdv+5XylfWO1y9O1Z95etjWfObApRZ5Ej22Dz1EExWWRNOKl9QdrEfCACSlc5gbT5rflHd/He9eD5OFRHlMY8fNIApEKdQrlxZgr1/NOusVQggoS/MiszxCl0dob3kz86XX6PrAmMyGfv7j/mPeeEUzP3bGxtjJyaZGcwukjPvlgq1yI4AzZlveY8fnokRsh9uDHXUEVB2hLNaBBZB/Evw261J/+QsnKopAuqQpwct/n/ulbg+w1h/2ZBiDXDBK8DQ8kOC4zuum6qwri1KNKdX9zIif thinkpad"}}, "reservation-id"=>"r-0b89c0e198506ec1f", "security-groups"=>"launch-wizard-2", "services"=>{"domain"=>"amazonaws.com", "partition"=>"aws"}}, "facterversion"=>"3.12.4", "filesystems"=>"ext3,ext4", "fips_enabled"=>false, "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ip-172-31-3-153", "hypervisors"=>{"kvm"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"172.31.3.153", "ipaddress6"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_eth0"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"172.31.3.153", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.14", "kernelrelease"=>"4.14.77-70.59.amzn1.x86_64", "kernelversion"=>"4.14.77", "load_averages"=>{"15m"=>0.02, "1m"=>0.12, "5m"=>0.06}, "macaddress"=>"0a:ca:e0:39:c1:f6", "macaddress_eth0"=>"0a:ca:e0:39:c1:f6", "manufacturer"=>"Amazon EC2", "memory"=>{"system"=>{"available"=>"15.36 GiB", "available_bytes"=>16489611264, "capacity"=>"1.10%", "total"=>"15.53 GiB", "total_bytes"=>16673153024, "used"=>"175.04 MiB", "used_bytes"=>183541760}}, "memoryfree"=>"15.36 GiB", "memoryfree_mb"=>15725.71875, "memorysize"=>"15.53 GiB", "memorysize_mb"=>15900.7578125, "mountpoints"=>{"/"=>{"available"=>"6.55 GiB", "available_bytes"=>7033344000, "capacity"=>"15.45%", "device"=>"/dev/nvme0n1p1", "filesystem"=>"ext4", "options"=>["rw", "noatime", "data=ordered"], "size"=>"7.75 GiB", "size_bytes"=>8318783488, "used"=>"1.20 GiB", "used_bytes"=>1285439488}, "/dev/shm"=>{"available"=>"7.76 GiB", "available_bytes"=>8336576512, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"7.76 GiB", "size_bytes"=>8336576512, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>9001, "mtu_lo"=>65536, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.240.0", "netmask_lo"=>"255.0.0.0", "network"=>"172.31.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"172.31.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"172.31.0.1", "domain"=>"us-west-2.compute.internal", "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "hostname"=>"ip-172-31-3-153", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"172.31.3.153", "netmask"=>"255.255.240.0", "network"=>"172.31.0.0"}], "bindings6"=>[{"address"=>"fe80::8ca:e0ff:fe39:c1f6", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"172.31.0.1", "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"Amazon", "operatingsystemmajrelease"=>"2018", "operatingsystemrelease"=>"2018.03", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"Amazon", "release"=>{"full"=>"2018.03", "major"=>"2018", "minor"=>"03"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/nvme0n1p1"=>{"filesystem"=>"ext4", "label"=>"/", "mount"=>"/", "partlabel"=>"Linux", "partuuid"=>"893c59db-bd86-4d67-b40f-221bc82c14c8", "size"=>"8.00 GiB", "size_bytes"=>8587820544, "uuid"=>"f25f5092-0401-4edb-9fac-c57f3c673803"}, "/dev/nvme0n1p128"=>{"partlabel"=>"BIOS Boot Partition", "partuuid"=>"9d1c14c8-e25b-4405-9171-de3c756f61b2", "size"=>"1.00 MiB", "size_bytes"=>1048576}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin", "physicalprocessorcount"=>1, "processor0"=>"AMD EPYC 7571", "processor1"=>"AMD EPYC 7571", "processor2"=>"AMD EPYC 7571", "processor3"=>"AMD EPYC 7571", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571"], "physicalcount"=>1}, "productname"=>"t3a.xlarge", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>false, "serialnumber"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd", "sha256"=>"SSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f"}, "key"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4", "sha256"=>"SSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc", "sha256"=>"SSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28", "sha256"=>"SSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "sshfp_dsa"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd\nSSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f", "sshfp_ecdsa"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4\nSSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b", "sshfp_ed25519"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc\nSSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f", "sshfp_rsa"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28\nSSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>136, "uptime"=>"0:02 hours"}, "timezone"=>"UTC", "uptime"=>"0:02 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>136, "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA", "virtual"=>"kvm", "clientcert"=>"ip-172-31-3-153.us-west-2.compute.internal", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Amazon-2018.03' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_CentOS-5.11-32_spec.rb b/.onceover/spec/classes/role__metrics_on_CentOS-5.11-32_spec.rb new file mode 100644 index 0000000..87463ba --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_CentOS-5.11-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set CentOS-5.11-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>0, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>0}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:febf:56", "ipaddress6_eth0"=>"fe80::a00:27ff:febf:56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.11, "1m"=>0.28, "5m"=>0.22}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:bf:00:56", "macaddress_eth0"=>"08:00:27:bf:00:56", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"429.48 MiB", "available_bytes"=>450342912, "capacity"=>"14.58%", "total"=>"502.80 MiB", "total_bytes"=>527220736, "used"=>"73.32 MiB", "used_bytes"=>76877824}}, "memoryfree"=>"429.48 MiB", "memoryfree_mb"=>429.48046875, "memorysize"=>"502.80 MiB", "memorysize_mb"=>502.796875, "mountpoints"=>{"/"=>{"available"=>"1.09 GiB", "available_bytes"=>1171632128, "capacity"=>"52.22%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"2.28 GiB", "size_bytes"=>-1842671616, "used"=>"1.19 GiB", "used_bytes"=>1280663552}, "/boot"=>{"available"=>"86.58 MiB", "available_bytes"=>90790912, "capacity"=>"12.29%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.13 MiB", "used_bytes"=>12721152}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f", "sha256"=>"SSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940"}, "key"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5", "sha256"=>"SSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo=", "sshfp_dsa"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f\nSSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940", "sshfp_rsa"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5\nSSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1067, "uptime"=>"0:17 hours"}, "timezone"=>"UTC", "uptime"=>"0:17 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1067, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'CentOS-5.11-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_CentOS-5.11-64_spec.rb b/.onceover/spec/classes/role__metrics_on_CentOS-5.11-64_spec.rb new file mode 100644 index 0000000..bcf819c --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_CentOS-5.11-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set CentOS-5.11-64" do + node_facts = {"architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>21474836480, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>21474836480}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_eth0"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:3e:49:87", "macaddress_eth0"=>"08:00:27:3e:49:87", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"389.45 MiB", "available_bytes"=>408363008, "capacity"=>"21.76%", "total"=>"497.78 MiB", "total_bytes"=>521961472, "used"=>"108.34 MiB", "used_bytes"=>113598464}}, "memoryfree"=>"389.45 MiB", "memoryfree_mb"=>389.4453125, "memorysize"=>"497.78 MiB", "memorysize_mb"=>497.78125, "mountpoints"=>{"/"=>{"available"=>"16.96 GiB", "available_bytes"=>18212638720, "capacity"=>"7.23%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"18.28 GiB", "size_bytes"=>19632164864, "used"=>"1.32 GiB", "used_bytes"=>1419526144}, "/boot"=>{"available"=>"86.04 MiB", "available_bytes"=>90215424, "capacity"=>"12.85%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.68 MiB", "used_bytes"=>13296640}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d", "sha256"=>"SSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7", "sha256"=>"SSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ==", "sshfp_dsa"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d\nSSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb", "sshfp_rsa"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7\nSSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>847, "uptime"=>"0:14 hours"}, "timezone"=>"UTC", "uptime"=>"0:14 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>847, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'CentOS-5.11-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_CentOS-6.6-32_spec.rb b/.onceover/spec/classes/role__metrics_on_CentOS-6.6-32_spec.rb new file mode 100644 index 0000000..f5316a1 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_CentOS-6.6-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set CentOS-6.6-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_eth0"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.el6.i686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:ff:42:e5", "macaddress_eth0"=>"08:00:27:ff:42:e5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.00 GiB", "available_bytes"=>1073737728, "capacity"=>"0%", "total"=>"1.00 GiB", "total_bytes"=>1073737728, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"451.91 MiB", "available_bytes"=>473862144, "capacity"=>"9.40%", "total"=>"498.82 MiB", "total_bytes"=>523051008, "used"=>"46.91 MiB", "used_bytes"=>49188864}}, "memoryfree"=>"451.91 MiB", "memoryfree_mb"=>451.91015625, "memorysize"=>"498.82 MiB", "memorysize_mb"=>498.8203125, "mountpoints"=>{"/"=>{"available"=>"1.02 GiB", "available_bytes"=>1099689984, "capacity"=>"51.05%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"2.09 GiB", "size_bytes"=>-2048442368, "used"=>"1.07 GiB", "used_bytes"=>1146834944}, "/boot"=>{"available"=>"450.39 MiB", "available_bytes"=>472266752, "capacity"=>"5.42%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"25.83 MiB", "used_bytes"=>27088896}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"i386", "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"bc353fb2-82b1-4d41-a43e-6512030a2a28"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"eb19f39e-a1cc-4e43-bf33-809fa7f52044"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"51727e98-6cd5-4fba-8a1f-7d4dfb575e1f"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>-525336576, "uuid"=>"vkG7sJ-bfu3-Cko3-YJ7v-jPys-3uHe-vki0jZ"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe", "sha256"=>"SSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877"}, "key"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8", "sha256"=>"SSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow==", "sshfp_dsa"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe\nSSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877", "sshfp_rsa"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8\nSSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw==", "swapfree"=>"1.00 GiB", "swapfree_mb"=>1023.99609375, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1023.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>430, "uptime"=>"0:07 hours"}, "timezone"=>"UTC", "uptime"=>"0:07 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>430, "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'CentOS-6.6-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_CentOS-6.6-64_spec.rb b/.onceover/spec/classes/role__metrics_on_CentOS-6.6-64_spec.rb new file mode 100644 index 0000000..4b3d155 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_CentOS-6.6-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set CentOS-6.6-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos6a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.7", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth0"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth1"=>"fe80::a00:27ff:fe66:988a", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.88", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.7", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.8.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:0f:d2:76", "macaddress_eth0"=>"08:00:27:0f:d2:76", "macaddress_eth1"=>"08:00:27:66:98:8a", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"992.00 MiB", "available_bytes"=>1040183296, "capacity"=>"0%", "total"=>"992.00 MiB", "total_bytes"=>1040183296, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"348.41 MiB", "available_bytes"=>365338624, "capacity"=>"28.95%", "total"=>"490.39 MiB", "total_bytes"=>514215936, "used"=>"141.98 MiB", "used_bytes"=>148877312}}, "memoryfree"=>"348.41 MiB", "memoryfree_mb"=>348.4140625, "memorysize"=>"490.39 MiB", "memorysize_mb"=>490.39453125, "mountpoints"=>{"/"=>{"available"=>"16.94 GiB", "available_bytes"=>18193268736, "capacity"=>"6.51%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"18.12 GiB", "size_bytes"=>19459338240, "used"=>"1.18 GiB", "used_bytes"=>1266069504}, "/boot"=>{"available"=>"448.35 MiB", "available_bytes"=>470125568, "capacity"=>"5.85%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"27.88 MiB", "used_bytes"=>29230080}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8555670, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "hostname"=>"centos6a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.88", "ip6"=>"fe80::a00:27ff:fe66:988a", "mac"=>"08:00:27:66:98:8a", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"a29409f8-0b58-4271-a348-032caefec8b8"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b30b464a-8ac9-492a-a1c5-2da75bb7488a"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"da946872-1406-4ac1-9a4d-f7ce5f7be47e"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"nRdWPh-INkA-aHPs-TNtk-HjJG-SxBU-DdqI8a"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-6-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8", "sha256"=>"SSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745"}, "key"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef", "sha256"=>"SSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg==", "sshfp_dsa"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8\nSSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745", "sshfp_rsa"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef\nSSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ==", "staging_http_get"=>"curl", "swapfree"=>"992.00 MiB", "swapfree_mb"=>991.99609375, "swapsize"=>"992.00 MiB", "swapsize_mb"=>991.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>352, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>352, "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C", "virtual"=>"virtualbox", "clientcert"=>"centos6a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'CentOS-6.6-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_CentOS-7.0-64_spec.rb b/.onceover/spec/classes/role__metrics_on_CentOS-7.0-64_spec.rb new file mode 100644 index 0000000..21e9570 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_CentOS-7.0-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set CentOS-7.0-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"sydney", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "enp0s8"=>"192.168.56.100", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF"}}, "domain"=>"syd.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"xfs", "fqdn"=>"centos7b.syd.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos7b", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,enp0s8,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s3"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s8"=>"fe80::a00:27ff:fe39:832c", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_enp0s8"=>"10.20.1.92", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-123.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.26, "5m"=>0.12}, "macaddress"=>"08:00:27:39:18:3c", "macaddress_enp0s3"=>"08:00:27:39:18:3c", "macaddress_enp0s8"=>"08:00:27:39:83:2c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.03 GiB", "available_bytes"=>1107292160, "capacity"=>"0%", "total"=>"1.03 GiB", "total_bytes"=>1107292160, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"297.76 MiB", "available_bytes"=>312225792, "capacity"=>"39.28%", "total"=>"490.41 MiB", "total_bytes"=>514228224, "used"=>"192.64 MiB", "used_bytes"=>202002432}}, "memoryfree"=>"297.76 MiB", "memoryfree_mb"=>297.76171875, "memorysize"=>"490.41 MiB", "memorysize_mb"=>490.40625, "mountpoints"=>{"/"=>{"available"=>"17.30 GiB", "available_bytes"=>18574749696, "capacity"=>"6.32%", "device"=>"/dev/mapper/centos-root", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"18.47 GiB", "size_bytes"=>19828572160, "used"=>"1.17 GiB", "used_bytes"=>1253822464}, "/boot"=>{"available"=>"393.11 MiB", "available_bytes"=>412209152, "capacity"=>"20.85%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.67 MiB", "size_bytes"=>520794112, "used"=>"103.55 MiB", "used_bytes"=>108584960}}, "mtu_enp0s3"=>1500, "mtu_enp0s8"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8563388, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s8"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_enp0s8"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_enp0s8"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_enp0s8"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"syd.puppetlabs.demo", "fqdn"=>"centos7b.syd.puppetlabs.demo", "hostname"=>"centos7b", "interfaces"=>{"enp0s3"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "enp0s8"=>{"dhcp"=>"192.168.56.100", "ip"=>"10.20.1.92", "ip6"=>"fe80::a00:27ff:fe39:832c", "mac"=>"08:00:27:39:83:2c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.0.1406", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"7.0.1406", "major"=>"7", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/centos-root"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"db651e5f-a2c2-4236-9570-6226f63e1fcd"}, "/dev/mapper/centos-swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"ff4ec16c-28c0-4715-846d-11e7c9b4e53b"}, "/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"39ce4ad1-4e9d-49a4-bce0-8a30b459490a"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"pg7zVv-M3hI-zpjY-eYlZ-06aD-ZRO2-J30GLd"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-7-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb", "sha256"=>"SSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581", "sha256"=>"SSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4=", "sshfp_ecdsa"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb\nSSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba", "sshfp_rsa"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581\nSSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1", "staging_http_get"=>"curl", "swapfree"=>"1.03 GiB", "swapfree_mb"=>1055.99609375, "swapsize"=>"1.03 GiB", "swapsize_mb"=>1055.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>78, "uptime"=>"0:01 hours"}, "timezone"=>"UTC", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>78, "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF", "virtual"=>"virtualbox", "clientcert"=>"centos7b.syd.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'CentOS-7.0-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Debian-6.0.10-32_spec.rb b/.onceover/spec/classes/role__metrics_on_Debian-6.0.10-32_spec.rb new file mode 100644 index 0000000..21f66ba --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Debian-6.0.10-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Debian-6.0.10-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_eth0"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:ad:dc:1c", "macaddress_eth0"=>"08:00:27:ad:dc:1c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"434.46 MiB", "available_bytes"=>455565312, "capacity"=>"13.56%", "total"=>"502.63 MiB", "total_bytes"=>527040512, "used"=>"68.16 MiB", "used_bytes"=>71475200}}, "memoryfree"=>"434.46 MiB", "memoryfree_mb"=>434.4609375, "memorysize"=>"502.63 MiB", "memorysize_mb"=>502.625, "mountpoints"=>{"/"=>{"available"=>"1.69 GiB", "available_bytes"=>1819041792, "capacity"=>"35.07%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"937.10 MiB", "used_bytes"=>982618112}, "/boot"=>{"available"=>"213.27 MiB", "available_bytes"=>223632384, "capacity"=>"6.35%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"14.45 MiB", "used_bytes"=>15155200}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"092d5625-eb03-443c-953f-006bec7d5476"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"f9e1cf7c-ab54-4949-8e55-290adc8d853f"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"2c798378-1738-426f-a847-c929a507fc73"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"cG2Syv-bT1d-2TyA-Wqgz-33I2-RnTz-jA2LxS"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57", "sha256"=>"SSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09"}, "key"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b", "sha256"=>"SSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g==", "sshfp_dsa"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57\nSSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09", "sshfp_rsa"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b\nSSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1441, "uptime"=>"0:24 hours"}, "timezone"=>"PST", "uptime"=>"0:24 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1441, "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Debian-6.0.10-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Debian-6.0.10-64_spec.rb b/.onceover/spec/classes/role__metrics_on_Debian-6.0.10-64_spec.rb new file mode 100644 index 0000000..e914842 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Debian-6.0.10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Debian-6.0.10-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_eth0"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-amd64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:62:fa:69", "macaddress_eth0"=>"08:00:27:62:fa:69", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.43 MiB", "available_bytes"=>401010688, "capacity"=>"23.04%", "total"=>"496.90 MiB", "total_bytes"=>521035776, "used"=>"114.46 MiB", "used_bytes"=>120025088}}, "memoryfree"=>"382.43 MiB", "memoryfree_mb"=>382.43359375, "memorysize"=>"496.90 MiB", "memorysize_mb"=>496.8984375, "mountpoints"=>{"/"=>{"available"=>"17.65 GiB", "available_bytes"=>18949697536, "capacity"=>"5.16%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"984.03 MiB", "used_bytes"=>1031831552}, "/boot"=>{"available"=>"212.24 MiB", "available_bytes"=>222552064, "capacity"=>"6.80%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"15.48 MiB", "used_bytes"=>16235520}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"d2763d16-5203-4625-8733-a6f2ecc94f5a"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b5661448-0339-4ba3-8593-21cc6a049d33"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"415531d6-6955-433f-921e-8f266ab56649"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vGb2LM-M1SP-IynO-OZJV-sYKl-Pcfo-fAFbiz"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f", "sha256"=>"SSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad"}, "key"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2", "sha256"=>"SSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ", "sshfp_dsa"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f\nSSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad", "sshfp_rsa"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2\nSSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1211, "uptime"=>"0:20 hours"}, "timezone"=>"PST", "uptime"=>"0:20 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1211, "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Debian-6.0.10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Debian-7.8-32_spec.rb b/.onceover/spec/classes/role__metrics_on_Debian-7.8-32_spec.rb new file mode 100644 index 0000000..27ff6a2 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Debian-7.8-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Debian-7.8-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_eth0"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-686-pae", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:18:59:a5", "macaddress_eth0"=>"08:00:27:18:59:a5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"432.02 MiB", "available_bytes"=>453001216, "capacity"=>"14.00%", "total"=>"502.32 MiB", "total_bytes"=>526725120, "used"=>"70.31 MiB", "used_bytes"=>73723904}}, "memoryfree"=>"432.02 MiB", "memoryfree_mb"=>432.015625, "memorysize"=>"502.32 MiB", "memorysize_mb"=>502.32421875, "mountpoints"=>{"/"=>{"available"=>"1.52 GiB", "available_bytes"=>1633996800, "capacity"=>"41.68%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"1.09 GiB", "used_bytes"=>1167663104}, "/boot"=>{"available"=>"211.24 MiB", "available_bytes"=>221499392, "capacity"=>"7.24%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"16.49 MiB", "used_bytes"=>17288192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c87cb2c9-ffb8-48d1-bc31-024a57d3e44e"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"864df30a-fc50-4a93-8cfd-4624251c1589"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"b8ab8500-a238-4554-8d11-9c194ebba70c"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"NvdPwA-esP3-xUuv-n9OR-Ep7r-kQAr-qyUAzr"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa", "sha256"=>"SSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906"}, "key"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4", "sha256"=>"SSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d", "sha256"=>"SSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA=", "sshfp_dsa"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa\nSSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906", "sshfp_ecdsa"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4\nSSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480", "sshfp_rsa"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d\nSSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>800, "uptime"=>"0:13 hours"}, "timezone"=>"PST", "uptime"=>"0:13 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>800, "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Debian-7.8-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Debian-7.8-64_spec.rb b/.onceover/spec/classes/role__metrics_on_Debian-7.8-64_spec.rb new file mode 100644 index 0000000..5eb653a --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Debian-7.8-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Debian-7.8-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_eth0"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-amd64", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:83:ad:56", "macaddress_eth0"=>"08:00:27:83:ad:56", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.02 MiB", "available_bytes"=>400576512, "capacity"=>"23.13%", "total"=>"496.96 MiB", "total_bytes"=>521101312, "used"=>"114.94 MiB", "used_bytes"=>120524800}}, "memoryfree"=>"382.02 MiB", "memoryfree_mb"=>382.01953125, "memorysize"=>"496.96 MiB", "memorysize_mb"=>496.9609375, "mountpoints"=>{"/"=>{"available"=>"17.49 GiB", "available_bytes"=>18781380608, "capacity"=>"6.01%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"1.12 GiB", "used_bytes"=>1200148480}, "/boot"=>{"available"=>"210.36 MiB", "available_bytes"=>220575744, "capacity"=>"7.63%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"17.37 MiB", "used_bytes"=>18211840}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"7b853135-fb91-48ff-a25c-8d34ada8d549"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"486756ce-bdd1-45f4-864d-e4b6fce59b9d"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"8aa50802-2811-43ec-9686-a30f6a1c3ade"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"eGBBBU-DZw3-wy0f-OMxw-Sf5d-jDyA-ctqcpx"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac", "sha256"=>"SSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a", "sha256"=>"SSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37", "sha256"=>"SSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI=", "sshfp_dsa"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac\nSSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144", "sshfp_ecdsa"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a\nSSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6", "sshfp_rsa"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37\nSSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>650, "uptime"=>"0:10 hours"}, "timezone"=>"PST", "uptime"=>"0:10 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>650, "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Debian-7.8-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_RHEL-6.7_spec.rb b/.onceover/spec/classes/role__metrics_on_RHEL-6.7_spec.rb new file mode 100644 index 0000000..68a3b33 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_RHEL-6.7_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set RHEL-6.7" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"sr0,sdb,sda", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-9727-3914-2228-1494-64", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-9727-3914-2228-1494-64"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0016-4348-2410-5386-3288-39", "uuid"=>"723914E4-94CB-0743-9847-001D218884D8"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext4,iso9660,udf", "fips_enabled"=>false, "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel6box", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.5", "ipaddress6"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_eth0"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.5", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-573.45.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.06, "1m"=>0.15, "5m"=>0.14}, "lsbdistcodename"=>"Santiago", "lsbdistdescription"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "lsbdistid"=>"RedHatEnterpriseServer", "lsbdistrelease"=>"6.7", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"7", "lsbrelease"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch", "macaddress"=>"00:0d:3a:96:ed:47", "macaddress_eth0"=>"00:0d:3a:96:ed:47", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.55 GiB", "available_bytes"=>8103010304, "capacity"=>"3.24%", "total"=>"7.80 GiB", "total_bytes"=>8374747136, "used"=>"259.15 MiB", "used_bytes"=>271736832}}, "memoryfree"=>"7.55 GiB", "memoryfree_mb"=>7727.6328125, "memorysize"=>"7.80 GiB", "memorysize_mb"=>7986.78125, "mountpoints"=>{"/"=>{"available"=>"27.90 GiB", "available_bytes"=>29956210688, "capacity"=>"9.68%", "device"=>"/dev/sda2", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"30.89 GiB", "size_bytes"=>33168420864, "used"=>"2.99 GiB", "used_bytes"=>3212210176}, "/boot"=>{"available"=>"402.87 MiB", "available_bytes"=>422435840, "capacity"=>"15.40%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"73.36 MiB", "used_bytes"=>76919808}, "/dev/shm"=>{"available"=>"3.90 GiB", "available_bytes"=>4187373568, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "rootcontext=\"system_u:object_r:tmpfs_t:s0\""], "size"=>"3.90 GiB", "size_bytes"=>4187373568, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506543104, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"49.09 GiB", "size_bytes"=>52708372480, "used"=>"2.05 GiB", "used_bytes"=>2201829376}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel6box", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.5", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe96:ed47", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.7", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Santiago", "description"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "id"=>"RedHatEnterpriseServer", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "specification"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "selinux"=>{"config_mode"=>"enforcing", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"24"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"ce2ad98e-bb9f-4603-abce-3db7fd857a6c"}, "/dev/sda2"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"be4cc18d-b110-4914-a6f9-52dc0dc66f68"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"aafc7ffe-f0b2-4872-8174-a05f24f6c3d4"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"24", "serialnumber"=>"0000-0016-4348-2410-5386-3288-39", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce", "sha256"=>"SSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd"}, "key"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "type"=>"ssh-dss"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d", "sha256"=>"SSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "sshfp_dsa"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce\nSSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd", "sshfp_rsa"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d\nSSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>239, "uptime"=>"0:03 hours"}, "timezone"=>"EDT", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>239, "uuid"=>"723914E4-94CB-0743-9847-001D218884D8", "virtual"=>"hyperv", "clientcert"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'RHEL-6.7' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_RHEL-7.4_spec.rb b/.onceover/spec/classes/role__metrics_on_RHEL-7.4_spec.rb new file mode 100644 index 0000000..70752da --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_RHEL-7.4_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set RHEL-7.4" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_fd0_size"=>4096, "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"fd0,sda,sdb,sr0", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-6006-7746-5828-7871-43", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"fd0"=>{"size"=>"4.00 KiB", "size_bytes"=>4096}, "sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-6006-7746-5828-7871-43"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0017-8302-7891-2115-8198-39", "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext2,ext3,ext4,udf,xfs", "fips_enabled"=>false, "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel7test", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.6", "ipaddress6"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_eth0"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.6", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-693.46.1.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.08, "1m"=>0.32, "5m"=>0.19}, "macaddress"=>"00:0d:3a:90:57:80", "macaddress_eth0"=>"00:0d:3a:90:57:80", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.42 GiB", "available_bytes"=>7963906048, "capacity"=>"4.67%", "total"=>"7.78 GiB", "total_bytes"=>8353742848, "used"=>"371.78 MiB", "used_bytes"=>389836800}}, "memoryfree"=>"7.42 GiB", "memoryfree_mb"=>7594.97265625, "memorysize"=>"7.78 GiB", "memorysize_mb"=>7966.75, "mountpoints"=>{"/"=>{"available"=>"29.95 GiB", "available_bytes"=>32156790784, "capacity"=>"4.91%", "device"=>"/dev/sda2", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"31.50 GiB", "size_bytes"=>33817882624, "used"=>"1.55 GiB", "used_bytes"=>1661091840}, "/boot"=>{"available"=>"393.75 MiB", "available_bytes"=>412880896, "capacity"=>"20.72%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.66 MiB", "size_bytes"=>520785920, "used"=>"102.91 MiB", "used_bytes"=>107905024}, "/dev/shm"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506170368, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw", "seclabel", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52708212736, "used"=>"2.05 GiB", "used_bytes"=>2202042368}, "/run"=>{"available"=>"3.88 GiB", "available_bytes"=>4168146944, "capacity"=>"0.21%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"8.32 MiB", "used_bytes"=>8724480}, "/run/user/1000"=>{"available"=>"796.68 MiB", "available_bytes"=>835375104, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "relatime", "size=815796k", "mode=700", "uid=1000", "gid=1000"], "size"=>"796.68 MiB", "size_bytes"=>835375104, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "seclabel", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel7test", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.6", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe90:5780", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.4", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"7.4", "major"=>"7", "minor"=>"4"}, "selinux"=>{"config_mode"=>"enforcing", "config_policy"=>"targeted", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"28"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"b3f65ad5-0571-4ae4-937a-13ef2fda43e3"}, "/dev/sda2"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"e9643aa4-b339-43c4-afc5-fcac22af1584"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"07908b37-1661-4130-9d5a-e1fdb0a4bdb2"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_config_policy"=>"targeted", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"28", "serialnumber"=>"0000-0017-8302-7891-2115-8198-39", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7", "sha256"=>"SSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929", "sha256"=>"SSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a", "sha256"=>"SSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "type"=>"ssh-rsa"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "sshfp_ecdsa"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7\nSSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2", "sshfp_ed25519"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929\nSSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282", "sshfp_rsa"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a\nSSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>215, "uptime"=>"0:03 hours"}, "timezone"=>"UTC", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>215, "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7", "virtual"=>"hyperv", "clientcert"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'RHEL-7.4' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_SLES-11.3-64_spec.rb b/.onceover/spec/classes/role__metrics_on_SLES-11.3-64_spec.rb new file mode 100644 index 0000000..c7c1b21 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_SLES-11.3-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set SLES-11.3-64" do + node_facts = {"aio_agent_version"=>"1.8.3", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D"}}, "domain"=>"lan.asio", "facterversion"=>"3.5.1", "filesystems"=>"ext3,iso9660,squashfs", "fqdn"=>"sles11-sp3.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles11-sp3", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe48:617f", "ipaddress6_eth0"=>"fe80::216:3eff:fe48:617f", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.0", "kernelrelease"=>"3.0.101-0.47.67-default", "kernelversion"=>"3.0.101", "load_averages"=>{"15m"=>0.06, "1m"=>0.18, "5m"=>0.08}, "macaddress"=>"00:16:3e:48:61:7f", "macaddress_eth0"=>"00:16:3e:48:61:7f", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"354.30 MiB", "available_bytes"=>371511296, "capacity"=>"27.78%", "total"=>"490.61 MiB", "total_bytes"=>514437120, "used"=>"136.30 MiB", "used_bytes"=>142925824}}, "memoryfree"=>"354.30 MiB", "memoryfree_mb"=>354.30078125, "memorysize"=>"490.61 MiB", "memorysize_mb"=>490.60546875, "mountpoints"=>{"/"=>{"available"=>"47.14 GiB", "available_bytes"=>50611761152, "capacity"=>"4.22%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=continue", "barrier=1", "data=ordered"], "size"=>"49.21 GiB", "size_bytes"=>52843638784, "used"=>"2.08 GiB", "used_bytes"=>2231877632}, "/dev/shm"=>{"available"=>"245.29 MiB", "available_bytes"=>257208320, "capacity"=>"0.00%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"245.30 MiB", "size_bytes"=>257216512, "used"=>"8.00 KiB", "used_bytes"=>8192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"lan.asio", "fqdn"=>"sles11-sp3.lan.asio", "hostname"=>"sles11-sp3", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe48:617f", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, {"address"=>"127.0.0.2", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.3", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"11.3", "major"=>"11", "minor"=>"3"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"586adc21-9cfc-4e12-93e6-c711ab2400b1"}}, "path"=>"/usr/bin:/bin:/usr/sbin:/sbin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.8.2", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5", "sha256"=>"SSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11"}, "key"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17", "sha256"=>"SSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41", "sha256"=>"SSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY=", "sshfp_dsa"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5\nSSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11", "sshfp_ecdsa"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17\nSSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e", "sshfp_rsa"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41\nSSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>524, "uptime"=>"0:08 hours"}, "timezone"=>"UTC", "uptime"=>"0:08 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>524, "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D", "virtual"=>"virtualbox", "clientcert"=>"sles11-sp3.lan.asio", "clientversion"=>"4.8.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'SLES-11.3-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_SLES-12.1-64_spec.rb b/.onceover/spec/classes/role__metrics_on_SLES-12.1-64_spec.rb new file mode 100644 index 0000000..efe8bde --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_SLES-12.1-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set SLES-12.1-64" do + node_facts = {"aio_agent_build"=>"1.7.2", "aio_agent_version"=>"1.7.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E"}}, "domain"=>"openstack.site", "facterversion"=>"3.4.2", "filesystems"=>"ext2,ext3,ext4", "fqdn"=>"sles12-sp1.openstack.site", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles12-sp1", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth0"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth1"=>"fe80::a00:27ff:fe60:90e", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"192.168.33.15", "ipaddress_lo"=>"127.0.0.1", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.12", "kernelrelease"=>"3.12.62-60.64.8-default", "kernelversion"=>"3.12.62", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.02}, "macaddress"=>"00:16:3e:72:f1:21", "macaddress_eth0"=>"00:16:3e:72:f1:21", "macaddress_eth1"=>"08:00:27:60:09:0e", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.78 GiB", "available_bytes"=>1907027968, "capacity"=>"68.84%", "total"=>"5.70 GiB", "total_bytes"=>6119927808, "used"=>"3.92 GiB", "used_bytes"=>4212899840}}, "memoryfree"=>"1.78 GiB", "memoryfree_mb"=>1818.68359375, "memorysize"=>"5.70 GiB", "memorysize_mb"=>5836.41796875, "mountpoints"=>{"/"=>{"available"=>"45.34 GiB", "available_bytes"=>48682504192, "capacity"=>"7.64%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52709421056, "used"=>"3.75 GiB", "used_bytes"=>4026916864}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"192.168.33.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"openstack.site", "fqdn"=>"sles12-sp1.openstack.site", "hostname"=>"sles12-sp1", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe72:f121", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"bindings"=>[{"address"=>"192.168.33.15", "netmask"=>"255.255.255.0", "network"=>"192.168.33.0"}], "bindings6"=>[{"address"=>"fe80::a00:27ff:fe60:90e", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"192.168.33.15", "ip6"=>"fe80::a00:27ff:fe60:90e", "mac"=>"08:00:27:60:09:0e", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"192.168.33.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"12", "operatingsystemrelease"=>"12.1", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"12.1", "major"=>"12", "minor"=>"1"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "label"=>"ROOT", "mount"=>"/", "partuuid"=>"3d2745bf-01", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"dcf2494f-2b02-466b-aa2c-9e7c01bdbdd7"}}, "path"=>"/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/games", "pe_build"=>"2016.4.3", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_server_version"=>"2016.4.3", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"sles-12-x86_64", "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppetversion"=>"4.7.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1", "sha256"=>"SSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b", "sha256"=>"SSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459", "sha256"=>"SSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51", "sha256"=>"SSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx", "sshfp_dsa"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1\nSSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5", "sshfp_ecdsa"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b\nSSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd", "sshfp_ed25519"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459\nSSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf", "sshfp_rsa"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51\nSSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/", "staging_http_get"=>"curl", "system_uptime"=>{"days"=>1, "hours"=>41, "seconds"=>148058, "uptime"=>"1 day"}, "timezone"=>"UTC", "uptime"=>"1 day", "uptime_days"=>1, "uptime_hours"=>41, "uptime_seconds"=>148058, "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E", "virtual"=>"virtualbox", "clientcert"=>"sles12-sp1.openstack.site", "clientversion"=>"4.7.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'SLES-12.1-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Ubuntu-12.04-32_spec.rb b/.onceover/spec/classes/role__metrics_on_Ubuntu-12.04-32_spec.rb new file mode 100644 index 0000000..e47bef4 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Ubuntu-12.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Ubuntu-12.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_eth0"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.23, "5m"=>0.09}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:8d:61:88", "macaddress_eth0"=>"08:00:27:8d:61:88", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"407.73 MiB", "available_bytes"=>427540480, "capacity"=>"17.64%", "total"=>"495.05 MiB", "total_bytes"=>519102464, "used"=>"87.32 MiB", "used_bytes"=>91561984}}, "memoryfree"=>"407.73 MiB", "memoryfree_mb"=>407.734375, "memorysize"=>"495.05 MiB", "memorysize_mb"=>495.0546875, "mountpoints"=>{"/"=>{"available"=>"1.81 GiB", "available_bytes"=>1940865024, "capacity"=>"36.14%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.02 GiB", "used_bytes"=>1098407936}, "/boot"=>{"available"=>"203.56 MiB", "available_bytes"=>213447680, "capacity"=>"13.50%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"31.76 MiB", "used_bytes"=>33307648}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"3fff8935-622f-4e9a-944f-38108c71af34"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"185fbdf2-880c-4aa6-ada8-8dade7aa3fc6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"31f2e84f-0e99-4531-9ecb-2b151fc6ce31"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"S8Vl05-TIfO-rk5Y-gIDu-TIwj-L8Ub-3OjoJb"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b", "sha256"=>"SSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0"}, "key"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21", "sha256"=>"SSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f", "sha256"=>"SSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0=", "sshfp_dsa"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b\nSSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0", "sshfp_ecdsa"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21\nSSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668", "sshfp_rsa"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f\nSSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>60, "uptime"=>"0:01 hours"}, "timezone"=>"PST", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>60, "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Ubuntu-12.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Ubuntu-12.04-64_spec.rb b/.onceover/spec/classes/role__metrics_on_Ubuntu-12.04-64_spec.rb new file mode 100644 index 0000000..fed1900 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Ubuntu-12.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Ubuntu-12.04-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_eth0"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:5f:df:27", "macaddress_eth0"=>"08:00:27:5f:df:27", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"350.97 MiB", "available_bytes"=>368017408, "capacity"=>"28.33%", "total"=>"489.72 MiB", "total_bytes"=>513507328, "used"=>"138.75 MiB", "used_bytes"=>145489920}}, "memoryfree"=>"350.97 MiB", "memoryfree_mb"=>350.96875, "memorysize"=>"489.72 MiB", "memorysize_mb"=>489.71875, "mountpoints"=>{"/"=>{"available"=>"17.68 GiB", "available_bytes"=>18981703680, "capacity"=>"6.12%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.15 GiB", "used_bytes"=>1237438464}, "/boot"=>{"available"=>"202.55 MiB", "available_bytes"=>212389888, "capacity"=>"13.93%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"32.77 MiB", "used_bytes"=>34365440}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"96092a10-847b-4a55-b5dc-87d2cc56ee5e"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"50695407-158d-4b0e-975a-b575fa5f5359"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"829f03e2-ceb8-4f8d-9f32-e1336456f719"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"P6GCnD-xaHj-APeE-m1Em-fr5a-z3Kk-iFVziN"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630", "sha256"=>"SSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420", "sha256"=>"SSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740", "sha256"=>"SSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q=", "sshfp_dsa"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630\nSSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f", "sshfp_ecdsa"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420\nSSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00", "sshfp_rsa"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740\nSSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>368, "uptime"=>"0:06 hours"}, "timezone"=>"PST", "uptime"=>"0:06 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>368, "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Ubuntu-12.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Ubuntu-14.04-32_spec.rb b/.onceover/spec/classes/role__metrics_on_Ubuntu-14.04-32_spec.rb new file mode 100644 index 0000000..d73b1c7 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Ubuntu-14.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Ubuntu-14.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_eth0"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.07}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:71:89:45", "macaddress_eth0"=>"08:00:27:71:89:45", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"414.97 MiB", "available_bytes"=>435126272, "capacity"=>"16.34%", "total"=>"496.04 MiB", "total_bytes"=>520130560, "used"=>"81.07 MiB", "used_bytes"=>85004288}}, "memoryfree"=>"414.97 MiB", "memoryfree_mb"=>414.96875, "memorysize"=>"496.04 MiB", "memorysize_mb"=>496.03515625, "mountpoints"=>{"/"=>{"available"=>"1.72 GiB", "available_bytes"=>1846272000, "capacity"=>"39.25%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.11 GiB", "used_bytes"=>1193000960}, "/boot"=>{"available"=>"200.06 MiB", "available_bytes"=>209779712, "capacity"=>"14.98%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"35.26 MiB", "used_bytes"=>36975616}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b31f5de0-8805-43da-b3f2-da9e51c3401b"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"569bc4ac-b4e8-4e62-8503-551a63285383"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"f00f661b-b4b5-4e6f-bba3-3dcacf85fd8e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"vF1RtV-BHmi-b0UW-QR1z-tJ48-g6Tn-aGgEn7"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf", "sha256"=>"SSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1", "sha256"=>"SSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7", "sha256"=>"SSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae", "sha256"=>"SSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq", "sshfp_dsa"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf\nSSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375", "sshfp_ecdsa"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1\nSSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474", "sshfp_ed25519"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7\nSSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d", "sshfp_rsa"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae\nSSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>354, "uptime"=>"0:05 hours"}, "timezone"=>"PST", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>354, "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Ubuntu-14.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Ubuntu-14.04-64_spec.rb b/.onceover/spec/classes/role__metrics_on_Ubuntu-14.04-64_spec.rb new file mode 100644 index 0000000..76d261c --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Ubuntu-14.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Ubuntu-14.04-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"ubuntu1404a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth0"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth1"=>"fe80::a00:27ff:fe61:1916", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.93", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.06, "1m"=>0.49, "5m"=>0.17}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:ea:20:27", "macaddress_eth0"=>"08:00:27:ea:20:27", "macaddress_eth1"=>"08:00:27:61:19:16", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"331.30 MiB", "available_bytes"=>347394048, "capacity"=>"32.35%", "total"=>"489.74 MiB", "total_bytes"=>513531904, "used"=>"158.44 MiB", "used_bytes"=>166137856}}, "memoryfree"=>"331.30 MiB", "memoryfree_mb"=>331.30078125, "memorysize"=>"489.74 MiB", "memorysize_mb"=>489.7421875, "mountpoints"=>{"/"=>{"available"=>"17.58 GiB", "available_bytes"=>18880684032, "capacity"=>"6.62%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.25 GiB", "used_bytes"=>1338458112}, "/boot"=>{"available"=>"198.65 MiB", "available_bytes"=>208301056, "capacity"=>"15.58%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"36.67 MiB", "used_bytes"=>38454272}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8608807, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "hostname"=>"ubuntu1404a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.93", "ip6"=>"fe80::a00:27ff:fe61:1916", "mac"=>"08:00:27:61:19:16", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c94f234c-f947-450d-aaaf-d32be1b7f27f"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"5501b007-e44b-46cf-b22b-177428cbe5d6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"3a97a5b0-ebd0-4ce6-ba62-d39b4fd0719e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vgfiUo-lVmS-57wx-qv4m-N3fR-efa0-iBI6Cn"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"ubuntu-14.04-amd64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c", "sha256"=>"SSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad", "sha256"=>"SSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234", "sha256"=>"SSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51", "sha256"=>"SSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP", "sshfp_dsa"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c\nSSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4", "sshfp_ecdsa"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad\nSSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8", "sshfp_ed25519"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234\nSSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05", "sshfp_rsa"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51\nSSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv", "staging_http_get"=>"curl", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>47, "uptime"=>"0:00 hours"}, "timezone"=>"PDT", "uptime"=>"0:00 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>47, "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115", "virtual"=>"virtualbox", "clientcert"=>"ubuntu1404a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Ubuntu-14.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Ubuntu-18.04-64_spec.rb b/.onceover/spec/classes/role__metrics_on_Ubuntu-18.04-64_spec.rb new file mode 100644 index 0000000..da88c7f --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Ubuntu-18.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Ubuntu-18.04-64" do + node_facts = {"aio_agent_version"=>"6.14.0", "architecture"=>"amd64", "augeas"=>{"version"=>"1.12.0"}, "augeasversion"=>"1.12.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>10737418240, "blockdevice_sda_vendor"=>"VBOX", "blockdevice_sdb_model"=>"HARDDISK", "blockdevice_sdb_size"=>10485760, "blockdevice_sdb_vendor"=>"VBOX", "blockdevices"=>"sdb,sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"10.00 GiB", "size_bytes"=>10737418240, "vendor"=>"VBOX"}, "sdb"=>{"model"=>"HARDDISK", "size"=>"10.00 MiB", "size_bytes"=>10485760, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3"}}, "domain"=>"lan.asio", "facterversion"=>"3.14.9", "filesystems"=>"btrfs,ext2,ext3,ext4,iso9660,squashfs,vfat", "fips_enabled"=>false, "fqdn"=>"ubuntu-bionic.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ubuntu-bionic", "hypervisors"=>{"virtualbox"=>{"revision"=>"133895", "version"=>"6.0.14"}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_enp0s3"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.15", "kernelrelease"=>"4.15.0-54-generic", "kernelversion"=>"4.15.0", "load_averages"=>{"15m"=>0.1, "1m"=>0.31, "5m"=>0.23}, "lsbdistcodename"=>"bionic", "lsbdistdescription"=>"Ubuntu 18.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"18.04", "lsbmajdistrelease"=>"18.04", "macaddress"=>"02:bb:7d:e8:e9:23", "macaddress_enp0s3"=>"02:bb:7d:e8:e9:23", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"776.53 MiB", "available_bytes"=>814247936, "capacity"=>"21.19%", "total"=>"985.26 MiB", "total_bytes"=>1033121792, "used"=>"208.73 MiB", "used_bytes"=>218873856}}, "memoryfree"=>"776.53 MiB", "memoryfree_mb"=>776.52734375, "memorysize"=>"985.26 MiB", "memorysize_mb"=>985.26171875, "mountpoints"=>{"/"=>{"available"=>"8.14 GiB", "available_bytes"=>8742756352, "capacity"=>"15.32%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw", "relatime", "data=ordered"], "size"=>"9.63 GiB", "size_bytes"=>10340794368, "used"=>"1.47 GiB", "used_bytes"=>1581260800}, "/dev"=>{"available"=>"480.22 MiB", "available_bytes"=>503545856, "capacity"=>"0%", "device"=>"udev", "filesystem"=>"devtmpfs", "options"=>["rw", "nosuid", "relatime", "size=491744k", "nr_inodes=122936", "mode=755"], "size"=>"480.22 MiB", "size_bytes"=>503545856, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/hugepages"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"hugetlbfs", "filesystem"=>"hugetlbfs", "options"=>["rw", "relatime", "pagesize=2M"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/mqueue"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mqueue", "filesystem"=>"mqueue", "options"=>["rw", "relatime"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/pts"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"devpts", "filesystem"=>"devpts", "options"=>["rw", "nosuid", "noexec", "relatime", "gid=5", "mode=620", "ptmxmode=000"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/shm"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/run"=>{"available"=>"97.93 MiB", "available_bytes"=>102690816, "capacity"=>"0.60%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "noexec", "relatime", "size=100892k", "mode=755"], "size"=>"98.53 MiB", "size_bytes"=>103313408, "used"=>"608.00 KiB", "used_bytes"=>622592}, "/run/lock"=>{"available"=>"5.00 MiB", "available_bytes"=>5242880, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "noexec", "relatime", "size=5120k"], "size"=>"5.00 MiB", "size_bytes"=>5242880, "used"=>"0 bytes", "used_bytes"=>0}, "/run/user/1000"=>{"available"=>"98.52 MiB", "available_bytes"=>103309312, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "relatime", "size=100888k", "mode=700", "uid=1000", "gid=1000"], "size"=>"98.52 MiB", "size_bytes"=>103309312, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/vagrant"=>{"available"=>"122.93 GiB", "available_bytes"=>131996221440, "capacity"=>"85.01%", "device"=>"vagrant", "filesystem"=>"vboxsf", "options"=>["rw", "nodev", "relatime", "iocharset=utf8", "uid=1000", "gid=1000"], "size"=>"820.33 GiB", "size_bytes"=>880824786944, "used"=>"697.40 GiB", "used_bytes"=>748828565504}, "/var/lib/lxcfs"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"lxcfs", "filesystem"=>"fuse.lxcfs", "options"=>["rw", "nosuid", "nodev", "relatime", "user_id=0", "group_id=0", "allow_other"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_enp0s3"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"lan.asio", "fqdn"=>"ubuntu-bionic.lan.asio", "hostname"=>"ubuntu-bionic", "interfaces"=>{"enp0s3"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::bb:7dff:fee8:e923", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "scope6"=>"link"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1", "scope6"=>"host"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"enp0s3", "scope6"=>"link"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"18.04", "operatingsystemrelease"=>"18.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"bionic", "description"=>"Ubuntu 18.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "label"=>"cloudimg-rootfs", "mount"=>"/", "partuuid"=>"654c6dc7-01", "size"=>"10.00 GiB", "size_bytes"=>10736352768, "uuid"=>"8de716dd-d9b2-477f-b818-bb0b1eb036ce"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"6.14.0", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.7"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.7", "scope6"=>"link", "scope6_enp0s3"=>"link", "scope6_lo"=>"host", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c", "sha256"=>"SSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9", "sha256"=>"SSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f", "sha256"=>"SSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622", "sha256"=>"SSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "sshfp_dsa"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c\nSSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656", "sshfp_ecdsa"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9\nSSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99", "sshfp_ed25519"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f\nSSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4", "sshfp_rsa"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622\nSSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>336, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>336, "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3", "virtual"=>"virtualbox", "clientcert"=>"ubuntu-bionic.lan.asio", "clientversion"=>"6.14.0", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Ubuntu-18.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Windows_Server-2008r2-64_spec.rb b/.onceover/spec/classes/role__metrics_on_Windows_Server-2008r2-64_spec.rb new file mode 100644 index 0000000..81c50cf --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Windows_Server-2008r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Windows_Server-2008r2-64" do + node_facts = {"agent_specified_environment"=>"production", "aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x64", "common_appdata"=>"C:\\ProgramData", "concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"Local Area Connection"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "domain"=>"pdx.puppetlabs.demo", "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.0.2", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"server2008r2a", "id"=>"SERVER2008R2A\\vagrant", "identity"=>{"user"=>"SERVER2008R2A\\vagrant"}, "iis_version"=>"Get-ItemProperty : Cannot find path 'HKLM:\\SOFTWARE\\Microsoft\\InetStp\\' because it does not exist.\nAt line:1 char:18\n+ (Get-ItemProperty <<<< HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString(8,3)\n + CategoryInfo : ObjectNotFound: (HKLM:\\SOFTWARE\\Microsoft\\InetStp\\:String) [Get-ItemProperty], ItemNotFo \n undException\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\n \nYou cannot call a method on a null-valued expression.\nAt line:1 char:97\n+ (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString <<<< (8,3)\n + CategoryInfo : InvalidOperation: (SubString:String) [], RuntimeException\n + FullyQualifiedErrorId : InvokeMethodOnNull\n \n", "interfaces"=>"Local Area Connection 2,Local Area Connection", "ipaddress"=>"10.20.1.101", "ipaddress6"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress6_Local Area Connection"=>"fe80::50f8:86eb:f103:75b%12", "ipaddress6_Local Area Connection 2"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress_Local Area Connection"=>"10.0.2.15", "ipaddress_Local Area Connection 2"=>"10.20.1.101", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.1", "kernelrelease"=>"6.1.7600", "kernelversion"=>"6.1.7600", "macaddress"=>"08:00:27:7B:C7:40", "macaddress_Local Area Connection"=>"08:00:27:AB:52:FB", "macaddress_Local Area Connection 2"=>"08:00:27:7B:C7:40", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"448.14 MiB", "available_bytes"=>469909504, "capacity"=>"56.22%", "total"=>"1023.55 MiB", "total_bytes"=>1073274880, "used"=>"575.41 MiB", "used_bytes"=>603365376}}, "memoryfree"=>"448.14 MiB", "memoryfree_mb"=>448.140625, "memorysize"=>"1023.55 MiB", "memorysize_mb"=>1023.5546875, "mtu_Local Area Connection"=>1500, "mtu_Local Area Connection 2"=>1500, "mysql_server_id"=>8583088, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection 2"=>"ffff:ffff:ffff:ffff::", "netmask_Local Area Connection"=>"255.255.255.0", "netmask_Local Area Connection 2"=>"255.255.255.0", "network"=>"10.20.1.0", "network6"=>"fe80::%13", "network6_Local Area Connection"=>"fe80::%12", "network6_Local Area Connection 2"=>"fe80::%13", "network_Local Area Connection"=>"10.0.2.0", "network_Local Area Connection 2"=>"10.20.1.0", "networking"=>{"domain"=>"pdx.puppetlabs.demo", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hostname"=>"server2008r2a", "interfaces"=>{"Local Area Connection"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::50f8:86eb:f103:75b%12", "mac"=>"08:00:27:AB:52:FB", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}, "Local Area Connection 2"=>{"ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}}, "ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2008 R2", "operatingsystemrelease"=>"2008 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2008 R2", "major"=>"2008 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\ProgramData\\chocolatey\\bin;", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>false, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "serialnumber"=>"0", "staging_http_get"=>"powershell", "staging_windir"=>"C:\\ProgramData\\staging", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>266, "uptime"=>"0:04 hours"}, "timezone"=>"Pacific Daylight Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>266, "virtual"=>"virtualbox", "clientcert"=>"server2008r2a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Windows_Server-2008r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_Windows_Server-2012r2-64_spec.rb b/.onceover/spec/classes/role__metrics_on_Windows_Server-2012r2-64_spec.rb new file mode 100644 index 0000000..57f4e39 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_Windows_Server-2012r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set Windows_Server-2012r2-64" do + node_facts = {"agent_specified_environment"=>"production", "architecture"=>"x64", "dhcp_servers"=>{"Ethernet"=>"10.0.2.2", "system"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.1.1", "fqdn"=>"WIN-E5K8TM30719", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"WIN-E5K8TM30719", "id"=>"WIN-E5K8TM30719\\vagrant", "identity"=>{"user"=>"WIN-E5K8TM30719\\vagrant"}, "interfaces"=>"Ethernet", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress6_Ethernet"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress_Ethernet"=>"10.0.2.15", "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.3", "kernelrelease"=>"6.3.9600", "kernelversion"=>"6.3.9600", "macaddress"=>"08:00:27:81:38:FA", "macaddress_Ethernet"=>"08:00:27:81:38:FA", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.42 GiB", "available_bytes"=>1521610752, "capacity"=>"29.13%", "total"=>"2.00 GiB", "total_bytes"=>2147012608, "used"=>"596.43 MiB", "used_bytes"=>625401856}}, "memoryfree"=>"1.42 GiB", "memoryfree_mb"=>1451.12109375, "memorysize"=>"2.00 GiB", "memorysize_mb"=>2047.55078125, "mtu_Ethernet"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Ethernet"=>"ffff:ffff:ffff:ffff::", "netmask_Ethernet"=>"255.255.255.0", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "network6_Ethernet"=>"fe80::%12", "network_Ethernet"=>"10.0.2.0", "networking"=>{"dhcp"=>"10.0.2.2", "fqdn"=>"WIN-E5K8TM30719", "hostname"=>"WIN-E5K8TM30719", "interfaces"=>{"Ethernet"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::a180:36e0:3a6e:1005%12", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::%12"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "primary"=>"Ethernet"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2012 R2", "operatingsystemrelease"=>"2012 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2012 R2", "major"=>"2012 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Git\\cmd;C:\\Program Files (x86)\\Git\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.3", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.7"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.7", "serialnumber"=>"0", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>287, "uptime"=>"0:04 hours"}, "timezone"=>"Coordinated Universal Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>287, "virtual"=>"virtualbox", "clientcert"=>"win-e5k8tm30719", "clientversion"=>"4.2.3", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'Windows_Server-2012r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_solaris-10_u9-sparc-64_spec.rb b/.onceover/spec/classes/role__metrics_on_solaris-10_u9-sparc-64_spec.rb new file mode 100644 index 0000000..617ecfd --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_solaris-10_u9-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set solaris-10_u9-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-10_u9-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.42", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.42", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"Generic_Virtual", "kernelrelease"=>"5.10", "kernelversion"=>"Generic_Virtual", "load_averages"=>{"15m"=>1.015625, "1m"=>1.89453125, "5m"=>1.25390625}, "macaddress"=>"02:08:20:f1:97:4b", "macaddress_net0"=>"02:08:20:f1:97:4b", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"3.25 GiB", "available_bytes"=>-806297600, "capacity"=>"78.94%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"12.18 GiB", "used_bytes"=>194560000}}, "memoryfree"=>"3.25 GiB", "memoryfree_mb"=>3327.0546875, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"1.14%", "device"=>"rpool/ROOT/zbe-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950161"], "size"=>"480.01 GiB", "size_bytes"=>13566464, "used"=>"5.49 GiB", "used_bytes"=>1602503680}, "/.SUNWnative/lib"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/lib", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/platform"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/platform", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/sbin"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/sbin", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/usr"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/usr", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc10", "nozonemod", "sharezone=36", "dev=8e0001b"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=9040025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e80025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/svc/volatile"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}, "/export"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950163"], "size"=>"474.52 GiB", "size_bytes"=>-1588904448, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950164"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8dc0024"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950165"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e40025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8f00025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/tmp"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.70%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec004a"], "size"=>"5.52 GiB", "size_bytes"=>1632608256, "used"=>"39.52 MiB", "used_bytes"=>41435136}, "/var"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.03%", "device"=>"rpool/ROOT/zbe-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/var", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950162"], "size"=>"474.66 GiB", "size_bytes"=>-1436724224, "used"=>"145.16 MiB", "used_bytes"=>152212992}, "/var/run"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"/etc/svc/volatile/", "filesystem"=>"lofs", "options"=>["rstchown", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"domain"=>"puppet.example", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "hostname"=>"solaris-10_u9-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.42", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10_u9", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"10_u9", "major"=>"10", "minor"=>"9"}}, "osfamily"=>"Solaris", "path"=>"/usr/local/bin:/usr/local/sbin:/opt/csw/bin:PATH:/opt/puppetlabs/bin:/usr/local/bin:/usr/local/sbin:/opt/csw/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-10-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>" SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.10", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.10", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"solaris-10_u9-sparc-t4-64", "zones"=>{"solaris-10_u9-sparc-t4-64"=>{"brand"=>"solaris10", "id"=>"36", "ip_type"=>"excl", "path"=>"/", "status"=>"running"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798", "sha256"=>"SSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15"}, "key"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4", "sha256"=>"SSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg==", "sshfp_dsa"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798\nSSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15", "sshfp_rsa"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4\nSSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U=", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1860, "uptime"=>"0:31 hours"}, "timezone"=>"PDT", "uptime"=>"0:31 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1860, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc10_brand"=>"solaris10", "zone_cisparc10_id"=>"36", "zone_cisparc10_iptype"=>"excl", "zone_cisparc10_name"=>"solaris-10_u9-sparc-t4-64", "zone_cisparc10_path"=>"/", "zone_cisparc10_status"=>"running", "zonename"=>"solaris-10_u9-sparc-t4-64", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-10_u9-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'solaris-10_u9-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_solaris-11.2-sparc-64_spec.rb b/.onceover/spec/classes/role__metrics_on_solaris-11.2-sparc-64_spec.rb new file mode 100644 index 0000000..d6d4851 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_solaris-11.2-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set solaris-11.2-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "dhcp_servers"=>{"net0"=>"10.32.22.10", "system"=>"10.32.22.10"}, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-11_2-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.68", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.68", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"11", "kernelrelease"=>"5.11", "kernelversion"=>"11.2", "load_averages"=>{"15m"=>1.0234375, "1m"=>1.21875, "5m"=>1.28125}, "macaddress"=>"02:08:20:41:26:8c", "macaddress_net0"=>"02:08:20:41:26:8c", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"2.34 GiB", "available_bytes"=>-1777401856, "capacity"=>"84.80%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"13.09 GiB", "used_bytes"=>1165664256}}, "memoryfree"=>"2.34 GiB", "memoryfree_mb"=>2400.9375, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.18%", "device"=>"rpool/ROOT/solaris-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017b"], "size"=>"476.16 GiB", "size_bytes"=>175171072, "used"=>"889.53 MiB", "used_bytes"=>932736000}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc", "nozonemod", "sharezone=38", "dev=8e0001c"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=9040027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/dfs/sharetab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"sharefs", "filesystem"=>"sharefs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f40016"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e80027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/export"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017f"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950180"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8dc0026"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950181"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e40027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f00027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/volatile"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004d"], "size"=>"4.53 GiB", "size_bytes"=>572342272, "used"=>"576.00 KiB", "used_bytes"=>589824}, "/tmp"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.95%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004e"], "size"=>"4.58 GiB", "size_bytes"=>618414080, "used"=>"44.50 MiB", "used_bytes"=>46661632}, "/var"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.05%", "device"=>"rpool/ROOT/solaris-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/var", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017d"], "size"=>"475.51 GiB", "size_bytes"=>-521269760, "used"=>"225.35 MiB", "used_bytes"=>236295168}, "/var/share"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017e"], "size"=>"475.30 GiB", "size_bytes"=>-756610048, "used"=>"932.50 KiB", "used_bytes"=>954880}, "/var/share/pkg"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950182"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/var/share/pkg/repositories"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg/repositories", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950183"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"dhcp"=>"10.32.22.10", "domain"=>"puppet.example", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "hostname"=>"solaris-11_2-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.68", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "dhcp"=>"10.32.22.10", "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.2", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"11.2", "major"=>"11", "minor"=>"2"}}, "osfamily"=>"Solaris", "path"=>"PATH:/opt/puppetlabs/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-11-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>"SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.11", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.11", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"cisparc", "zones"=>{"cisparc"=>{"brand"=>"solaris", "id"=>"38", "ip_type"=>"excl", "path"=>"/", "status"=>"running", "uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f", "sha256"=>"SSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607"}, "key"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3", "sha256"=>"SSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA=", "sshfp_dsa"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f\nSSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607", "sshfp_rsa"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3\nSSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw==", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>2, "hours"=>62, "seconds"=>225780, "uptime"=>"2 days"}, "timezone"=>"PDT", "uptime"=>"2 days", "uptime_days"=>2, "uptime_hours"=>62, "uptime_seconds"=>225780, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc_brand"=>"solaris", "zone_cisparc_id"=>"38", "zone_cisparc_iptype"=>"excl", "zone_cisparc_name"=>"cisparc", "zone_cisparc_path"=>"/", "zone_cisparc_status"=>"running", "zone_cisparc_uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782", "zonename"=>"cisparc", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-11_2-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'solaris-11.2-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__metrics_on_windows-10-64_spec.rb b/.onceover/spec/classes/role__metrics_on_windows-10-64_spec.rb new file mode 100644 index 0000000..887d977 --- /dev/null +++ b/.onceover/spec/classes/role__metrics_on_windows-10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::metrics" do + + context "using fact set windows-10-64" do + node_facts = {"puppetversion"=>"6.0.2", "puppet_inventory_metadata"=>{"packages"=>{"collection_enabled"=>false, "last_collection_time"=>"0.0s"}}, "package_provider"=>"windows", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "is_pe"=>false, "platform_symlink_writable"=>false, "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppet_environmentpath"=>"C:/ProgramData/PuppetLabs/code/environments", "puppet_server"=>"pe-puppet.localdomain", "service_provider"=>"windows", "staging_http_get"=>"curl", "common_appdata"=>"C:\\ProgramData", "architecture"=>"x64", "kernel"=>"windows", "virtual"=>"vmware", "is_virtual"=>true, "hardwaremodel"=>"x64", "operatingsystem"=>"windows", "os"=>{"name"=>"windows", "family"=>"windows", "release"=>{"major"=>"10", "full"=>"10"}}, "facterversion"=>"2.5.1", "fqdn"=>"VAGRANT-HB9G3RD", "hostname"=>"VAGRANT-HB9G3RD", "id"=>"vagrant-hb9g3rd\\vagrant", "interfaces"=>"Ethernet0_2", "ipaddress_ethernet0_2"=>"192.168.43.174", "ipaddress6_ethernet0_2"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "macaddress_ethernet0_2"=>"00:0C:29:A3:53:54", "netmask_ethernet0_2"=>"255.255.255.0", "mtu_ethernet0_2"=>0, "ipaddress"=>"192.168.43.174", "ipaddress6"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "kernelmajversion"=>"10.0", "kernelrelease"=>"10.0.17134", "kernelversion"=>"10.0.17134", "macaddress"=>"00:0C:29:A3:53:54", "manufacturer"=>"Phoenix Technologies LTD", "serialnumber"=>"VMware-56 4d 36 2e 2e a4 81 f9-0d 05 ae d0 e5 a3 53 54", "productname"=>"VMware Virtual Platform", "memorysize"=>"4.00 GB", "memoryfree"=>"2.30 GB", "memorysize_mb"=>"4095.49", "memoryfree_mb"=>"2360.00", "netmask"=>"255.255.255.0", "network_ethernet0_2"=>"192.168.43.0", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10", "osfamily"=>"windows", "path"=>"C:\\tools\\ruby24\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files (x86)\\vim\\vim80;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Users\\vagrant\\AppData\\Local\\Microsoft\\WindowsApps;", "physicalprocessorcount"=>4, "processors"=>{"models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "count"=>4, "physicalcount"=>4}, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "ps"=>"tasklist.exe", "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/tools/ruby24/lib/ruby/site_ruby/2.4.0", "rubyversion"=>"2.4.3", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"seconds"=>1113359, "hours"=>309, "days"=>12, "uptime"=>"12 days"}, "timezone"=>"GMT Standard Time", "uptime"=>"12 days", "uptime_days"=>12, "uptime_hours"=>309, "uptime_seconds"=>1113359, "clientcert"=>"vagrant-hb9g3rd.lan.asio", "clientversion"=>"6.0.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::metrics' +$onceover_node = 'windows-10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_AIX-6.1-powerpc_spec.rb b/.onceover/spec/classes/role__node_on_AIX-6.1-powerpc_spec.rb new file mode 100644 index 0000000..68b4435 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_AIX-6.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set AIX-6.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.8.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.5.0", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-61-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.35", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.35", "ipaddress_lo0"=>"127.0.0.1", "kernel"=>"AIX", "kernelmajversion"=>"6100", "kernelrelease"=>"6100-07-04-1216", "kernelversion"=>"6100", "macaddress"=>"66:a4:d9:f8:4a:04", "macaddress_en0"=>"66:a4:d9:f8:4a:04", "memory"=>{"swap"=>{"available"=>"410.43 MiB", "available_bytes"=>430366720, "capacity"=>"19.84%", "total"=>"512.00 MiB", "total_bytes"=>536870912, "used"=>"101.57 MiB", "used_bytes"=>106504192}, "system"=>{"available"=>"10.88 MiB", "available_bytes"=>11403264, "capacity"=>"98.94%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1013.13 MiB", "used_bytes"=>1062338560}}, "memoryfree"=>"10.88 MiB", "memoryfree_mb"=>10.875, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-61-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.35", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"6100", "operatingsystemrelease"=>"6100-07-04-1216", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"6100-07-04-1216", "major"=>"6100"}}, "osfamily"=>"AIX", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppetversion"=>"4.8.1", "ruby"=>{"platform"=>"powerpc-aix6.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix6.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2", "sha256"=>"SSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d", "sha256"=>"SSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY=", "sshfp_dsa"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2\nSSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945", "sshfp_rsa"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d\nSSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch", "swapfree"=>"410.43 MiB", "swapfree_mb"=>410.4296875, "swapsize"=>"512.00 MiB", "swapsize_mb"=>512.0, "system_uptime"=>{"days"=>418, "hours"=>10035, "seconds"=>36127200, "uptime"=>"418 days"}, "timezone"=>"PST", "uptime"=>"418 days", "uptime_days"=>418, "uptime_hours"=>10035, "uptime_seconds"=>36127200, "clientcert"=>"pe-aix-61-se.delivery.puppetlabs.net", "clientversion"=>"4.8.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'AIX-6.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_AIX-7.1-powerpc_spec.rb b/.onceover/spec/classes/role__node_on_AIX-7.1-powerpc_spec.rb new file mode 100644 index 0000000..efc9a20 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_AIX-7.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set AIX-7.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.5.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.2.0", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-71-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.36", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.36", "ipaddress_lo0"=>"127.0.0.1", "is_pe"=>false, "kernel"=>"AIX", "kernelmajversion"=>"7100", "kernelrelease"=>"7100-01-05-1228", "kernelversion"=>"7100", "macaddress"=>"66:a4:dc:28:bf:04", "macaddress_en0"=>"66:a4:dc:28:bf:04", "memory"=>{"swap"=>{"available"=>"1007.14 MiB", "available_bytes"=>1056063488, "capacity"=>"1.65%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"16.86 MiB", "used_bytes"=>17678336}, "system"=>{"available"=>"16.84 MiB", "available_bytes"=>17653760, "capacity"=>"98.36%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1007.16 MiB", "used_bytes"=>1056088064}}, "memoryfree"=>"16.84 MiB", "memoryfree_mb"=>16.8359375, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-71-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.36", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"7100", "operatingsystemrelease"=>"7100-01-05-1228", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"7100-01-05-1228", "major"=>"7100"}}, "osfamily"=>"AIX", "package_provider"=>"aix", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppet_environmentpath"=>"/etc/puppetlabs/code/environments", "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.5.2", "root_home"=>"/root", "ruby"=>{"platform"=>"powerpc-aix7.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix7.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "service_provider"=>"src", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c", "sha256"=>"SSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5", "sha256"=>"SSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y=", "sshfp_dsa"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c\nSSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a", "sshfp_rsa"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5\nSSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB", "swapfree"=>"1007.14 MiB", "swapfree_mb"=>1007.140625, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1024.0, "system_uptime"=>{"days"=>160, "hours"=>3847, "seconds"=>13852500, "uptime"=>"160 days"}, "timezone"=>"PST", "uptime"=>"160 days", "uptime_days"=>160, "uptime_hours"=>3847, "uptime_seconds"=>13852500, "clientcert"=>"pe-aix-71-se.delivery.puppetlabs.net", "clientversion"=>"4.5.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'AIX-7.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Amazon-2018.03_spec.rb b/.onceover/spec/classes/role__node_on_Amazon-2018.03_spec.rb new file mode 100644 index 0000000..f408952 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Amazon-2018.03_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Amazon-2018.03" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"10/16/2017", "bios_vendor"=>"Amazon EC2", "bios_version"=>"1.0", "blockdevice_nvme0n1_model"=>"Amazon Elastic Block Store", "blockdevice_nvme0n1_size"=>8589934592, "blockdevices"=>"nvme0n1", "boardassettag"=>"i-0816d4c53ff8dc6a2", "boardmanufacturer"=>"Amazon EC2", "chassisassettag"=>"Amazon EC2", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"172.31.0.1", "system"=>"172.31.0.1"}, "disks"=>{"nvme0n1"=>{"model"=>"Amazon Elastic Block Store", "size"=>"8.00 GiB", "size_bytes"=>8589934592}}, "dmi"=>{"bios"=>{"release_date"=>"10/16/2017", "vendor"=>"Amazon EC2", "version"=>"1.0"}, "board"=>{"asset_tag"=>"i-0816d4c53ff8dc6a2", "manufacturer"=>"Amazon EC2"}, "chassis"=>{"asset_tag"=>"Amazon EC2", "type"=>"Other"}, "manufacturer"=>"Amazon EC2", "product"=>{"name"=>"t3a.xlarge", "serial_number"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA"}}, "domain"=>"us-west-2.compute.internal", "ec2_metadata"=>{"ami-id"=>"ami-01e24be29428c15b2", "ami-launch-index"=>"0", "ami-manifest-path"=>"(unknown)", "block-device-mapping"=>{"ami"=>"xvda", "root"=>"/dev/xvda"}, "events"=>{"maintenance"=>{"history"=>"[]", "scheduled"=>"[]"}}, "hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "identity-credentials"=>{"ec2"=>{"info"=>"{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2019-05-07T01:03:28Z\",\n \"AccountId\" : \"581165678935\"\n}"}}, "instance-action"=>"none", "instance-id"=>"i-0816d4c53ff8dc6a2", "instance-type"=>"t3a.xlarge", "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "metrics"=>{"vhostmd"=>""}, "network"=>{"interfaces"=>{"macs"=>{"0a:ca:e0:39:c1:f6"=>{"device-number"=>"0", "interface-id"=>"eni-04e7710af3cf1699c", "ipv4-associations"=>{"34.209.204.164"=>"172.31.3.153"}, "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4s"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "owner-id"=>"581165678935", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4s"=>"34.209.204.164", "security-group-ids"=>"sg-05a2c52388c24f3ae", "security-groups"=>"launch-wizard-2", "subnet-id"=>"subnet-3bafc660", "subnet-ipv4-cidr-block"=>"172.31.0.0/20", "vpc-id"=>"vpc-287af44e", "vpc-ipv4-cidr-block"=>"172.31.0.0/16", "vpc-ipv4-cidr-blocks"=>"172.31.0.0/16"}}}}, "placement"=>{"availability-zone"=>"us-west-2c"}, "profile"=>"default-hvm", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4"=>"34.209.204.164", "public-keys"=>{"0"=>{"openssh-key"=>"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDk1QR+MwLPRohIOiWbCC8xjJKFYeCjIh2g2wAKnZFCkPjCG9BD3L4URnszJXdv+5XylfWO1y9O1Z95etjWfObApRZ5Ej22Dz1EExWWRNOKl9QdrEfCACSlc5gbT5rflHd/He9eD5OFRHlMY8fNIApEKdQrlxZgr1/NOusVQggoS/MiszxCl0dob3kz86XX6PrAmMyGfv7j/mPeeEUzP3bGxtjJyaZGcwukjPvlgq1yI4AzZlveY8fnokRsh9uDHXUEVB2hLNaBBZB/Evw261J/+QsnKopAuqQpwct/n/ulbg+w1h/2ZBiDXDBK8DQ8kOC4zuum6qwri1KNKdX9zIif thinkpad"}}, "reservation-id"=>"r-0b89c0e198506ec1f", "security-groups"=>"launch-wizard-2", "services"=>{"domain"=>"amazonaws.com", "partition"=>"aws"}}, "facterversion"=>"3.12.4", "filesystems"=>"ext3,ext4", "fips_enabled"=>false, "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ip-172-31-3-153", "hypervisors"=>{"kvm"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"172.31.3.153", "ipaddress6"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_eth0"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"172.31.3.153", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.14", "kernelrelease"=>"4.14.77-70.59.amzn1.x86_64", "kernelversion"=>"4.14.77", "load_averages"=>{"15m"=>0.02, "1m"=>0.12, "5m"=>0.06}, "macaddress"=>"0a:ca:e0:39:c1:f6", "macaddress_eth0"=>"0a:ca:e0:39:c1:f6", "manufacturer"=>"Amazon EC2", "memory"=>{"system"=>{"available"=>"15.36 GiB", "available_bytes"=>16489611264, "capacity"=>"1.10%", "total"=>"15.53 GiB", "total_bytes"=>16673153024, "used"=>"175.04 MiB", "used_bytes"=>183541760}}, "memoryfree"=>"15.36 GiB", "memoryfree_mb"=>15725.71875, "memorysize"=>"15.53 GiB", "memorysize_mb"=>15900.7578125, "mountpoints"=>{"/"=>{"available"=>"6.55 GiB", "available_bytes"=>7033344000, "capacity"=>"15.45%", "device"=>"/dev/nvme0n1p1", "filesystem"=>"ext4", "options"=>["rw", "noatime", "data=ordered"], "size"=>"7.75 GiB", "size_bytes"=>8318783488, "used"=>"1.20 GiB", "used_bytes"=>1285439488}, "/dev/shm"=>{"available"=>"7.76 GiB", "available_bytes"=>8336576512, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"7.76 GiB", "size_bytes"=>8336576512, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>9001, "mtu_lo"=>65536, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.240.0", "netmask_lo"=>"255.0.0.0", "network"=>"172.31.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"172.31.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"172.31.0.1", "domain"=>"us-west-2.compute.internal", "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "hostname"=>"ip-172-31-3-153", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"172.31.3.153", "netmask"=>"255.255.240.0", "network"=>"172.31.0.0"}], "bindings6"=>[{"address"=>"fe80::8ca:e0ff:fe39:c1f6", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"172.31.0.1", "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"Amazon", "operatingsystemmajrelease"=>"2018", "operatingsystemrelease"=>"2018.03", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"Amazon", "release"=>{"full"=>"2018.03", "major"=>"2018", "minor"=>"03"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/nvme0n1p1"=>{"filesystem"=>"ext4", "label"=>"/", "mount"=>"/", "partlabel"=>"Linux", "partuuid"=>"893c59db-bd86-4d67-b40f-221bc82c14c8", "size"=>"8.00 GiB", "size_bytes"=>8587820544, "uuid"=>"f25f5092-0401-4edb-9fac-c57f3c673803"}, "/dev/nvme0n1p128"=>{"partlabel"=>"BIOS Boot Partition", "partuuid"=>"9d1c14c8-e25b-4405-9171-de3c756f61b2", "size"=>"1.00 MiB", "size_bytes"=>1048576}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin", "physicalprocessorcount"=>1, "processor0"=>"AMD EPYC 7571", "processor1"=>"AMD EPYC 7571", "processor2"=>"AMD EPYC 7571", "processor3"=>"AMD EPYC 7571", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571"], "physicalcount"=>1}, "productname"=>"t3a.xlarge", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>false, "serialnumber"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd", "sha256"=>"SSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f"}, "key"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4", "sha256"=>"SSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc", "sha256"=>"SSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28", "sha256"=>"SSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "sshfp_dsa"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd\nSSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f", "sshfp_ecdsa"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4\nSSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b", "sshfp_ed25519"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc\nSSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f", "sshfp_rsa"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28\nSSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>136, "uptime"=>"0:02 hours"}, "timezone"=>"UTC", "uptime"=>"0:02 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>136, "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA", "virtual"=>"kvm", "clientcert"=>"ip-172-31-3-153.us-west-2.compute.internal", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Amazon-2018.03' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_CentOS-5.11-32_spec.rb b/.onceover/spec/classes/role__node_on_CentOS-5.11-32_spec.rb new file mode 100644 index 0000000..22cdcf3 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_CentOS-5.11-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set CentOS-5.11-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>0, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>0}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:febf:56", "ipaddress6_eth0"=>"fe80::a00:27ff:febf:56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.11, "1m"=>0.28, "5m"=>0.22}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:bf:00:56", "macaddress_eth0"=>"08:00:27:bf:00:56", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"429.48 MiB", "available_bytes"=>450342912, "capacity"=>"14.58%", "total"=>"502.80 MiB", "total_bytes"=>527220736, "used"=>"73.32 MiB", "used_bytes"=>76877824}}, "memoryfree"=>"429.48 MiB", "memoryfree_mb"=>429.48046875, "memorysize"=>"502.80 MiB", "memorysize_mb"=>502.796875, "mountpoints"=>{"/"=>{"available"=>"1.09 GiB", "available_bytes"=>1171632128, "capacity"=>"52.22%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"2.28 GiB", "size_bytes"=>-1842671616, "used"=>"1.19 GiB", "used_bytes"=>1280663552}, "/boot"=>{"available"=>"86.58 MiB", "available_bytes"=>90790912, "capacity"=>"12.29%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.13 MiB", "used_bytes"=>12721152}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f", "sha256"=>"SSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940"}, "key"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5", "sha256"=>"SSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo=", "sshfp_dsa"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f\nSSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940", "sshfp_rsa"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5\nSSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1067, "uptime"=>"0:17 hours"}, "timezone"=>"UTC", "uptime"=>"0:17 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1067, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'CentOS-5.11-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_CentOS-5.11-64_spec.rb b/.onceover/spec/classes/role__node_on_CentOS-5.11-64_spec.rb new file mode 100644 index 0000000..87a71dd --- /dev/null +++ b/.onceover/spec/classes/role__node_on_CentOS-5.11-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set CentOS-5.11-64" do + node_facts = {"architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>21474836480, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>21474836480}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_eth0"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:3e:49:87", "macaddress_eth0"=>"08:00:27:3e:49:87", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"389.45 MiB", "available_bytes"=>408363008, "capacity"=>"21.76%", "total"=>"497.78 MiB", "total_bytes"=>521961472, "used"=>"108.34 MiB", "used_bytes"=>113598464}}, "memoryfree"=>"389.45 MiB", "memoryfree_mb"=>389.4453125, "memorysize"=>"497.78 MiB", "memorysize_mb"=>497.78125, "mountpoints"=>{"/"=>{"available"=>"16.96 GiB", "available_bytes"=>18212638720, "capacity"=>"7.23%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"18.28 GiB", "size_bytes"=>19632164864, "used"=>"1.32 GiB", "used_bytes"=>1419526144}, "/boot"=>{"available"=>"86.04 MiB", "available_bytes"=>90215424, "capacity"=>"12.85%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.68 MiB", "used_bytes"=>13296640}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d", "sha256"=>"SSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7", "sha256"=>"SSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ==", "sshfp_dsa"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d\nSSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb", "sshfp_rsa"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7\nSSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>847, "uptime"=>"0:14 hours"}, "timezone"=>"UTC", "uptime"=>"0:14 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>847, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'CentOS-5.11-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_CentOS-6.6-32_spec.rb b/.onceover/spec/classes/role__node_on_CentOS-6.6-32_spec.rb new file mode 100644 index 0000000..630fcdb --- /dev/null +++ b/.onceover/spec/classes/role__node_on_CentOS-6.6-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set CentOS-6.6-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_eth0"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.el6.i686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:ff:42:e5", "macaddress_eth0"=>"08:00:27:ff:42:e5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.00 GiB", "available_bytes"=>1073737728, "capacity"=>"0%", "total"=>"1.00 GiB", "total_bytes"=>1073737728, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"451.91 MiB", "available_bytes"=>473862144, "capacity"=>"9.40%", "total"=>"498.82 MiB", "total_bytes"=>523051008, "used"=>"46.91 MiB", "used_bytes"=>49188864}}, "memoryfree"=>"451.91 MiB", "memoryfree_mb"=>451.91015625, "memorysize"=>"498.82 MiB", "memorysize_mb"=>498.8203125, "mountpoints"=>{"/"=>{"available"=>"1.02 GiB", "available_bytes"=>1099689984, "capacity"=>"51.05%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"2.09 GiB", "size_bytes"=>-2048442368, "used"=>"1.07 GiB", "used_bytes"=>1146834944}, "/boot"=>{"available"=>"450.39 MiB", "available_bytes"=>472266752, "capacity"=>"5.42%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"25.83 MiB", "used_bytes"=>27088896}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"i386", "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"bc353fb2-82b1-4d41-a43e-6512030a2a28"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"eb19f39e-a1cc-4e43-bf33-809fa7f52044"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"51727e98-6cd5-4fba-8a1f-7d4dfb575e1f"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>-525336576, "uuid"=>"vkG7sJ-bfu3-Cko3-YJ7v-jPys-3uHe-vki0jZ"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe", "sha256"=>"SSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877"}, "key"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8", "sha256"=>"SSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow==", "sshfp_dsa"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe\nSSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877", "sshfp_rsa"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8\nSSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw==", "swapfree"=>"1.00 GiB", "swapfree_mb"=>1023.99609375, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1023.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>430, "uptime"=>"0:07 hours"}, "timezone"=>"UTC", "uptime"=>"0:07 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>430, "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'CentOS-6.6-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_CentOS-6.6-64_spec.rb b/.onceover/spec/classes/role__node_on_CentOS-6.6-64_spec.rb new file mode 100644 index 0000000..a936820 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_CentOS-6.6-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set CentOS-6.6-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos6a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.7", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth0"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth1"=>"fe80::a00:27ff:fe66:988a", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.88", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.7", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.8.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:0f:d2:76", "macaddress_eth0"=>"08:00:27:0f:d2:76", "macaddress_eth1"=>"08:00:27:66:98:8a", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"992.00 MiB", "available_bytes"=>1040183296, "capacity"=>"0%", "total"=>"992.00 MiB", "total_bytes"=>1040183296, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"348.41 MiB", "available_bytes"=>365338624, "capacity"=>"28.95%", "total"=>"490.39 MiB", "total_bytes"=>514215936, "used"=>"141.98 MiB", "used_bytes"=>148877312}}, "memoryfree"=>"348.41 MiB", "memoryfree_mb"=>348.4140625, "memorysize"=>"490.39 MiB", "memorysize_mb"=>490.39453125, "mountpoints"=>{"/"=>{"available"=>"16.94 GiB", "available_bytes"=>18193268736, "capacity"=>"6.51%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"18.12 GiB", "size_bytes"=>19459338240, "used"=>"1.18 GiB", "used_bytes"=>1266069504}, "/boot"=>{"available"=>"448.35 MiB", "available_bytes"=>470125568, "capacity"=>"5.85%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"27.88 MiB", "used_bytes"=>29230080}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8555670, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "hostname"=>"centos6a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.88", "ip6"=>"fe80::a00:27ff:fe66:988a", "mac"=>"08:00:27:66:98:8a", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"a29409f8-0b58-4271-a348-032caefec8b8"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b30b464a-8ac9-492a-a1c5-2da75bb7488a"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"da946872-1406-4ac1-9a4d-f7ce5f7be47e"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"nRdWPh-INkA-aHPs-TNtk-HjJG-SxBU-DdqI8a"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-6-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8", "sha256"=>"SSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745"}, "key"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef", "sha256"=>"SSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg==", "sshfp_dsa"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8\nSSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745", "sshfp_rsa"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef\nSSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ==", "staging_http_get"=>"curl", "swapfree"=>"992.00 MiB", "swapfree_mb"=>991.99609375, "swapsize"=>"992.00 MiB", "swapsize_mb"=>991.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>352, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>352, "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C", "virtual"=>"virtualbox", "clientcert"=>"centos6a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'CentOS-6.6-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_CentOS-7.0-64_spec.rb b/.onceover/spec/classes/role__node_on_CentOS-7.0-64_spec.rb new file mode 100644 index 0000000..17ae9f5 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_CentOS-7.0-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set CentOS-7.0-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"sydney", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "enp0s8"=>"192.168.56.100", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF"}}, "domain"=>"syd.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"xfs", "fqdn"=>"centos7b.syd.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos7b", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,enp0s8,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s3"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s8"=>"fe80::a00:27ff:fe39:832c", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_enp0s8"=>"10.20.1.92", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-123.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.26, "5m"=>0.12}, "macaddress"=>"08:00:27:39:18:3c", "macaddress_enp0s3"=>"08:00:27:39:18:3c", "macaddress_enp0s8"=>"08:00:27:39:83:2c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.03 GiB", "available_bytes"=>1107292160, "capacity"=>"0%", "total"=>"1.03 GiB", "total_bytes"=>1107292160, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"297.76 MiB", "available_bytes"=>312225792, "capacity"=>"39.28%", "total"=>"490.41 MiB", "total_bytes"=>514228224, "used"=>"192.64 MiB", "used_bytes"=>202002432}}, "memoryfree"=>"297.76 MiB", "memoryfree_mb"=>297.76171875, "memorysize"=>"490.41 MiB", "memorysize_mb"=>490.40625, "mountpoints"=>{"/"=>{"available"=>"17.30 GiB", "available_bytes"=>18574749696, "capacity"=>"6.32%", "device"=>"/dev/mapper/centos-root", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"18.47 GiB", "size_bytes"=>19828572160, "used"=>"1.17 GiB", "used_bytes"=>1253822464}, "/boot"=>{"available"=>"393.11 MiB", "available_bytes"=>412209152, "capacity"=>"20.85%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.67 MiB", "size_bytes"=>520794112, "used"=>"103.55 MiB", "used_bytes"=>108584960}}, "mtu_enp0s3"=>1500, "mtu_enp0s8"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8563388, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s8"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_enp0s8"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_enp0s8"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_enp0s8"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"syd.puppetlabs.demo", "fqdn"=>"centos7b.syd.puppetlabs.demo", "hostname"=>"centos7b", "interfaces"=>{"enp0s3"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "enp0s8"=>{"dhcp"=>"192.168.56.100", "ip"=>"10.20.1.92", "ip6"=>"fe80::a00:27ff:fe39:832c", "mac"=>"08:00:27:39:83:2c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.0.1406", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"7.0.1406", "major"=>"7", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/centos-root"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"db651e5f-a2c2-4236-9570-6226f63e1fcd"}, "/dev/mapper/centos-swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"ff4ec16c-28c0-4715-846d-11e7c9b4e53b"}, "/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"39ce4ad1-4e9d-49a4-bce0-8a30b459490a"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"pg7zVv-M3hI-zpjY-eYlZ-06aD-ZRO2-J30GLd"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-7-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb", "sha256"=>"SSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581", "sha256"=>"SSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4=", "sshfp_ecdsa"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb\nSSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba", "sshfp_rsa"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581\nSSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1", "staging_http_get"=>"curl", "swapfree"=>"1.03 GiB", "swapfree_mb"=>1055.99609375, "swapsize"=>"1.03 GiB", "swapsize_mb"=>1055.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>78, "uptime"=>"0:01 hours"}, "timezone"=>"UTC", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>78, "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF", "virtual"=>"virtualbox", "clientcert"=>"centos7b.syd.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'CentOS-7.0-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Debian-6.0.10-32_spec.rb b/.onceover/spec/classes/role__node_on_Debian-6.0.10-32_spec.rb new file mode 100644 index 0000000..a82bedc --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Debian-6.0.10-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Debian-6.0.10-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_eth0"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:ad:dc:1c", "macaddress_eth0"=>"08:00:27:ad:dc:1c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"434.46 MiB", "available_bytes"=>455565312, "capacity"=>"13.56%", "total"=>"502.63 MiB", "total_bytes"=>527040512, "used"=>"68.16 MiB", "used_bytes"=>71475200}}, "memoryfree"=>"434.46 MiB", "memoryfree_mb"=>434.4609375, "memorysize"=>"502.63 MiB", "memorysize_mb"=>502.625, "mountpoints"=>{"/"=>{"available"=>"1.69 GiB", "available_bytes"=>1819041792, "capacity"=>"35.07%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"937.10 MiB", "used_bytes"=>982618112}, "/boot"=>{"available"=>"213.27 MiB", "available_bytes"=>223632384, "capacity"=>"6.35%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"14.45 MiB", "used_bytes"=>15155200}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"092d5625-eb03-443c-953f-006bec7d5476"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"f9e1cf7c-ab54-4949-8e55-290adc8d853f"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"2c798378-1738-426f-a847-c929a507fc73"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"cG2Syv-bT1d-2TyA-Wqgz-33I2-RnTz-jA2LxS"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57", "sha256"=>"SSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09"}, "key"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b", "sha256"=>"SSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g==", "sshfp_dsa"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57\nSSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09", "sshfp_rsa"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b\nSSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1441, "uptime"=>"0:24 hours"}, "timezone"=>"PST", "uptime"=>"0:24 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1441, "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Debian-6.0.10-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Debian-6.0.10-64_spec.rb b/.onceover/spec/classes/role__node_on_Debian-6.0.10-64_spec.rb new file mode 100644 index 0000000..af3c351 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Debian-6.0.10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Debian-6.0.10-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_eth0"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-amd64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:62:fa:69", "macaddress_eth0"=>"08:00:27:62:fa:69", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.43 MiB", "available_bytes"=>401010688, "capacity"=>"23.04%", "total"=>"496.90 MiB", "total_bytes"=>521035776, "used"=>"114.46 MiB", "used_bytes"=>120025088}}, "memoryfree"=>"382.43 MiB", "memoryfree_mb"=>382.43359375, "memorysize"=>"496.90 MiB", "memorysize_mb"=>496.8984375, "mountpoints"=>{"/"=>{"available"=>"17.65 GiB", "available_bytes"=>18949697536, "capacity"=>"5.16%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"984.03 MiB", "used_bytes"=>1031831552}, "/boot"=>{"available"=>"212.24 MiB", "available_bytes"=>222552064, "capacity"=>"6.80%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"15.48 MiB", "used_bytes"=>16235520}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"d2763d16-5203-4625-8733-a6f2ecc94f5a"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b5661448-0339-4ba3-8593-21cc6a049d33"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"415531d6-6955-433f-921e-8f266ab56649"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vGb2LM-M1SP-IynO-OZJV-sYKl-Pcfo-fAFbiz"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f", "sha256"=>"SSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad"}, "key"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2", "sha256"=>"SSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ", "sshfp_dsa"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f\nSSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad", "sshfp_rsa"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2\nSSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1211, "uptime"=>"0:20 hours"}, "timezone"=>"PST", "uptime"=>"0:20 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1211, "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Debian-6.0.10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Debian-7.8-32_spec.rb b/.onceover/spec/classes/role__node_on_Debian-7.8-32_spec.rb new file mode 100644 index 0000000..580ae21 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Debian-7.8-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Debian-7.8-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_eth0"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-686-pae", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:18:59:a5", "macaddress_eth0"=>"08:00:27:18:59:a5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"432.02 MiB", "available_bytes"=>453001216, "capacity"=>"14.00%", "total"=>"502.32 MiB", "total_bytes"=>526725120, "used"=>"70.31 MiB", "used_bytes"=>73723904}}, "memoryfree"=>"432.02 MiB", "memoryfree_mb"=>432.015625, "memorysize"=>"502.32 MiB", "memorysize_mb"=>502.32421875, "mountpoints"=>{"/"=>{"available"=>"1.52 GiB", "available_bytes"=>1633996800, "capacity"=>"41.68%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"1.09 GiB", "used_bytes"=>1167663104}, "/boot"=>{"available"=>"211.24 MiB", "available_bytes"=>221499392, "capacity"=>"7.24%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"16.49 MiB", "used_bytes"=>17288192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c87cb2c9-ffb8-48d1-bc31-024a57d3e44e"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"864df30a-fc50-4a93-8cfd-4624251c1589"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"b8ab8500-a238-4554-8d11-9c194ebba70c"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"NvdPwA-esP3-xUuv-n9OR-Ep7r-kQAr-qyUAzr"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa", "sha256"=>"SSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906"}, "key"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4", "sha256"=>"SSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d", "sha256"=>"SSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA=", "sshfp_dsa"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa\nSSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906", "sshfp_ecdsa"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4\nSSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480", "sshfp_rsa"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d\nSSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>800, "uptime"=>"0:13 hours"}, "timezone"=>"PST", "uptime"=>"0:13 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>800, "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Debian-7.8-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Debian-7.8-64_spec.rb b/.onceover/spec/classes/role__node_on_Debian-7.8-64_spec.rb new file mode 100644 index 0000000..608398c --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Debian-7.8-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Debian-7.8-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_eth0"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-amd64", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:83:ad:56", "macaddress_eth0"=>"08:00:27:83:ad:56", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.02 MiB", "available_bytes"=>400576512, "capacity"=>"23.13%", "total"=>"496.96 MiB", "total_bytes"=>521101312, "used"=>"114.94 MiB", "used_bytes"=>120524800}}, "memoryfree"=>"382.02 MiB", "memoryfree_mb"=>382.01953125, "memorysize"=>"496.96 MiB", "memorysize_mb"=>496.9609375, "mountpoints"=>{"/"=>{"available"=>"17.49 GiB", "available_bytes"=>18781380608, "capacity"=>"6.01%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"1.12 GiB", "used_bytes"=>1200148480}, "/boot"=>{"available"=>"210.36 MiB", "available_bytes"=>220575744, "capacity"=>"7.63%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"17.37 MiB", "used_bytes"=>18211840}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"7b853135-fb91-48ff-a25c-8d34ada8d549"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"486756ce-bdd1-45f4-864d-e4b6fce59b9d"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"8aa50802-2811-43ec-9686-a30f6a1c3ade"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"eGBBBU-DZw3-wy0f-OMxw-Sf5d-jDyA-ctqcpx"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac", "sha256"=>"SSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a", "sha256"=>"SSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37", "sha256"=>"SSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI=", "sshfp_dsa"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac\nSSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144", "sshfp_ecdsa"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a\nSSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6", "sshfp_rsa"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37\nSSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>650, "uptime"=>"0:10 hours"}, "timezone"=>"PST", "uptime"=>"0:10 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>650, "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Debian-7.8-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_RHEL-6.7_spec.rb b/.onceover/spec/classes/role__node_on_RHEL-6.7_spec.rb new file mode 100644 index 0000000..8363b28 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_RHEL-6.7_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set RHEL-6.7" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"sr0,sdb,sda", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-9727-3914-2228-1494-64", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-9727-3914-2228-1494-64"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0016-4348-2410-5386-3288-39", "uuid"=>"723914E4-94CB-0743-9847-001D218884D8"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext4,iso9660,udf", "fips_enabled"=>false, "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel6box", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.5", "ipaddress6"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_eth0"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.5", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-573.45.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.06, "1m"=>0.15, "5m"=>0.14}, "lsbdistcodename"=>"Santiago", "lsbdistdescription"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "lsbdistid"=>"RedHatEnterpriseServer", "lsbdistrelease"=>"6.7", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"7", "lsbrelease"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch", "macaddress"=>"00:0d:3a:96:ed:47", "macaddress_eth0"=>"00:0d:3a:96:ed:47", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.55 GiB", "available_bytes"=>8103010304, "capacity"=>"3.24%", "total"=>"7.80 GiB", "total_bytes"=>8374747136, "used"=>"259.15 MiB", "used_bytes"=>271736832}}, "memoryfree"=>"7.55 GiB", "memoryfree_mb"=>7727.6328125, "memorysize"=>"7.80 GiB", "memorysize_mb"=>7986.78125, "mountpoints"=>{"/"=>{"available"=>"27.90 GiB", "available_bytes"=>29956210688, "capacity"=>"9.68%", "device"=>"/dev/sda2", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"30.89 GiB", "size_bytes"=>33168420864, "used"=>"2.99 GiB", "used_bytes"=>3212210176}, "/boot"=>{"available"=>"402.87 MiB", "available_bytes"=>422435840, "capacity"=>"15.40%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"73.36 MiB", "used_bytes"=>76919808}, "/dev/shm"=>{"available"=>"3.90 GiB", "available_bytes"=>4187373568, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "rootcontext=\"system_u:object_r:tmpfs_t:s0\""], "size"=>"3.90 GiB", "size_bytes"=>4187373568, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506543104, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"49.09 GiB", "size_bytes"=>52708372480, "used"=>"2.05 GiB", "used_bytes"=>2201829376}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel6box", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.5", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe96:ed47", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.7", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Santiago", "description"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "id"=>"RedHatEnterpriseServer", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "specification"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "selinux"=>{"config_mode"=>"enforcing", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"24"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"ce2ad98e-bb9f-4603-abce-3db7fd857a6c"}, "/dev/sda2"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"be4cc18d-b110-4914-a6f9-52dc0dc66f68"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"aafc7ffe-f0b2-4872-8174-a05f24f6c3d4"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"24", "serialnumber"=>"0000-0016-4348-2410-5386-3288-39", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce", "sha256"=>"SSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd"}, "key"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "type"=>"ssh-dss"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d", "sha256"=>"SSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "sshfp_dsa"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce\nSSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd", "sshfp_rsa"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d\nSSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>239, "uptime"=>"0:03 hours"}, "timezone"=>"EDT", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>239, "uuid"=>"723914E4-94CB-0743-9847-001D218884D8", "virtual"=>"hyperv", "clientcert"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'RHEL-6.7' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_RHEL-7.4_spec.rb b/.onceover/spec/classes/role__node_on_RHEL-7.4_spec.rb new file mode 100644 index 0000000..b1541c5 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_RHEL-7.4_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set RHEL-7.4" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_fd0_size"=>4096, "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"fd0,sda,sdb,sr0", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-6006-7746-5828-7871-43", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"fd0"=>{"size"=>"4.00 KiB", "size_bytes"=>4096}, "sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-6006-7746-5828-7871-43"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0017-8302-7891-2115-8198-39", "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext2,ext3,ext4,udf,xfs", "fips_enabled"=>false, "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel7test", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.6", "ipaddress6"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_eth0"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.6", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-693.46.1.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.08, "1m"=>0.32, "5m"=>0.19}, "macaddress"=>"00:0d:3a:90:57:80", "macaddress_eth0"=>"00:0d:3a:90:57:80", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.42 GiB", "available_bytes"=>7963906048, "capacity"=>"4.67%", "total"=>"7.78 GiB", "total_bytes"=>8353742848, "used"=>"371.78 MiB", "used_bytes"=>389836800}}, "memoryfree"=>"7.42 GiB", "memoryfree_mb"=>7594.97265625, "memorysize"=>"7.78 GiB", "memorysize_mb"=>7966.75, "mountpoints"=>{"/"=>{"available"=>"29.95 GiB", "available_bytes"=>32156790784, "capacity"=>"4.91%", "device"=>"/dev/sda2", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"31.50 GiB", "size_bytes"=>33817882624, "used"=>"1.55 GiB", "used_bytes"=>1661091840}, "/boot"=>{"available"=>"393.75 MiB", "available_bytes"=>412880896, "capacity"=>"20.72%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.66 MiB", "size_bytes"=>520785920, "used"=>"102.91 MiB", "used_bytes"=>107905024}, "/dev/shm"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506170368, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw", "seclabel", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52708212736, "used"=>"2.05 GiB", "used_bytes"=>2202042368}, "/run"=>{"available"=>"3.88 GiB", "available_bytes"=>4168146944, "capacity"=>"0.21%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"8.32 MiB", "used_bytes"=>8724480}, "/run/user/1000"=>{"available"=>"796.68 MiB", "available_bytes"=>835375104, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "relatime", "size=815796k", "mode=700", "uid=1000", "gid=1000"], "size"=>"796.68 MiB", "size_bytes"=>835375104, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "seclabel", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel7test", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.6", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe90:5780", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.4", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"7.4", "major"=>"7", "minor"=>"4"}, "selinux"=>{"config_mode"=>"enforcing", "config_policy"=>"targeted", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"28"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"b3f65ad5-0571-4ae4-937a-13ef2fda43e3"}, "/dev/sda2"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"e9643aa4-b339-43c4-afc5-fcac22af1584"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"07908b37-1661-4130-9d5a-e1fdb0a4bdb2"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_config_policy"=>"targeted", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"28", "serialnumber"=>"0000-0017-8302-7891-2115-8198-39", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7", "sha256"=>"SSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929", "sha256"=>"SSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a", "sha256"=>"SSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "type"=>"ssh-rsa"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "sshfp_ecdsa"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7\nSSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2", "sshfp_ed25519"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929\nSSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282", "sshfp_rsa"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a\nSSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>215, "uptime"=>"0:03 hours"}, "timezone"=>"UTC", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>215, "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7", "virtual"=>"hyperv", "clientcert"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'RHEL-7.4' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_SLES-11.3-64_spec.rb b/.onceover/spec/classes/role__node_on_SLES-11.3-64_spec.rb new file mode 100644 index 0000000..dca7a80 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_SLES-11.3-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set SLES-11.3-64" do + node_facts = {"aio_agent_version"=>"1.8.3", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D"}}, "domain"=>"lan.asio", "facterversion"=>"3.5.1", "filesystems"=>"ext3,iso9660,squashfs", "fqdn"=>"sles11-sp3.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles11-sp3", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe48:617f", "ipaddress6_eth0"=>"fe80::216:3eff:fe48:617f", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.0", "kernelrelease"=>"3.0.101-0.47.67-default", "kernelversion"=>"3.0.101", "load_averages"=>{"15m"=>0.06, "1m"=>0.18, "5m"=>0.08}, "macaddress"=>"00:16:3e:48:61:7f", "macaddress_eth0"=>"00:16:3e:48:61:7f", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"354.30 MiB", "available_bytes"=>371511296, "capacity"=>"27.78%", "total"=>"490.61 MiB", "total_bytes"=>514437120, "used"=>"136.30 MiB", "used_bytes"=>142925824}}, "memoryfree"=>"354.30 MiB", "memoryfree_mb"=>354.30078125, "memorysize"=>"490.61 MiB", "memorysize_mb"=>490.60546875, "mountpoints"=>{"/"=>{"available"=>"47.14 GiB", "available_bytes"=>50611761152, "capacity"=>"4.22%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=continue", "barrier=1", "data=ordered"], "size"=>"49.21 GiB", "size_bytes"=>52843638784, "used"=>"2.08 GiB", "used_bytes"=>2231877632}, "/dev/shm"=>{"available"=>"245.29 MiB", "available_bytes"=>257208320, "capacity"=>"0.00%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"245.30 MiB", "size_bytes"=>257216512, "used"=>"8.00 KiB", "used_bytes"=>8192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"lan.asio", "fqdn"=>"sles11-sp3.lan.asio", "hostname"=>"sles11-sp3", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe48:617f", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, {"address"=>"127.0.0.2", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.3", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"11.3", "major"=>"11", "minor"=>"3"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"586adc21-9cfc-4e12-93e6-c711ab2400b1"}}, "path"=>"/usr/bin:/bin:/usr/sbin:/sbin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.8.2", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5", "sha256"=>"SSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11"}, "key"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17", "sha256"=>"SSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41", "sha256"=>"SSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY=", "sshfp_dsa"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5\nSSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11", "sshfp_ecdsa"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17\nSSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e", "sshfp_rsa"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41\nSSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>524, "uptime"=>"0:08 hours"}, "timezone"=>"UTC", "uptime"=>"0:08 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>524, "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D", "virtual"=>"virtualbox", "clientcert"=>"sles11-sp3.lan.asio", "clientversion"=>"4.8.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'SLES-11.3-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_SLES-12.1-64_spec.rb b/.onceover/spec/classes/role__node_on_SLES-12.1-64_spec.rb new file mode 100644 index 0000000..fab4975 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_SLES-12.1-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set SLES-12.1-64" do + node_facts = {"aio_agent_build"=>"1.7.2", "aio_agent_version"=>"1.7.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E"}}, "domain"=>"openstack.site", "facterversion"=>"3.4.2", "filesystems"=>"ext2,ext3,ext4", "fqdn"=>"sles12-sp1.openstack.site", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles12-sp1", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth0"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth1"=>"fe80::a00:27ff:fe60:90e", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"192.168.33.15", "ipaddress_lo"=>"127.0.0.1", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.12", "kernelrelease"=>"3.12.62-60.64.8-default", "kernelversion"=>"3.12.62", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.02}, "macaddress"=>"00:16:3e:72:f1:21", "macaddress_eth0"=>"00:16:3e:72:f1:21", "macaddress_eth1"=>"08:00:27:60:09:0e", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.78 GiB", "available_bytes"=>1907027968, "capacity"=>"68.84%", "total"=>"5.70 GiB", "total_bytes"=>6119927808, "used"=>"3.92 GiB", "used_bytes"=>4212899840}}, "memoryfree"=>"1.78 GiB", "memoryfree_mb"=>1818.68359375, "memorysize"=>"5.70 GiB", "memorysize_mb"=>5836.41796875, "mountpoints"=>{"/"=>{"available"=>"45.34 GiB", "available_bytes"=>48682504192, "capacity"=>"7.64%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52709421056, "used"=>"3.75 GiB", "used_bytes"=>4026916864}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"192.168.33.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"openstack.site", "fqdn"=>"sles12-sp1.openstack.site", "hostname"=>"sles12-sp1", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe72:f121", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"bindings"=>[{"address"=>"192.168.33.15", "netmask"=>"255.255.255.0", "network"=>"192.168.33.0"}], "bindings6"=>[{"address"=>"fe80::a00:27ff:fe60:90e", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"192.168.33.15", "ip6"=>"fe80::a00:27ff:fe60:90e", "mac"=>"08:00:27:60:09:0e", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"192.168.33.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"12", "operatingsystemrelease"=>"12.1", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"12.1", "major"=>"12", "minor"=>"1"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "label"=>"ROOT", "mount"=>"/", "partuuid"=>"3d2745bf-01", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"dcf2494f-2b02-466b-aa2c-9e7c01bdbdd7"}}, "path"=>"/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/games", "pe_build"=>"2016.4.3", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_server_version"=>"2016.4.3", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"sles-12-x86_64", "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppetversion"=>"4.7.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1", "sha256"=>"SSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b", "sha256"=>"SSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459", "sha256"=>"SSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51", "sha256"=>"SSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx", "sshfp_dsa"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1\nSSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5", "sshfp_ecdsa"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b\nSSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd", "sshfp_ed25519"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459\nSSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf", "sshfp_rsa"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51\nSSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/", "staging_http_get"=>"curl", "system_uptime"=>{"days"=>1, "hours"=>41, "seconds"=>148058, "uptime"=>"1 day"}, "timezone"=>"UTC", "uptime"=>"1 day", "uptime_days"=>1, "uptime_hours"=>41, "uptime_seconds"=>148058, "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E", "virtual"=>"virtualbox", "clientcert"=>"sles12-sp1.openstack.site", "clientversion"=>"4.7.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'SLES-12.1-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Ubuntu-12.04-32_spec.rb b/.onceover/spec/classes/role__node_on_Ubuntu-12.04-32_spec.rb new file mode 100644 index 0000000..b225c33 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Ubuntu-12.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Ubuntu-12.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_eth0"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.23, "5m"=>0.09}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:8d:61:88", "macaddress_eth0"=>"08:00:27:8d:61:88", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"407.73 MiB", "available_bytes"=>427540480, "capacity"=>"17.64%", "total"=>"495.05 MiB", "total_bytes"=>519102464, "used"=>"87.32 MiB", "used_bytes"=>91561984}}, "memoryfree"=>"407.73 MiB", "memoryfree_mb"=>407.734375, "memorysize"=>"495.05 MiB", "memorysize_mb"=>495.0546875, "mountpoints"=>{"/"=>{"available"=>"1.81 GiB", "available_bytes"=>1940865024, "capacity"=>"36.14%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.02 GiB", "used_bytes"=>1098407936}, "/boot"=>{"available"=>"203.56 MiB", "available_bytes"=>213447680, "capacity"=>"13.50%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"31.76 MiB", "used_bytes"=>33307648}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"3fff8935-622f-4e9a-944f-38108c71af34"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"185fbdf2-880c-4aa6-ada8-8dade7aa3fc6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"31f2e84f-0e99-4531-9ecb-2b151fc6ce31"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"S8Vl05-TIfO-rk5Y-gIDu-TIwj-L8Ub-3OjoJb"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b", "sha256"=>"SSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0"}, "key"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21", "sha256"=>"SSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f", "sha256"=>"SSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0=", "sshfp_dsa"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b\nSSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0", "sshfp_ecdsa"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21\nSSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668", "sshfp_rsa"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f\nSSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>60, "uptime"=>"0:01 hours"}, "timezone"=>"PST", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>60, "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Ubuntu-12.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Ubuntu-12.04-64_spec.rb b/.onceover/spec/classes/role__node_on_Ubuntu-12.04-64_spec.rb new file mode 100644 index 0000000..2917803 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Ubuntu-12.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Ubuntu-12.04-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_eth0"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:5f:df:27", "macaddress_eth0"=>"08:00:27:5f:df:27", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"350.97 MiB", "available_bytes"=>368017408, "capacity"=>"28.33%", "total"=>"489.72 MiB", "total_bytes"=>513507328, "used"=>"138.75 MiB", "used_bytes"=>145489920}}, "memoryfree"=>"350.97 MiB", "memoryfree_mb"=>350.96875, "memorysize"=>"489.72 MiB", "memorysize_mb"=>489.71875, "mountpoints"=>{"/"=>{"available"=>"17.68 GiB", "available_bytes"=>18981703680, "capacity"=>"6.12%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.15 GiB", "used_bytes"=>1237438464}, "/boot"=>{"available"=>"202.55 MiB", "available_bytes"=>212389888, "capacity"=>"13.93%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"32.77 MiB", "used_bytes"=>34365440}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"96092a10-847b-4a55-b5dc-87d2cc56ee5e"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"50695407-158d-4b0e-975a-b575fa5f5359"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"829f03e2-ceb8-4f8d-9f32-e1336456f719"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"P6GCnD-xaHj-APeE-m1Em-fr5a-z3Kk-iFVziN"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630", "sha256"=>"SSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420", "sha256"=>"SSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740", "sha256"=>"SSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q=", "sshfp_dsa"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630\nSSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f", "sshfp_ecdsa"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420\nSSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00", "sshfp_rsa"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740\nSSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>368, "uptime"=>"0:06 hours"}, "timezone"=>"PST", "uptime"=>"0:06 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>368, "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Ubuntu-12.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Ubuntu-14.04-32_spec.rb b/.onceover/spec/classes/role__node_on_Ubuntu-14.04-32_spec.rb new file mode 100644 index 0000000..fe599ad --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Ubuntu-14.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Ubuntu-14.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_eth0"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.07}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:71:89:45", "macaddress_eth0"=>"08:00:27:71:89:45", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"414.97 MiB", "available_bytes"=>435126272, "capacity"=>"16.34%", "total"=>"496.04 MiB", "total_bytes"=>520130560, "used"=>"81.07 MiB", "used_bytes"=>85004288}}, "memoryfree"=>"414.97 MiB", "memoryfree_mb"=>414.96875, "memorysize"=>"496.04 MiB", "memorysize_mb"=>496.03515625, "mountpoints"=>{"/"=>{"available"=>"1.72 GiB", "available_bytes"=>1846272000, "capacity"=>"39.25%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.11 GiB", "used_bytes"=>1193000960}, "/boot"=>{"available"=>"200.06 MiB", "available_bytes"=>209779712, "capacity"=>"14.98%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"35.26 MiB", "used_bytes"=>36975616}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b31f5de0-8805-43da-b3f2-da9e51c3401b"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"569bc4ac-b4e8-4e62-8503-551a63285383"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"f00f661b-b4b5-4e6f-bba3-3dcacf85fd8e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"vF1RtV-BHmi-b0UW-QR1z-tJ48-g6Tn-aGgEn7"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf", "sha256"=>"SSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1", "sha256"=>"SSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7", "sha256"=>"SSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae", "sha256"=>"SSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq", "sshfp_dsa"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf\nSSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375", "sshfp_ecdsa"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1\nSSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474", "sshfp_ed25519"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7\nSSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d", "sshfp_rsa"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae\nSSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>354, "uptime"=>"0:05 hours"}, "timezone"=>"PST", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>354, "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Ubuntu-14.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Ubuntu-14.04-64_spec.rb b/.onceover/spec/classes/role__node_on_Ubuntu-14.04-64_spec.rb new file mode 100644 index 0000000..b96630b --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Ubuntu-14.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Ubuntu-14.04-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"ubuntu1404a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth0"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth1"=>"fe80::a00:27ff:fe61:1916", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.93", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.06, "1m"=>0.49, "5m"=>0.17}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:ea:20:27", "macaddress_eth0"=>"08:00:27:ea:20:27", "macaddress_eth1"=>"08:00:27:61:19:16", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"331.30 MiB", "available_bytes"=>347394048, "capacity"=>"32.35%", "total"=>"489.74 MiB", "total_bytes"=>513531904, "used"=>"158.44 MiB", "used_bytes"=>166137856}}, "memoryfree"=>"331.30 MiB", "memoryfree_mb"=>331.30078125, "memorysize"=>"489.74 MiB", "memorysize_mb"=>489.7421875, "mountpoints"=>{"/"=>{"available"=>"17.58 GiB", "available_bytes"=>18880684032, "capacity"=>"6.62%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.25 GiB", "used_bytes"=>1338458112}, "/boot"=>{"available"=>"198.65 MiB", "available_bytes"=>208301056, "capacity"=>"15.58%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"36.67 MiB", "used_bytes"=>38454272}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8608807, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "hostname"=>"ubuntu1404a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.93", "ip6"=>"fe80::a00:27ff:fe61:1916", "mac"=>"08:00:27:61:19:16", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c94f234c-f947-450d-aaaf-d32be1b7f27f"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"5501b007-e44b-46cf-b22b-177428cbe5d6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"3a97a5b0-ebd0-4ce6-ba62-d39b4fd0719e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vgfiUo-lVmS-57wx-qv4m-N3fR-efa0-iBI6Cn"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"ubuntu-14.04-amd64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c", "sha256"=>"SSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad", "sha256"=>"SSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234", "sha256"=>"SSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51", "sha256"=>"SSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP", "sshfp_dsa"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c\nSSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4", "sshfp_ecdsa"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad\nSSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8", "sshfp_ed25519"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234\nSSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05", "sshfp_rsa"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51\nSSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv", "staging_http_get"=>"curl", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>47, "uptime"=>"0:00 hours"}, "timezone"=>"PDT", "uptime"=>"0:00 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>47, "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115", "virtual"=>"virtualbox", "clientcert"=>"ubuntu1404a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Ubuntu-14.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Ubuntu-18.04-64_spec.rb b/.onceover/spec/classes/role__node_on_Ubuntu-18.04-64_spec.rb new file mode 100644 index 0000000..90c9214 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Ubuntu-18.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Ubuntu-18.04-64" do + node_facts = {"aio_agent_version"=>"6.14.0", "architecture"=>"amd64", "augeas"=>{"version"=>"1.12.0"}, "augeasversion"=>"1.12.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>10737418240, "blockdevice_sda_vendor"=>"VBOX", "blockdevice_sdb_model"=>"HARDDISK", "blockdevice_sdb_size"=>10485760, "blockdevice_sdb_vendor"=>"VBOX", "blockdevices"=>"sdb,sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"10.00 GiB", "size_bytes"=>10737418240, "vendor"=>"VBOX"}, "sdb"=>{"model"=>"HARDDISK", "size"=>"10.00 MiB", "size_bytes"=>10485760, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3"}}, "domain"=>"lan.asio", "facterversion"=>"3.14.9", "filesystems"=>"btrfs,ext2,ext3,ext4,iso9660,squashfs,vfat", "fips_enabled"=>false, "fqdn"=>"ubuntu-bionic.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ubuntu-bionic", "hypervisors"=>{"virtualbox"=>{"revision"=>"133895", "version"=>"6.0.14"}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_enp0s3"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.15", "kernelrelease"=>"4.15.0-54-generic", "kernelversion"=>"4.15.0", "load_averages"=>{"15m"=>0.1, "1m"=>0.31, "5m"=>0.23}, "lsbdistcodename"=>"bionic", "lsbdistdescription"=>"Ubuntu 18.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"18.04", "lsbmajdistrelease"=>"18.04", "macaddress"=>"02:bb:7d:e8:e9:23", "macaddress_enp0s3"=>"02:bb:7d:e8:e9:23", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"776.53 MiB", "available_bytes"=>814247936, "capacity"=>"21.19%", "total"=>"985.26 MiB", "total_bytes"=>1033121792, "used"=>"208.73 MiB", "used_bytes"=>218873856}}, "memoryfree"=>"776.53 MiB", "memoryfree_mb"=>776.52734375, "memorysize"=>"985.26 MiB", "memorysize_mb"=>985.26171875, "mountpoints"=>{"/"=>{"available"=>"8.14 GiB", "available_bytes"=>8742756352, "capacity"=>"15.32%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw", "relatime", "data=ordered"], "size"=>"9.63 GiB", "size_bytes"=>10340794368, "used"=>"1.47 GiB", "used_bytes"=>1581260800}, "/dev"=>{"available"=>"480.22 MiB", "available_bytes"=>503545856, "capacity"=>"0%", "device"=>"udev", "filesystem"=>"devtmpfs", "options"=>["rw", "nosuid", "relatime", "size=491744k", "nr_inodes=122936", "mode=755"], "size"=>"480.22 MiB", "size_bytes"=>503545856, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/hugepages"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"hugetlbfs", "filesystem"=>"hugetlbfs", "options"=>["rw", "relatime", "pagesize=2M"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/mqueue"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mqueue", "filesystem"=>"mqueue", "options"=>["rw", "relatime"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/pts"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"devpts", "filesystem"=>"devpts", "options"=>["rw", "nosuid", "noexec", "relatime", "gid=5", "mode=620", "ptmxmode=000"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/shm"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/run"=>{"available"=>"97.93 MiB", "available_bytes"=>102690816, "capacity"=>"0.60%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "noexec", "relatime", "size=100892k", "mode=755"], "size"=>"98.53 MiB", "size_bytes"=>103313408, "used"=>"608.00 KiB", "used_bytes"=>622592}, "/run/lock"=>{"available"=>"5.00 MiB", "available_bytes"=>5242880, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "noexec", "relatime", "size=5120k"], "size"=>"5.00 MiB", "size_bytes"=>5242880, "used"=>"0 bytes", "used_bytes"=>0}, "/run/user/1000"=>{"available"=>"98.52 MiB", "available_bytes"=>103309312, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "relatime", "size=100888k", "mode=700", "uid=1000", "gid=1000"], "size"=>"98.52 MiB", "size_bytes"=>103309312, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/vagrant"=>{"available"=>"122.93 GiB", "available_bytes"=>131996221440, "capacity"=>"85.01%", "device"=>"vagrant", "filesystem"=>"vboxsf", "options"=>["rw", "nodev", "relatime", "iocharset=utf8", "uid=1000", "gid=1000"], "size"=>"820.33 GiB", "size_bytes"=>880824786944, "used"=>"697.40 GiB", "used_bytes"=>748828565504}, "/var/lib/lxcfs"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"lxcfs", "filesystem"=>"fuse.lxcfs", "options"=>["rw", "nosuid", "nodev", "relatime", "user_id=0", "group_id=0", "allow_other"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_enp0s3"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"lan.asio", "fqdn"=>"ubuntu-bionic.lan.asio", "hostname"=>"ubuntu-bionic", "interfaces"=>{"enp0s3"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::bb:7dff:fee8:e923", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "scope6"=>"link"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1", "scope6"=>"host"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"enp0s3", "scope6"=>"link"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"18.04", "operatingsystemrelease"=>"18.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"bionic", "description"=>"Ubuntu 18.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "label"=>"cloudimg-rootfs", "mount"=>"/", "partuuid"=>"654c6dc7-01", "size"=>"10.00 GiB", "size_bytes"=>10736352768, "uuid"=>"8de716dd-d9b2-477f-b818-bb0b1eb036ce"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"6.14.0", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.7"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.7", "scope6"=>"link", "scope6_enp0s3"=>"link", "scope6_lo"=>"host", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c", "sha256"=>"SSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9", "sha256"=>"SSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f", "sha256"=>"SSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622", "sha256"=>"SSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "sshfp_dsa"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c\nSSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656", "sshfp_ecdsa"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9\nSSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99", "sshfp_ed25519"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f\nSSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4", "sshfp_rsa"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622\nSSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>336, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>336, "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3", "virtual"=>"virtualbox", "clientcert"=>"ubuntu-bionic.lan.asio", "clientversion"=>"6.14.0", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Ubuntu-18.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Windows_Server-2008r2-64_spec.rb b/.onceover/spec/classes/role__node_on_Windows_Server-2008r2-64_spec.rb new file mode 100644 index 0000000..8f7a781 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Windows_Server-2008r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Windows_Server-2008r2-64" do + node_facts = {"agent_specified_environment"=>"production", "aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x64", "common_appdata"=>"C:\\ProgramData", "concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"Local Area Connection"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "domain"=>"pdx.puppetlabs.demo", "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.0.2", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"server2008r2a", "id"=>"SERVER2008R2A\\vagrant", "identity"=>{"user"=>"SERVER2008R2A\\vagrant"}, "iis_version"=>"Get-ItemProperty : Cannot find path 'HKLM:\\SOFTWARE\\Microsoft\\InetStp\\' because it does not exist.\nAt line:1 char:18\n+ (Get-ItemProperty <<<< HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString(8,3)\n + CategoryInfo : ObjectNotFound: (HKLM:\\SOFTWARE\\Microsoft\\InetStp\\:String) [Get-ItemProperty], ItemNotFo \n undException\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\n \nYou cannot call a method on a null-valued expression.\nAt line:1 char:97\n+ (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString <<<< (8,3)\n + CategoryInfo : InvalidOperation: (SubString:String) [], RuntimeException\n + FullyQualifiedErrorId : InvokeMethodOnNull\n \n", "interfaces"=>"Local Area Connection 2,Local Area Connection", "ipaddress"=>"10.20.1.101", "ipaddress6"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress6_Local Area Connection"=>"fe80::50f8:86eb:f103:75b%12", "ipaddress6_Local Area Connection 2"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress_Local Area Connection"=>"10.0.2.15", "ipaddress_Local Area Connection 2"=>"10.20.1.101", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.1", "kernelrelease"=>"6.1.7600", "kernelversion"=>"6.1.7600", "macaddress"=>"08:00:27:7B:C7:40", "macaddress_Local Area Connection"=>"08:00:27:AB:52:FB", "macaddress_Local Area Connection 2"=>"08:00:27:7B:C7:40", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"448.14 MiB", "available_bytes"=>469909504, "capacity"=>"56.22%", "total"=>"1023.55 MiB", "total_bytes"=>1073274880, "used"=>"575.41 MiB", "used_bytes"=>603365376}}, "memoryfree"=>"448.14 MiB", "memoryfree_mb"=>448.140625, "memorysize"=>"1023.55 MiB", "memorysize_mb"=>1023.5546875, "mtu_Local Area Connection"=>1500, "mtu_Local Area Connection 2"=>1500, "mysql_server_id"=>8583088, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection 2"=>"ffff:ffff:ffff:ffff::", "netmask_Local Area Connection"=>"255.255.255.0", "netmask_Local Area Connection 2"=>"255.255.255.0", "network"=>"10.20.1.0", "network6"=>"fe80::%13", "network6_Local Area Connection"=>"fe80::%12", "network6_Local Area Connection 2"=>"fe80::%13", "network_Local Area Connection"=>"10.0.2.0", "network_Local Area Connection 2"=>"10.20.1.0", "networking"=>{"domain"=>"pdx.puppetlabs.demo", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hostname"=>"server2008r2a", "interfaces"=>{"Local Area Connection"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::50f8:86eb:f103:75b%12", "mac"=>"08:00:27:AB:52:FB", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}, "Local Area Connection 2"=>{"ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}}, "ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2008 R2", "operatingsystemrelease"=>"2008 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2008 R2", "major"=>"2008 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\ProgramData\\chocolatey\\bin;", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>false, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "serialnumber"=>"0", "staging_http_get"=>"powershell", "staging_windir"=>"C:\\ProgramData\\staging", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>266, "uptime"=>"0:04 hours"}, "timezone"=>"Pacific Daylight Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>266, "virtual"=>"virtualbox", "clientcert"=>"server2008r2a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Windows_Server-2008r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_Windows_Server-2012r2-64_spec.rb b/.onceover/spec/classes/role__node_on_Windows_Server-2012r2-64_spec.rb new file mode 100644 index 0000000..79c3275 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_Windows_Server-2012r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set Windows_Server-2012r2-64" do + node_facts = {"agent_specified_environment"=>"production", "architecture"=>"x64", "dhcp_servers"=>{"Ethernet"=>"10.0.2.2", "system"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.1.1", "fqdn"=>"WIN-E5K8TM30719", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"WIN-E5K8TM30719", "id"=>"WIN-E5K8TM30719\\vagrant", "identity"=>{"user"=>"WIN-E5K8TM30719\\vagrant"}, "interfaces"=>"Ethernet", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress6_Ethernet"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress_Ethernet"=>"10.0.2.15", "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.3", "kernelrelease"=>"6.3.9600", "kernelversion"=>"6.3.9600", "macaddress"=>"08:00:27:81:38:FA", "macaddress_Ethernet"=>"08:00:27:81:38:FA", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.42 GiB", "available_bytes"=>1521610752, "capacity"=>"29.13%", "total"=>"2.00 GiB", "total_bytes"=>2147012608, "used"=>"596.43 MiB", "used_bytes"=>625401856}}, "memoryfree"=>"1.42 GiB", "memoryfree_mb"=>1451.12109375, "memorysize"=>"2.00 GiB", "memorysize_mb"=>2047.55078125, "mtu_Ethernet"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Ethernet"=>"ffff:ffff:ffff:ffff::", "netmask_Ethernet"=>"255.255.255.0", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "network6_Ethernet"=>"fe80::%12", "network_Ethernet"=>"10.0.2.0", "networking"=>{"dhcp"=>"10.0.2.2", "fqdn"=>"WIN-E5K8TM30719", "hostname"=>"WIN-E5K8TM30719", "interfaces"=>{"Ethernet"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::a180:36e0:3a6e:1005%12", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::%12"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "primary"=>"Ethernet"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2012 R2", "operatingsystemrelease"=>"2012 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2012 R2", "major"=>"2012 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Git\\cmd;C:\\Program Files (x86)\\Git\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.3", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.7"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.7", "serialnumber"=>"0", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>287, "uptime"=>"0:04 hours"}, "timezone"=>"Coordinated Universal Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>287, "virtual"=>"virtualbox", "clientcert"=>"win-e5k8tm30719", "clientversion"=>"4.2.3", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'Windows_Server-2012r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_solaris-10_u9-sparc-64_spec.rb b/.onceover/spec/classes/role__node_on_solaris-10_u9-sparc-64_spec.rb new file mode 100644 index 0000000..2c3ba40 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_solaris-10_u9-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set solaris-10_u9-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-10_u9-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.42", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.42", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"Generic_Virtual", "kernelrelease"=>"5.10", "kernelversion"=>"Generic_Virtual", "load_averages"=>{"15m"=>1.015625, "1m"=>1.89453125, "5m"=>1.25390625}, "macaddress"=>"02:08:20:f1:97:4b", "macaddress_net0"=>"02:08:20:f1:97:4b", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"3.25 GiB", "available_bytes"=>-806297600, "capacity"=>"78.94%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"12.18 GiB", "used_bytes"=>194560000}}, "memoryfree"=>"3.25 GiB", "memoryfree_mb"=>3327.0546875, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"1.14%", "device"=>"rpool/ROOT/zbe-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950161"], "size"=>"480.01 GiB", "size_bytes"=>13566464, "used"=>"5.49 GiB", "used_bytes"=>1602503680}, "/.SUNWnative/lib"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/lib", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/platform"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/platform", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/sbin"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/sbin", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/usr"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/usr", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc10", "nozonemod", "sharezone=36", "dev=8e0001b"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=9040025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e80025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/svc/volatile"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}, "/export"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950163"], "size"=>"474.52 GiB", "size_bytes"=>-1588904448, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950164"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8dc0024"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950165"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e40025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8f00025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/tmp"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.70%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec004a"], "size"=>"5.52 GiB", "size_bytes"=>1632608256, "used"=>"39.52 MiB", "used_bytes"=>41435136}, "/var"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.03%", "device"=>"rpool/ROOT/zbe-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/var", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950162"], "size"=>"474.66 GiB", "size_bytes"=>-1436724224, "used"=>"145.16 MiB", "used_bytes"=>152212992}, "/var/run"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"/etc/svc/volatile/", "filesystem"=>"lofs", "options"=>["rstchown", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"domain"=>"puppet.example", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "hostname"=>"solaris-10_u9-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.42", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10_u9", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"10_u9", "major"=>"10", "minor"=>"9"}}, "osfamily"=>"Solaris", "path"=>"/usr/local/bin:/usr/local/sbin:/opt/csw/bin:PATH:/opt/puppetlabs/bin:/usr/local/bin:/usr/local/sbin:/opt/csw/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-10-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>" SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.10", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.10", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"solaris-10_u9-sparc-t4-64", "zones"=>{"solaris-10_u9-sparc-t4-64"=>{"brand"=>"solaris10", "id"=>"36", "ip_type"=>"excl", "path"=>"/", "status"=>"running"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798", "sha256"=>"SSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15"}, "key"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4", "sha256"=>"SSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg==", "sshfp_dsa"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798\nSSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15", "sshfp_rsa"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4\nSSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U=", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1860, "uptime"=>"0:31 hours"}, "timezone"=>"PDT", "uptime"=>"0:31 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1860, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc10_brand"=>"solaris10", "zone_cisparc10_id"=>"36", "zone_cisparc10_iptype"=>"excl", "zone_cisparc10_name"=>"solaris-10_u9-sparc-t4-64", "zone_cisparc10_path"=>"/", "zone_cisparc10_status"=>"running", "zonename"=>"solaris-10_u9-sparc-t4-64", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-10_u9-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'solaris-10_u9-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_solaris-11.2-sparc-64_spec.rb b/.onceover/spec/classes/role__node_on_solaris-11.2-sparc-64_spec.rb new file mode 100644 index 0000000..b2a134d --- /dev/null +++ b/.onceover/spec/classes/role__node_on_solaris-11.2-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set solaris-11.2-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "dhcp_servers"=>{"net0"=>"10.32.22.10", "system"=>"10.32.22.10"}, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-11_2-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.68", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.68", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"11", "kernelrelease"=>"5.11", "kernelversion"=>"11.2", "load_averages"=>{"15m"=>1.0234375, "1m"=>1.21875, "5m"=>1.28125}, "macaddress"=>"02:08:20:41:26:8c", "macaddress_net0"=>"02:08:20:41:26:8c", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"2.34 GiB", "available_bytes"=>-1777401856, "capacity"=>"84.80%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"13.09 GiB", "used_bytes"=>1165664256}}, "memoryfree"=>"2.34 GiB", "memoryfree_mb"=>2400.9375, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.18%", "device"=>"rpool/ROOT/solaris-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017b"], "size"=>"476.16 GiB", "size_bytes"=>175171072, "used"=>"889.53 MiB", "used_bytes"=>932736000}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc", "nozonemod", "sharezone=38", "dev=8e0001c"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=9040027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/dfs/sharetab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"sharefs", "filesystem"=>"sharefs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f40016"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e80027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/export"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017f"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950180"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8dc0026"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950181"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e40027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f00027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/volatile"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004d"], "size"=>"4.53 GiB", "size_bytes"=>572342272, "used"=>"576.00 KiB", "used_bytes"=>589824}, "/tmp"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.95%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004e"], "size"=>"4.58 GiB", "size_bytes"=>618414080, "used"=>"44.50 MiB", "used_bytes"=>46661632}, "/var"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.05%", "device"=>"rpool/ROOT/solaris-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/var", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017d"], "size"=>"475.51 GiB", "size_bytes"=>-521269760, "used"=>"225.35 MiB", "used_bytes"=>236295168}, "/var/share"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017e"], "size"=>"475.30 GiB", "size_bytes"=>-756610048, "used"=>"932.50 KiB", "used_bytes"=>954880}, "/var/share/pkg"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950182"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/var/share/pkg/repositories"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg/repositories", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950183"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"dhcp"=>"10.32.22.10", "domain"=>"puppet.example", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "hostname"=>"solaris-11_2-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.68", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "dhcp"=>"10.32.22.10", "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.2", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"11.2", "major"=>"11", "minor"=>"2"}}, "osfamily"=>"Solaris", "path"=>"PATH:/opt/puppetlabs/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-11-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>"SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.11", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.11", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"cisparc", "zones"=>{"cisparc"=>{"brand"=>"solaris", "id"=>"38", "ip_type"=>"excl", "path"=>"/", "status"=>"running", "uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f", "sha256"=>"SSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607"}, "key"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3", "sha256"=>"SSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA=", "sshfp_dsa"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f\nSSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607", "sshfp_rsa"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3\nSSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw==", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>2, "hours"=>62, "seconds"=>225780, "uptime"=>"2 days"}, "timezone"=>"PDT", "uptime"=>"2 days", "uptime_days"=>2, "uptime_hours"=>62, "uptime_seconds"=>225780, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc_brand"=>"solaris", "zone_cisparc_id"=>"38", "zone_cisparc_iptype"=>"excl", "zone_cisparc_name"=>"cisparc", "zone_cisparc_path"=>"/", "zone_cisparc_status"=>"running", "zone_cisparc_uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782", "zonename"=>"cisparc", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-11_2-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'solaris-11.2-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__node_on_windows-10-64_spec.rb b/.onceover/spec/classes/role__node_on_windows-10-64_spec.rb new file mode 100644 index 0000000..858d4f9 --- /dev/null +++ b/.onceover/spec/classes/role__node_on_windows-10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::node" do + + context "using fact set windows-10-64" do + node_facts = {"puppetversion"=>"6.0.2", "puppet_inventory_metadata"=>{"packages"=>{"collection_enabled"=>false, "last_collection_time"=>"0.0s"}}, "package_provider"=>"windows", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "is_pe"=>false, "platform_symlink_writable"=>false, "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppet_environmentpath"=>"C:/ProgramData/PuppetLabs/code/environments", "puppet_server"=>"pe-puppet.localdomain", "service_provider"=>"windows", "staging_http_get"=>"curl", "common_appdata"=>"C:\\ProgramData", "architecture"=>"x64", "kernel"=>"windows", "virtual"=>"vmware", "is_virtual"=>true, "hardwaremodel"=>"x64", "operatingsystem"=>"windows", "os"=>{"name"=>"windows", "family"=>"windows", "release"=>{"major"=>"10", "full"=>"10"}}, "facterversion"=>"2.5.1", "fqdn"=>"VAGRANT-HB9G3RD", "hostname"=>"VAGRANT-HB9G3RD", "id"=>"vagrant-hb9g3rd\\vagrant", "interfaces"=>"Ethernet0_2", "ipaddress_ethernet0_2"=>"192.168.43.174", "ipaddress6_ethernet0_2"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "macaddress_ethernet0_2"=>"00:0C:29:A3:53:54", "netmask_ethernet0_2"=>"255.255.255.0", "mtu_ethernet0_2"=>0, "ipaddress"=>"192.168.43.174", "ipaddress6"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "kernelmajversion"=>"10.0", "kernelrelease"=>"10.0.17134", "kernelversion"=>"10.0.17134", "macaddress"=>"00:0C:29:A3:53:54", "manufacturer"=>"Phoenix Technologies LTD", "serialnumber"=>"VMware-56 4d 36 2e 2e a4 81 f9-0d 05 ae d0 e5 a3 53 54", "productname"=>"VMware Virtual Platform", "memorysize"=>"4.00 GB", "memoryfree"=>"2.30 GB", "memorysize_mb"=>"4095.49", "memoryfree_mb"=>"2360.00", "netmask"=>"255.255.255.0", "network_ethernet0_2"=>"192.168.43.0", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10", "osfamily"=>"windows", "path"=>"C:\\tools\\ruby24\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files (x86)\\vim\\vim80;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Users\\vagrant\\AppData\\Local\\Microsoft\\WindowsApps;", "physicalprocessorcount"=>4, "processors"=>{"models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "count"=>4, "physicalcount"=>4}, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "ps"=>"tasklist.exe", "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/tools/ruby24/lib/ruby/site_ruby/2.4.0", "rubyversion"=>"2.4.3", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"seconds"=>1113359, "hours"=>309, "days"=>12, "uptime"=>"12 days"}, "timezone"=>"GMT Standard Time", "uptime"=>"12 days", "uptime_days"=>12, "uptime_hours"=>309, "uptime_seconds"=>1113359, "clientcert"=>"vagrant-hb9g3rd.lan.asio", "clientversion"=>"6.0.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::node' +$onceover_node = 'windows-10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_AIX-6.1-powerpc_spec.rb b/.onceover/spec/classes/role__puppetserver_on_AIX-6.1-powerpc_spec.rb new file mode 100644 index 0000000..28af28a --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_AIX-6.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set AIX-6.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.8.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.5.0", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-61-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.35", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.35", "ipaddress_lo0"=>"127.0.0.1", "kernel"=>"AIX", "kernelmajversion"=>"6100", "kernelrelease"=>"6100-07-04-1216", "kernelversion"=>"6100", "macaddress"=>"66:a4:d9:f8:4a:04", "macaddress_en0"=>"66:a4:d9:f8:4a:04", "memory"=>{"swap"=>{"available"=>"410.43 MiB", "available_bytes"=>430366720, "capacity"=>"19.84%", "total"=>"512.00 MiB", "total_bytes"=>536870912, "used"=>"101.57 MiB", "used_bytes"=>106504192}, "system"=>{"available"=>"10.88 MiB", "available_bytes"=>11403264, "capacity"=>"98.94%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1013.13 MiB", "used_bytes"=>1062338560}}, "memoryfree"=>"10.88 MiB", "memoryfree_mb"=>10.875, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-61-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.35", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"6100", "operatingsystemrelease"=>"6100-07-04-1216", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"6100-07-04-1216", "major"=>"6100"}}, "osfamily"=>"AIX", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppetversion"=>"4.8.1", "ruby"=>{"platform"=>"powerpc-aix6.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix6.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2", "sha256"=>"SSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d", "sha256"=>"SSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY=", "sshfp_dsa"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2\nSSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945", "sshfp_rsa"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d\nSSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch", "swapfree"=>"410.43 MiB", "swapfree_mb"=>410.4296875, "swapsize"=>"512.00 MiB", "swapsize_mb"=>512.0, "system_uptime"=>{"days"=>418, "hours"=>10035, "seconds"=>36127200, "uptime"=>"418 days"}, "timezone"=>"PST", "uptime"=>"418 days", "uptime_days"=>418, "uptime_hours"=>10035, "uptime_seconds"=>36127200, "clientcert"=>"pe-aix-61-se.delivery.puppetlabs.net", "clientversion"=>"4.8.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'AIX-6.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_AIX-7.1-powerpc_spec.rb b/.onceover/spec/classes/role__puppetserver_on_AIX-7.1-powerpc_spec.rb new file mode 100644 index 0000000..5950a20 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_AIX-7.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set AIX-7.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.5.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.2.0", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-71-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.36", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.36", "ipaddress_lo0"=>"127.0.0.1", "is_pe"=>false, "kernel"=>"AIX", "kernelmajversion"=>"7100", "kernelrelease"=>"7100-01-05-1228", "kernelversion"=>"7100", "macaddress"=>"66:a4:dc:28:bf:04", "macaddress_en0"=>"66:a4:dc:28:bf:04", "memory"=>{"swap"=>{"available"=>"1007.14 MiB", "available_bytes"=>1056063488, "capacity"=>"1.65%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"16.86 MiB", "used_bytes"=>17678336}, "system"=>{"available"=>"16.84 MiB", "available_bytes"=>17653760, "capacity"=>"98.36%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1007.16 MiB", "used_bytes"=>1056088064}}, "memoryfree"=>"16.84 MiB", "memoryfree_mb"=>16.8359375, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-71-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.36", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"7100", "operatingsystemrelease"=>"7100-01-05-1228", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"7100-01-05-1228", "major"=>"7100"}}, "osfamily"=>"AIX", "package_provider"=>"aix", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppet_environmentpath"=>"/etc/puppetlabs/code/environments", "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.5.2", "root_home"=>"/root", "ruby"=>{"platform"=>"powerpc-aix7.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix7.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "service_provider"=>"src", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c", "sha256"=>"SSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5", "sha256"=>"SSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y=", "sshfp_dsa"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c\nSSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a", "sshfp_rsa"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5\nSSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB", "swapfree"=>"1007.14 MiB", "swapfree_mb"=>1007.140625, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1024.0, "system_uptime"=>{"days"=>160, "hours"=>3847, "seconds"=>13852500, "uptime"=>"160 days"}, "timezone"=>"PST", "uptime"=>"160 days", "uptime_days"=>160, "uptime_hours"=>3847, "uptime_seconds"=>13852500, "clientcert"=>"pe-aix-71-se.delivery.puppetlabs.net", "clientversion"=>"4.5.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'AIX-7.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Amazon-2018.03_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Amazon-2018.03_spec.rb new file mode 100644 index 0000000..413c5b8 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Amazon-2018.03_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Amazon-2018.03" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"10/16/2017", "bios_vendor"=>"Amazon EC2", "bios_version"=>"1.0", "blockdevice_nvme0n1_model"=>"Amazon Elastic Block Store", "blockdevice_nvme0n1_size"=>8589934592, "blockdevices"=>"nvme0n1", "boardassettag"=>"i-0816d4c53ff8dc6a2", "boardmanufacturer"=>"Amazon EC2", "chassisassettag"=>"Amazon EC2", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"172.31.0.1", "system"=>"172.31.0.1"}, "disks"=>{"nvme0n1"=>{"model"=>"Amazon Elastic Block Store", "size"=>"8.00 GiB", "size_bytes"=>8589934592}}, "dmi"=>{"bios"=>{"release_date"=>"10/16/2017", "vendor"=>"Amazon EC2", "version"=>"1.0"}, "board"=>{"asset_tag"=>"i-0816d4c53ff8dc6a2", "manufacturer"=>"Amazon EC2"}, "chassis"=>{"asset_tag"=>"Amazon EC2", "type"=>"Other"}, "manufacturer"=>"Amazon EC2", "product"=>{"name"=>"t3a.xlarge", "serial_number"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA"}}, "domain"=>"us-west-2.compute.internal", "ec2_metadata"=>{"ami-id"=>"ami-01e24be29428c15b2", "ami-launch-index"=>"0", "ami-manifest-path"=>"(unknown)", "block-device-mapping"=>{"ami"=>"xvda", "root"=>"/dev/xvda"}, "events"=>{"maintenance"=>{"history"=>"[]", "scheduled"=>"[]"}}, "hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "identity-credentials"=>{"ec2"=>{"info"=>"{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2019-05-07T01:03:28Z\",\n \"AccountId\" : \"581165678935\"\n}"}}, "instance-action"=>"none", "instance-id"=>"i-0816d4c53ff8dc6a2", "instance-type"=>"t3a.xlarge", "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "metrics"=>{"vhostmd"=>""}, "network"=>{"interfaces"=>{"macs"=>{"0a:ca:e0:39:c1:f6"=>{"device-number"=>"0", "interface-id"=>"eni-04e7710af3cf1699c", "ipv4-associations"=>{"34.209.204.164"=>"172.31.3.153"}, "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4s"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "owner-id"=>"581165678935", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4s"=>"34.209.204.164", "security-group-ids"=>"sg-05a2c52388c24f3ae", "security-groups"=>"launch-wizard-2", "subnet-id"=>"subnet-3bafc660", "subnet-ipv4-cidr-block"=>"172.31.0.0/20", "vpc-id"=>"vpc-287af44e", "vpc-ipv4-cidr-block"=>"172.31.0.0/16", "vpc-ipv4-cidr-blocks"=>"172.31.0.0/16"}}}}, "placement"=>{"availability-zone"=>"us-west-2c"}, "profile"=>"default-hvm", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4"=>"34.209.204.164", "public-keys"=>{"0"=>{"openssh-key"=>"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDk1QR+MwLPRohIOiWbCC8xjJKFYeCjIh2g2wAKnZFCkPjCG9BD3L4URnszJXdv+5XylfWO1y9O1Z95etjWfObApRZ5Ej22Dz1EExWWRNOKl9QdrEfCACSlc5gbT5rflHd/He9eD5OFRHlMY8fNIApEKdQrlxZgr1/NOusVQggoS/MiszxCl0dob3kz86XX6PrAmMyGfv7j/mPeeEUzP3bGxtjJyaZGcwukjPvlgq1yI4AzZlveY8fnokRsh9uDHXUEVB2hLNaBBZB/Evw261J/+QsnKopAuqQpwct/n/ulbg+w1h/2ZBiDXDBK8DQ8kOC4zuum6qwri1KNKdX9zIif thinkpad"}}, "reservation-id"=>"r-0b89c0e198506ec1f", "security-groups"=>"launch-wizard-2", "services"=>{"domain"=>"amazonaws.com", "partition"=>"aws"}}, "facterversion"=>"3.12.4", "filesystems"=>"ext3,ext4", "fips_enabled"=>false, "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ip-172-31-3-153", "hypervisors"=>{"kvm"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"172.31.3.153", "ipaddress6"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_eth0"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"172.31.3.153", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.14", "kernelrelease"=>"4.14.77-70.59.amzn1.x86_64", "kernelversion"=>"4.14.77", "load_averages"=>{"15m"=>0.02, "1m"=>0.12, "5m"=>0.06}, "macaddress"=>"0a:ca:e0:39:c1:f6", "macaddress_eth0"=>"0a:ca:e0:39:c1:f6", "manufacturer"=>"Amazon EC2", "memory"=>{"system"=>{"available"=>"15.36 GiB", "available_bytes"=>16489611264, "capacity"=>"1.10%", "total"=>"15.53 GiB", "total_bytes"=>16673153024, "used"=>"175.04 MiB", "used_bytes"=>183541760}}, "memoryfree"=>"15.36 GiB", "memoryfree_mb"=>15725.71875, "memorysize"=>"15.53 GiB", "memorysize_mb"=>15900.7578125, "mountpoints"=>{"/"=>{"available"=>"6.55 GiB", "available_bytes"=>7033344000, "capacity"=>"15.45%", "device"=>"/dev/nvme0n1p1", "filesystem"=>"ext4", "options"=>["rw", "noatime", "data=ordered"], "size"=>"7.75 GiB", "size_bytes"=>8318783488, "used"=>"1.20 GiB", "used_bytes"=>1285439488}, "/dev/shm"=>{"available"=>"7.76 GiB", "available_bytes"=>8336576512, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"7.76 GiB", "size_bytes"=>8336576512, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>9001, "mtu_lo"=>65536, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.240.0", "netmask_lo"=>"255.0.0.0", "network"=>"172.31.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"172.31.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"172.31.0.1", "domain"=>"us-west-2.compute.internal", "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "hostname"=>"ip-172-31-3-153", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"172.31.3.153", "netmask"=>"255.255.240.0", "network"=>"172.31.0.0"}], "bindings6"=>[{"address"=>"fe80::8ca:e0ff:fe39:c1f6", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"172.31.0.1", "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"Amazon", "operatingsystemmajrelease"=>"2018", "operatingsystemrelease"=>"2018.03", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"Amazon", "release"=>{"full"=>"2018.03", "major"=>"2018", "minor"=>"03"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/nvme0n1p1"=>{"filesystem"=>"ext4", "label"=>"/", "mount"=>"/", "partlabel"=>"Linux", "partuuid"=>"893c59db-bd86-4d67-b40f-221bc82c14c8", "size"=>"8.00 GiB", "size_bytes"=>8587820544, "uuid"=>"f25f5092-0401-4edb-9fac-c57f3c673803"}, "/dev/nvme0n1p128"=>{"partlabel"=>"BIOS Boot Partition", "partuuid"=>"9d1c14c8-e25b-4405-9171-de3c756f61b2", "size"=>"1.00 MiB", "size_bytes"=>1048576}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin", "physicalprocessorcount"=>1, "processor0"=>"AMD EPYC 7571", "processor1"=>"AMD EPYC 7571", "processor2"=>"AMD EPYC 7571", "processor3"=>"AMD EPYC 7571", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571"], "physicalcount"=>1}, "productname"=>"t3a.xlarge", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>false, "serialnumber"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd", "sha256"=>"SSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f"}, "key"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4", "sha256"=>"SSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc", "sha256"=>"SSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28", "sha256"=>"SSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "sshfp_dsa"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd\nSSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f", "sshfp_ecdsa"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4\nSSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b", "sshfp_ed25519"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc\nSSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f", "sshfp_rsa"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28\nSSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>136, "uptime"=>"0:02 hours"}, "timezone"=>"UTC", "uptime"=>"0:02 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>136, "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA", "virtual"=>"kvm", "clientcert"=>"ip-172-31-3-153.us-west-2.compute.internal", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Amazon-2018.03' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_CentOS-5.11-32_spec.rb b/.onceover/spec/classes/role__puppetserver_on_CentOS-5.11-32_spec.rb new file mode 100644 index 0000000..0e3e9e9 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_CentOS-5.11-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set CentOS-5.11-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>0, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>0}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:febf:56", "ipaddress6_eth0"=>"fe80::a00:27ff:febf:56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.11, "1m"=>0.28, "5m"=>0.22}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:bf:00:56", "macaddress_eth0"=>"08:00:27:bf:00:56", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"429.48 MiB", "available_bytes"=>450342912, "capacity"=>"14.58%", "total"=>"502.80 MiB", "total_bytes"=>527220736, "used"=>"73.32 MiB", "used_bytes"=>76877824}}, "memoryfree"=>"429.48 MiB", "memoryfree_mb"=>429.48046875, "memorysize"=>"502.80 MiB", "memorysize_mb"=>502.796875, "mountpoints"=>{"/"=>{"available"=>"1.09 GiB", "available_bytes"=>1171632128, "capacity"=>"52.22%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"2.28 GiB", "size_bytes"=>-1842671616, "used"=>"1.19 GiB", "used_bytes"=>1280663552}, "/boot"=>{"available"=>"86.58 MiB", "available_bytes"=>90790912, "capacity"=>"12.29%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.13 MiB", "used_bytes"=>12721152}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f", "sha256"=>"SSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940"}, "key"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5", "sha256"=>"SSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo=", "sshfp_dsa"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f\nSSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940", "sshfp_rsa"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5\nSSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1067, "uptime"=>"0:17 hours"}, "timezone"=>"UTC", "uptime"=>"0:17 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1067, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'CentOS-5.11-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_CentOS-5.11-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_CentOS-5.11-64_spec.rb new file mode 100644 index 0000000..9ada772 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_CentOS-5.11-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set CentOS-5.11-64" do + node_facts = {"architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>21474836480, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>21474836480}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_eth0"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:3e:49:87", "macaddress_eth0"=>"08:00:27:3e:49:87", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"389.45 MiB", "available_bytes"=>408363008, "capacity"=>"21.76%", "total"=>"497.78 MiB", "total_bytes"=>521961472, "used"=>"108.34 MiB", "used_bytes"=>113598464}}, "memoryfree"=>"389.45 MiB", "memoryfree_mb"=>389.4453125, "memorysize"=>"497.78 MiB", "memorysize_mb"=>497.78125, "mountpoints"=>{"/"=>{"available"=>"16.96 GiB", "available_bytes"=>18212638720, "capacity"=>"7.23%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"18.28 GiB", "size_bytes"=>19632164864, "used"=>"1.32 GiB", "used_bytes"=>1419526144}, "/boot"=>{"available"=>"86.04 MiB", "available_bytes"=>90215424, "capacity"=>"12.85%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.68 MiB", "used_bytes"=>13296640}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d", "sha256"=>"SSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7", "sha256"=>"SSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ==", "sshfp_dsa"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d\nSSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb", "sshfp_rsa"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7\nSSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>847, "uptime"=>"0:14 hours"}, "timezone"=>"UTC", "uptime"=>"0:14 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>847, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'CentOS-5.11-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_CentOS-6.6-32_spec.rb b/.onceover/spec/classes/role__puppetserver_on_CentOS-6.6-32_spec.rb new file mode 100644 index 0000000..c64bd63 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_CentOS-6.6-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set CentOS-6.6-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_eth0"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.el6.i686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:ff:42:e5", "macaddress_eth0"=>"08:00:27:ff:42:e5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.00 GiB", "available_bytes"=>1073737728, "capacity"=>"0%", "total"=>"1.00 GiB", "total_bytes"=>1073737728, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"451.91 MiB", "available_bytes"=>473862144, "capacity"=>"9.40%", "total"=>"498.82 MiB", "total_bytes"=>523051008, "used"=>"46.91 MiB", "used_bytes"=>49188864}}, "memoryfree"=>"451.91 MiB", "memoryfree_mb"=>451.91015625, "memorysize"=>"498.82 MiB", "memorysize_mb"=>498.8203125, "mountpoints"=>{"/"=>{"available"=>"1.02 GiB", "available_bytes"=>1099689984, "capacity"=>"51.05%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"2.09 GiB", "size_bytes"=>-2048442368, "used"=>"1.07 GiB", "used_bytes"=>1146834944}, "/boot"=>{"available"=>"450.39 MiB", "available_bytes"=>472266752, "capacity"=>"5.42%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"25.83 MiB", "used_bytes"=>27088896}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"i386", "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"bc353fb2-82b1-4d41-a43e-6512030a2a28"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"eb19f39e-a1cc-4e43-bf33-809fa7f52044"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"51727e98-6cd5-4fba-8a1f-7d4dfb575e1f"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>-525336576, "uuid"=>"vkG7sJ-bfu3-Cko3-YJ7v-jPys-3uHe-vki0jZ"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe", "sha256"=>"SSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877"}, "key"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8", "sha256"=>"SSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow==", "sshfp_dsa"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe\nSSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877", "sshfp_rsa"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8\nSSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw==", "swapfree"=>"1.00 GiB", "swapfree_mb"=>1023.99609375, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1023.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>430, "uptime"=>"0:07 hours"}, "timezone"=>"UTC", "uptime"=>"0:07 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>430, "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'CentOS-6.6-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_CentOS-6.6-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_CentOS-6.6-64_spec.rb new file mode 100644 index 0000000..8ad6d72 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_CentOS-6.6-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set CentOS-6.6-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos6a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.7", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth0"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth1"=>"fe80::a00:27ff:fe66:988a", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.88", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.7", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.8.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:0f:d2:76", "macaddress_eth0"=>"08:00:27:0f:d2:76", "macaddress_eth1"=>"08:00:27:66:98:8a", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"992.00 MiB", "available_bytes"=>1040183296, "capacity"=>"0%", "total"=>"992.00 MiB", "total_bytes"=>1040183296, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"348.41 MiB", "available_bytes"=>365338624, "capacity"=>"28.95%", "total"=>"490.39 MiB", "total_bytes"=>514215936, "used"=>"141.98 MiB", "used_bytes"=>148877312}}, "memoryfree"=>"348.41 MiB", "memoryfree_mb"=>348.4140625, "memorysize"=>"490.39 MiB", "memorysize_mb"=>490.39453125, "mountpoints"=>{"/"=>{"available"=>"16.94 GiB", "available_bytes"=>18193268736, "capacity"=>"6.51%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"18.12 GiB", "size_bytes"=>19459338240, "used"=>"1.18 GiB", "used_bytes"=>1266069504}, "/boot"=>{"available"=>"448.35 MiB", "available_bytes"=>470125568, "capacity"=>"5.85%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"27.88 MiB", "used_bytes"=>29230080}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8555670, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "hostname"=>"centos6a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.88", "ip6"=>"fe80::a00:27ff:fe66:988a", "mac"=>"08:00:27:66:98:8a", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"a29409f8-0b58-4271-a348-032caefec8b8"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b30b464a-8ac9-492a-a1c5-2da75bb7488a"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"da946872-1406-4ac1-9a4d-f7ce5f7be47e"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"nRdWPh-INkA-aHPs-TNtk-HjJG-SxBU-DdqI8a"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-6-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8", "sha256"=>"SSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745"}, "key"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef", "sha256"=>"SSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg==", "sshfp_dsa"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8\nSSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745", "sshfp_rsa"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef\nSSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ==", "staging_http_get"=>"curl", "swapfree"=>"992.00 MiB", "swapfree_mb"=>991.99609375, "swapsize"=>"992.00 MiB", "swapsize_mb"=>991.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>352, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>352, "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C", "virtual"=>"virtualbox", "clientcert"=>"centos6a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'CentOS-6.6-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_CentOS-7.0-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_CentOS-7.0-64_spec.rb new file mode 100644 index 0000000..7c3a007 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_CentOS-7.0-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set CentOS-7.0-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"sydney", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "enp0s8"=>"192.168.56.100", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF"}}, "domain"=>"syd.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"xfs", "fqdn"=>"centos7b.syd.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos7b", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,enp0s8,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s3"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s8"=>"fe80::a00:27ff:fe39:832c", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_enp0s8"=>"10.20.1.92", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-123.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.26, "5m"=>0.12}, "macaddress"=>"08:00:27:39:18:3c", "macaddress_enp0s3"=>"08:00:27:39:18:3c", "macaddress_enp0s8"=>"08:00:27:39:83:2c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.03 GiB", "available_bytes"=>1107292160, "capacity"=>"0%", "total"=>"1.03 GiB", "total_bytes"=>1107292160, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"297.76 MiB", "available_bytes"=>312225792, "capacity"=>"39.28%", "total"=>"490.41 MiB", "total_bytes"=>514228224, "used"=>"192.64 MiB", "used_bytes"=>202002432}}, "memoryfree"=>"297.76 MiB", "memoryfree_mb"=>297.76171875, "memorysize"=>"490.41 MiB", "memorysize_mb"=>490.40625, "mountpoints"=>{"/"=>{"available"=>"17.30 GiB", "available_bytes"=>18574749696, "capacity"=>"6.32%", "device"=>"/dev/mapper/centos-root", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"18.47 GiB", "size_bytes"=>19828572160, "used"=>"1.17 GiB", "used_bytes"=>1253822464}, "/boot"=>{"available"=>"393.11 MiB", "available_bytes"=>412209152, "capacity"=>"20.85%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.67 MiB", "size_bytes"=>520794112, "used"=>"103.55 MiB", "used_bytes"=>108584960}}, "mtu_enp0s3"=>1500, "mtu_enp0s8"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8563388, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s8"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_enp0s8"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_enp0s8"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_enp0s8"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"syd.puppetlabs.demo", "fqdn"=>"centos7b.syd.puppetlabs.demo", "hostname"=>"centos7b", "interfaces"=>{"enp0s3"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "enp0s8"=>{"dhcp"=>"192.168.56.100", "ip"=>"10.20.1.92", "ip6"=>"fe80::a00:27ff:fe39:832c", "mac"=>"08:00:27:39:83:2c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.0.1406", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"7.0.1406", "major"=>"7", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/centos-root"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"db651e5f-a2c2-4236-9570-6226f63e1fcd"}, "/dev/mapper/centos-swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"ff4ec16c-28c0-4715-846d-11e7c9b4e53b"}, "/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"39ce4ad1-4e9d-49a4-bce0-8a30b459490a"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"pg7zVv-M3hI-zpjY-eYlZ-06aD-ZRO2-J30GLd"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-7-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb", "sha256"=>"SSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581", "sha256"=>"SSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4=", "sshfp_ecdsa"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb\nSSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba", "sshfp_rsa"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581\nSSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1", "staging_http_get"=>"curl", "swapfree"=>"1.03 GiB", "swapfree_mb"=>1055.99609375, "swapsize"=>"1.03 GiB", "swapsize_mb"=>1055.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>78, "uptime"=>"0:01 hours"}, "timezone"=>"UTC", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>78, "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF", "virtual"=>"virtualbox", "clientcert"=>"centos7b.syd.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'CentOS-7.0-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Debian-6.0.10-32_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Debian-6.0.10-32_spec.rb new file mode 100644 index 0000000..cc95ede --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Debian-6.0.10-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Debian-6.0.10-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_eth0"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:ad:dc:1c", "macaddress_eth0"=>"08:00:27:ad:dc:1c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"434.46 MiB", "available_bytes"=>455565312, "capacity"=>"13.56%", "total"=>"502.63 MiB", "total_bytes"=>527040512, "used"=>"68.16 MiB", "used_bytes"=>71475200}}, "memoryfree"=>"434.46 MiB", "memoryfree_mb"=>434.4609375, "memorysize"=>"502.63 MiB", "memorysize_mb"=>502.625, "mountpoints"=>{"/"=>{"available"=>"1.69 GiB", "available_bytes"=>1819041792, "capacity"=>"35.07%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"937.10 MiB", "used_bytes"=>982618112}, "/boot"=>{"available"=>"213.27 MiB", "available_bytes"=>223632384, "capacity"=>"6.35%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"14.45 MiB", "used_bytes"=>15155200}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"092d5625-eb03-443c-953f-006bec7d5476"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"f9e1cf7c-ab54-4949-8e55-290adc8d853f"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"2c798378-1738-426f-a847-c929a507fc73"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"cG2Syv-bT1d-2TyA-Wqgz-33I2-RnTz-jA2LxS"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57", "sha256"=>"SSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09"}, "key"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b", "sha256"=>"SSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g==", "sshfp_dsa"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57\nSSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09", "sshfp_rsa"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b\nSSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1441, "uptime"=>"0:24 hours"}, "timezone"=>"PST", "uptime"=>"0:24 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1441, "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Debian-6.0.10-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Debian-6.0.10-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Debian-6.0.10-64_spec.rb new file mode 100644 index 0000000..f1ac437 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Debian-6.0.10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Debian-6.0.10-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_eth0"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-amd64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:62:fa:69", "macaddress_eth0"=>"08:00:27:62:fa:69", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.43 MiB", "available_bytes"=>401010688, "capacity"=>"23.04%", "total"=>"496.90 MiB", "total_bytes"=>521035776, "used"=>"114.46 MiB", "used_bytes"=>120025088}}, "memoryfree"=>"382.43 MiB", "memoryfree_mb"=>382.43359375, "memorysize"=>"496.90 MiB", "memorysize_mb"=>496.8984375, "mountpoints"=>{"/"=>{"available"=>"17.65 GiB", "available_bytes"=>18949697536, "capacity"=>"5.16%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"984.03 MiB", "used_bytes"=>1031831552}, "/boot"=>{"available"=>"212.24 MiB", "available_bytes"=>222552064, "capacity"=>"6.80%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"15.48 MiB", "used_bytes"=>16235520}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"d2763d16-5203-4625-8733-a6f2ecc94f5a"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b5661448-0339-4ba3-8593-21cc6a049d33"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"415531d6-6955-433f-921e-8f266ab56649"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vGb2LM-M1SP-IynO-OZJV-sYKl-Pcfo-fAFbiz"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f", "sha256"=>"SSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad"}, "key"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2", "sha256"=>"SSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ", "sshfp_dsa"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f\nSSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad", "sshfp_rsa"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2\nSSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1211, "uptime"=>"0:20 hours"}, "timezone"=>"PST", "uptime"=>"0:20 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1211, "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Debian-6.0.10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Debian-7.8-32_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Debian-7.8-32_spec.rb new file mode 100644 index 0000000..e963d00 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Debian-7.8-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Debian-7.8-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_eth0"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-686-pae", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:18:59:a5", "macaddress_eth0"=>"08:00:27:18:59:a5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"432.02 MiB", "available_bytes"=>453001216, "capacity"=>"14.00%", "total"=>"502.32 MiB", "total_bytes"=>526725120, "used"=>"70.31 MiB", "used_bytes"=>73723904}}, "memoryfree"=>"432.02 MiB", "memoryfree_mb"=>432.015625, "memorysize"=>"502.32 MiB", "memorysize_mb"=>502.32421875, "mountpoints"=>{"/"=>{"available"=>"1.52 GiB", "available_bytes"=>1633996800, "capacity"=>"41.68%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"1.09 GiB", "used_bytes"=>1167663104}, "/boot"=>{"available"=>"211.24 MiB", "available_bytes"=>221499392, "capacity"=>"7.24%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"16.49 MiB", "used_bytes"=>17288192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c87cb2c9-ffb8-48d1-bc31-024a57d3e44e"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"864df30a-fc50-4a93-8cfd-4624251c1589"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"b8ab8500-a238-4554-8d11-9c194ebba70c"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"NvdPwA-esP3-xUuv-n9OR-Ep7r-kQAr-qyUAzr"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa", "sha256"=>"SSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906"}, "key"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4", "sha256"=>"SSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d", "sha256"=>"SSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA=", "sshfp_dsa"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa\nSSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906", "sshfp_ecdsa"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4\nSSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480", "sshfp_rsa"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d\nSSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>800, "uptime"=>"0:13 hours"}, "timezone"=>"PST", "uptime"=>"0:13 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>800, "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Debian-7.8-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Debian-7.8-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Debian-7.8-64_spec.rb new file mode 100644 index 0000000..86b85ad --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Debian-7.8-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Debian-7.8-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_eth0"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-amd64", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:83:ad:56", "macaddress_eth0"=>"08:00:27:83:ad:56", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.02 MiB", "available_bytes"=>400576512, "capacity"=>"23.13%", "total"=>"496.96 MiB", "total_bytes"=>521101312, "used"=>"114.94 MiB", "used_bytes"=>120524800}}, "memoryfree"=>"382.02 MiB", "memoryfree_mb"=>382.01953125, "memorysize"=>"496.96 MiB", "memorysize_mb"=>496.9609375, "mountpoints"=>{"/"=>{"available"=>"17.49 GiB", "available_bytes"=>18781380608, "capacity"=>"6.01%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"1.12 GiB", "used_bytes"=>1200148480}, "/boot"=>{"available"=>"210.36 MiB", "available_bytes"=>220575744, "capacity"=>"7.63%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"17.37 MiB", "used_bytes"=>18211840}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"7b853135-fb91-48ff-a25c-8d34ada8d549"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"486756ce-bdd1-45f4-864d-e4b6fce59b9d"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"8aa50802-2811-43ec-9686-a30f6a1c3ade"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"eGBBBU-DZw3-wy0f-OMxw-Sf5d-jDyA-ctqcpx"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac", "sha256"=>"SSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a", "sha256"=>"SSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37", "sha256"=>"SSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI=", "sshfp_dsa"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac\nSSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144", "sshfp_ecdsa"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a\nSSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6", "sshfp_rsa"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37\nSSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>650, "uptime"=>"0:10 hours"}, "timezone"=>"PST", "uptime"=>"0:10 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>650, "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Debian-7.8-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_RHEL-6.7_spec.rb b/.onceover/spec/classes/role__puppetserver_on_RHEL-6.7_spec.rb new file mode 100644 index 0000000..7e2d953 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_RHEL-6.7_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set RHEL-6.7" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"sr0,sdb,sda", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-9727-3914-2228-1494-64", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-9727-3914-2228-1494-64"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0016-4348-2410-5386-3288-39", "uuid"=>"723914E4-94CB-0743-9847-001D218884D8"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext4,iso9660,udf", "fips_enabled"=>false, "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel6box", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.5", "ipaddress6"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_eth0"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.5", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-573.45.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.06, "1m"=>0.15, "5m"=>0.14}, "lsbdistcodename"=>"Santiago", "lsbdistdescription"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "lsbdistid"=>"RedHatEnterpriseServer", "lsbdistrelease"=>"6.7", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"7", "lsbrelease"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch", "macaddress"=>"00:0d:3a:96:ed:47", "macaddress_eth0"=>"00:0d:3a:96:ed:47", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.55 GiB", "available_bytes"=>8103010304, "capacity"=>"3.24%", "total"=>"7.80 GiB", "total_bytes"=>8374747136, "used"=>"259.15 MiB", "used_bytes"=>271736832}}, "memoryfree"=>"7.55 GiB", "memoryfree_mb"=>7727.6328125, "memorysize"=>"7.80 GiB", "memorysize_mb"=>7986.78125, "mountpoints"=>{"/"=>{"available"=>"27.90 GiB", "available_bytes"=>29956210688, "capacity"=>"9.68%", "device"=>"/dev/sda2", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"30.89 GiB", "size_bytes"=>33168420864, "used"=>"2.99 GiB", "used_bytes"=>3212210176}, "/boot"=>{"available"=>"402.87 MiB", "available_bytes"=>422435840, "capacity"=>"15.40%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"73.36 MiB", "used_bytes"=>76919808}, "/dev/shm"=>{"available"=>"3.90 GiB", "available_bytes"=>4187373568, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "rootcontext=\"system_u:object_r:tmpfs_t:s0\""], "size"=>"3.90 GiB", "size_bytes"=>4187373568, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506543104, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"49.09 GiB", "size_bytes"=>52708372480, "used"=>"2.05 GiB", "used_bytes"=>2201829376}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel6box", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.5", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe96:ed47", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.7", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Santiago", "description"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "id"=>"RedHatEnterpriseServer", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "specification"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "selinux"=>{"config_mode"=>"enforcing", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"24"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"ce2ad98e-bb9f-4603-abce-3db7fd857a6c"}, "/dev/sda2"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"be4cc18d-b110-4914-a6f9-52dc0dc66f68"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"aafc7ffe-f0b2-4872-8174-a05f24f6c3d4"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"24", "serialnumber"=>"0000-0016-4348-2410-5386-3288-39", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce", "sha256"=>"SSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd"}, "key"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "type"=>"ssh-dss"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d", "sha256"=>"SSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "sshfp_dsa"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce\nSSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd", "sshfp_rsa"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d\nSSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>239, "uptime"=>"0:03 hours"}, "timezone"=>"EDT", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>239, "uuid"=>"723914E4-94CB-0743-9847-001D218884D8", "virtual"=>"hyperv", "clientcert"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'RHEL-6.7' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_RHEL-7.4_spec.rb b/.onceover/spec/classes/role__puppetserver_on_RHEL-7.4_spec.rb new file mode 100644 index 0000000..58b0e2f --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_RHEL-7.4_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set RHEL-7.4" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_fd0_size"=>4096, "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"fd0,sda,sdb,sr0", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-6006-7746-5828-7871-43", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"fd0"=>{"size"=>"4.00 KiB", "size_bytes"=>4096}, "sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-6006-7746-5828-7871-43"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0017-8302-7891-2115-8198-39", "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext2,ext3,ext4,udf,xfs", "fips_enabled"=>false, "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel7test", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.6", "ipaddress6"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_eth0"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.6", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-693.46.1.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.08, "1m"=>0.32, "5m"=>0.19}, "macaddress"=>"00:0d:3a:90:57:80", "macaddress_eth0"=>"00:0d:3a:90:57:80", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.42 GiB", "available_bytes"=>7963906048, "capacity"=>"4.67%", "total"=>"7.78 GiB", "total_bytes"=>8353742848, "used"=>"371.78 MiB", "used_bytes"=>389836800}}, "memoryfree"=>"7.42 GiB", "memoryfree_mb"=>7594.97265625, "memorysize"=>"7.78 GiB", "memorysize_mb"=>7966.75, "mountpoints"=>{"/"=>{"available"=>"29.95 GiB", "available_bytes"=>32156790784, "capacity"=>"4.91%", "device"=>"/dev/sda2", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"31.50 GiB", "size_bytes"=>33817882624, "used"=>"1.55 GiB", "used_bytes"=>1661091840}, "/boot"=>{"available"=>"393.75 MiB", "available_bytes"=>412880896, "capacity"=>"20.72%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.66 MiB", "size_bytes"=>520785920, "used"=>"102.91 MiB", "used_bytes"=>107905024}, "/dev/shm"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506170368, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw", "seclabel", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52708212736, "used"=>"2.05 GiB", "used_bytes"=>2202042368}, "/run"=>{"available"=>"3.88 GiB", "available_bytes"=>4168146944, "capacity"=>"0.21%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"8.32 MiB", "used_bytes"=>8724480}, "/run/user/1000"=>{"available"=>"796.68 MiB", "available_bytes"=>835375104, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "relatime", "size=815796k", "mode=700", "uid=1000", "gid=1000"], "size"=>"796.68 MiB", "size_bytes"=>835375104, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "seclabel", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel7test", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.6", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe90:5780", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.4", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"7.4", "major"=>"7", "minor"=>"4"}, "selinux"=>{"config_mode"=>"enforcing", "config_policy"=>"targeted", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"28"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"b3f65ad5-0571-4ae4-937a-13ef2fda43e3"}, "/dev/sda2"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"e9643aa4-b339-43c4-afc5-fcac22af1584"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"07908b37-1661-4130-9d5a-e1fdb0a4bdb2"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_config_policy"=>"targeted", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"28", "serialnumber"=>"0000-0017-8302-7891-2115-8198-39", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7", "sha256"=>"SSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929", "sha256"=>"SSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a", "sha256"=>"SSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "type"=>"ssh-rsa"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "sshfp_ecdsa"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7\nSSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2", "sshfp_ed25519"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929\nSSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282", "sshfp_rsa"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a\nSSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>215, "uptime"=>"0:03 hours"}, "timezone"=>"UTC", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>215, "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7", "virtual"=>"hyperv", "clientcert"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'RHEL-7.4' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_SLES-11.3-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_SLES-11.3-64_spec.rb new file mode 100644 index 0000000..9fd86a3 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_SLES-11.3-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set SLES-11.3-64" do + node_facts = {"aio_agent_version"=>"1.8.3", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D"}}, "domain"=>"lan.asio", "facterversion"=>"3.5.1", "filesystems"=>"ext3,iso9660,squashfs", "fqdn"=>"sles11-sp3.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles11-sp3", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe48:617f", "ipaddress6_eth0"=>"fe80::216:3eff:fe48:617f", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.0", "kernelrelease"=>"3.0.101-0.47.67-default", "kernelversion"=>"3.0.101", "load_averages"=>{"15m"=>0.06, "1m"=>0.18, "5m"=>0.08}, "macaddress"=>"00:16:3e:48:61:7f", "macaddress_eth0"=>"00:16:3e:48:61:7f", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"354.30 MiB", "available_bytes"=>371511296, "capacity"=>"27.78%", "total"=>"490.61 MiB", "total_bytes"=>514437120, "used"=>"136.30 MiB", "used_bytes"=>142925824}}, "memoryfree"=>"354.30 MiB", "memoryfree_mb"=>354.30078125, "memorysize"=>"490.61 MiB", "memorysize_mb"=>490.60546875, "mountpoints"=>{"/"=>{"available"=>"47.14 GiB", "available_bytes"=>50611761152, "capacity"=>"4.22%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=continue", "barrier=1", "data=ordered"], "size"=>"49.21 GiB", "size_bytes"=>52843638784, "used"=>"2.08 GiB", "used_bytes"=>2231877632}, "/dev/shm"=>{"available"=>"245.29 MiB", "available_bytes"=>257208320, "capacity"=>"0.00%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"245.30 MiB", "size_bytes"=>257216512, "used"=>"8.00 KiB", "used_bytes"=>8192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"lan.asio", "fqdn"=>"sles11-sp3.lan.asio", "hostname"=>"sles11-sp3", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe48:617f", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, {"address"=>"127.0.0.2", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.3", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"11.3", "major"=>"11", "minor"=>"3"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"586adc21-9cfc-4e12-93e6-c711ab2400b1"}}, "path"=>"/usr/bin:/bin:/usr/sbin:/sbin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.8.2", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5", "sha256"=>"SSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11"}, "key"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17", "sha256"=>"SSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41", "sha256"=>"SSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY=", "sshfp_dsa"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5\nSSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11", "sshfp_ecdsa"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17\nSSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e", "sshfp_rsa"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41\nSSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>524, "uptime"=>"0:08 hours"}, "timezone"=>"UTC", "uptime"=>"0:08 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>524, "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D", "virtual"=>"virtualbox", "clientcert"=>"sles11-sp3.lan.asio", "clientversion"=>"4.8.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'SLES-11.3-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_SLES-12.1-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_SLES-12.1-64_spec.rb new file mode 100644 index 0000000..a8c9033 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_SLES-12.1-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set SLES-12.1-64" do + node_facts = {"aio_agent_build"=>"1.7.2", "aio_agent_version"=>"1.7.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E"}}, "domain"=>"openstack.site", "facterversion"=>"3.4.2", "filesystems"=>"ext2,ext3,ext4", "fqdn"=>"sles12-sp1.openstack.site", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles12-sp1", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth0"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth1"=>"fe80::a00:27ff:fe60:90e", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"192.168.33.15", "ipaddress_lo"=>"127.0.0.1", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.12", "kernelrelease"=>"3.12.62-60.64.8-default", "kernelversion"=>"3.12.62", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.02}, "macaddress"=>"00:16:3e:72:f1:21", "macaddress_eth0"=>"00:16:3e:72:f1:21", "macaddress_eth1"=>"08:00:27:60:09:0e", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.78 GiB", "available_bytes"=>1907027968, "capacity"=>"68.84%", "total"=>"5.70 GiB", "total_bytes"=>6119927808, "used"=>"3.92 GiB", "used_bytes"=>4212899840}}, "memoryfree"=>"1.78 GiB", "memoryfree_mb"=>1818.68359375, "memorysize"=>"5.70 GiB", "memorysize_mb"=>5836.41796875, "mountpoints"=>{"/"=>{"available"=>"45.34 GiB", "available_bytes"=>48682504192, "capacity"=>"7.64%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52709421056, "used"=>"3.75 GiB", "used_bytes"=>4026916864}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"192.168.33.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"openstack.site", "fqdn"=>"sles12-sp1.openstack.site", "hostname"=>"sles12-sp1", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe72:f121", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"bindings"=>[{"address"=>"192.168.33.15", "netmask"=>"255.255.255.0", "network"=>"192.168.33.0"}], "bindings6"=>[{"address"=>"fe80::a00:27ff:fe60:90e", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"192.168.33.15", "ip6"=>"fe80::a00:27ff:fe60:90e", "mac"=>"08:00:27:60:09:0e", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"192.168.33.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"12", "operatingsystemrelease"=>"12.1", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"12.1", "major"=>"12", "minor"=>"1"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "label"=>"ROOT", "mount"=>"/", "partuuid"=>"3d2745bf-01", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"dcf2494f-2b02-466b-aa2c-9e7c01bdbdd7"}}, "path"=>"/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/games", "pe_build"=>"2016.4.3", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_server_version"=>"2016.4.3", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"sles-12-x86_64", "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppetversion"=>"4.7.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1", "sha256"=>"SSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b", "sha256"=>"SSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459", "sha256"=>"SSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51", "sha256"=>"SSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx", "sshfp_dsa"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1\nSSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5", "sshfp_ecdsa"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b\nSSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd", "sshfp_ed25519"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459\nSSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf", "sshfp_rsa"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51\nSSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/", "staging_http_get"=>"curl", "system_uptime"=>{"days"=>1, "hours"=>41, "seconds"=>148058, "uptime"=>"1 day"}, "timezone"=>"UTC", "uptime"=>"1 day", "uptime_days"=>1, "uptime_hours"=>41, "uptime_seconds"=>148058, "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E", "virtual"=>"virtualbox", "clientcert"=>"sles12-sp1.openstack.site", "clientversion"=>"4.7.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'SLES-12.1-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Ubuntu-12.04-32_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-12.04-32_spec.rb new file mode 100644 index 0000000..561aac8 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-12.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Ubuntu-12.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_eth0"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.23, "5m"=>0.09}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:8d:61:88", "macaddress_eth0"=>"08:00:27:8d:61:88", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"407.73 MiB", "available_bytes"=>427540480, "capacity"=>"17.64%", "total"=>"495.05 MiB", "total_bytes"=>519102464, "used"=>"87.32 MiB", "used_bytes"=>91561984}}, "memoryfree"=>"407.73 MiB", "memoryfree_mb"=>407.734375, "memorysize"=>"495.05 MiB", "memorysize_mb"=>495.0546875, "mountpoints"=>{"/"=>{"available"=>"1.81 GiB", "available_bytes"=>1940865024, "capacity"=>"36.14%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.02 GiB", "used_bytes"=>1098407936}, "/boot"=>{"available"=>"203.56 MiB", "available_bytes"=>213447680, "capacity"=>"13.50%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"31.76 MiB", "used_bytes"=>33307648}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"3fff8935-622f-4e9a-944f-38108c71af34"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"185fbdf2-880c-4aa6-ada8-8dade7aa3fc6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"31f2e84f-0e99-4531-9ecb-2b151fc6ce31"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"S8Vl05-TIfO-rk5Y-gIDu-TIwj-L8Ub-3OjoJb"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b", "sha256"=>"SSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0"}, "key"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21", "sha256"=>"SSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f", "sha256"=>"SSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0=", "sshfp_dsa"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b\nSSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0", "sshfp_ecdsa"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21\nSSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668", "sshfp_rsa"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f\nSSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>60, "uptime"=>"0:01 hours"}, "timezone"=>"PST", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>60, "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Ubuntu-12.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Ubuntu-12.04-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-12.04-64_spec.rb new file mode 100644 index 0000000..7aa4a91 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-12.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Ubuntu-12.04-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_eth0"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:5f:df:27", "macaddress_eth0"=>"08:00:27:5f:df:27", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"350.97 MiB", "available_bytes"=>368017408, "capacity"=>"28.33%", "total"=>"489.72 MiB", "total_bytes"=>513507328, "used"=>"138.75 MiB", "used_bytes"=>145489920}}, "memoryfree"=>"350.97 MiB", "memoryfree_mb"=>350.96875, "memorysize"=>"489.72 MiB", "memorysize_mb"=>489.71875, "mountpoints"=>{"/"=>{"available"=>"17.68 GiB", "available_bytes"=>18981703680, "capacity"=>"6.12%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.15 GiB", "used_bytes"=>1237438464}, "/boot"=>{"available"=>"202.55 MiB", "available_bytes"=>212389888, "capacity"=>"13.93%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"32.77 MiB", "used_bytes"=>34365440}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"96092a10-847b-4a55-b5dc-87d2cc56ee5e"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"50695407-158d-4b0e-975a-b575fa5f5359"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"829f03e2-ceb8-4f8d-9f32-e1336456f719"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"P6GCnD-xaHj-APeE-m1Em-fr5a-z3Kk-iFVziN"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630", "sha256"=>"SSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420", "sha256"=>"SSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740", "sha256"=>"SSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q=", "sshfp_dsa"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630\nSSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f", "sshfp_ecdsa"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420\nSSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00", "sshfp_rsa"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740\nSSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>368, "uptime"=>"0:06 hours"}, "timezone"=>"PST", "uptime"=>"0:06 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>368, "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Ubuntu-12.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Ubuntu-14.04-32_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-14.04-32_spec.rb new file mode 100644 index 0000000..da6d88a --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-14.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Ubuntu-14.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_eth0"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.07}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:71:89:45", "macaddress_eth0"=>"08:00:27:71:89:45", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"414.97 MiB", "available_bytes"=>435126272, "capacity"=>"16.34%", "total"=>"496.04 MiB", "total_bytes"=>520130560, "used"=>"81.07 MiB", "used_bytes"=>85004288}}, "memoryfree"=>"414.97 MiB", "memoryfree_mb"=>414.96875, "memorysize"=>"496.04 MiB", "memorysize_mb"=>496.03515625, "mountpoints"=>{"/"=>{"available"=>"1.72 GiB", "available_bytes"=>1846272000, "capacity"=>"39.25%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.11 GiB", "used_bytes"=>1193000960}, "/boot"=>{"available"=>"200.06 MiB", "available_bytes"=>209779712, "capacity"=>"14.98%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"35.26 MiB", "used_bytes"=>36975616}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b31f5de0-8805-43da-b3f2-da9e51c3401b"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"569bc4ac-b4e8-4e62-8503-551a63285383"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"f00f661b-b4b5-4e6f-bba3-3dcacf85fd8e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"vF1RtV-BHmi-b0UW-QR1z-tJ48-g6Tn-aGgEn7"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf", "sha256"=>"SSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1", "sha256"=>"SSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7", "sha256"=>"SSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae", "sha256"=>"SSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq", "sshfp_dsa"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf\nSSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375", "sshfp_ecdsa"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1\nSSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474", "sshfp_ed25519"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7\nSSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d", "sshfp_rsa"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae\nSSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>354, "uptime"=>"0:05 hours"}, "timezone"=>"PST", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>354, "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Ubuntu-14.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Ubuntu-14.04-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-14.04-64_spec.rb new file mode 100644 index 0000000..ba11595 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-14.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Ubuntu-14.04-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"ubuntu1404a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth0"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth1"=>"fe80::a00:27ff:fe61:1916", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.93", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.06, "1m"=>0.49, "5m"=>0.17}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:ea:20:27", "macaddress_eth0"=>"08:00:27:ea:20:27", "macaddress_eth1"=>"08:00:27:61:19:16", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"331.30 MiB", "available_bytes"=>347394048, "capacity"=>"32.35%", "total"=>"489.74 MiB", "total_bytes"=>513531904, "used"=>"158.44 MiB", "used_bytes"=>166137856}}, "memoryfree"=>"331.30 MiB", "memoryfree_mb"=>331.30078125, "memorysize"=>"489.74 MiB", "memorysize_mb"=>489.7421875, "mountpoints"=>{"/"=>{"available"=>"17.58 GiB", "available_bytes"=>18880684032, "capacity"=>"6.62%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.25 GiB", "used_bytes"=>1338458112}, "/boot"=>{"available"=>"198.65 MiB", "available_bytes"=>208301056, "capacity"=>"15.58%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"36.67 MiB", "used_bytes"=>38454272}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8608807, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "hostname"=>"ubuntu1404a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.93", "ip6"=>"fe80::a00:27ff:fe61:1916", "mac"=>"08:00:27:61:19:16", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c94f234c-f947-450d-aaaf-d32be1b7f27f"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"5501b007-e44b-46cf-b22b-177428cbe5d6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"3a97a5b0-ebd0-4ce6-ba62-d39b4fd0719e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vgfiUo-lVmS-57wx-qv4m-N3fR-efa0-iBI6Cn"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"ubuntu-14.04-amd64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c", "sha256"=>"SSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad", "sha256"=>"SSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234", "sha256"=>"SSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51", "sha256"=>"SSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP", "sshfp_dsa"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c\nSSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4", "sshfp_ecdsa"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad\nSSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8", "sshfp_ed25519"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234\nSSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05", "sshfp_rsa"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51\nSSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv", "staging_http_get"=>"curl", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>47, "uptime"=>"0:00 hours"}, "timezone"=>"PDT", "uptime"=>"0:00 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>47, "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115", "virtual"=>"virtualbox", "clientcert"=>"ubuntu1404a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Ubuntu-14.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Ubuntu-18.04-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-18.04-64_spec.rb new file mode 100644 index 0000000..e40f830 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Ubuntu-18.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Ubuntu-18.04-64" do + node_facts = {"aio_agent_version"=>"6.14.0", "architecture"=>"amd64", "augeas"=>{"version"=>"1.12.0"}, "augeasversion"=>"1.12.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>10737418240, "blockdevice_sda_vendor"=>"VBOX", "blockdevice_sdb_model"=>"HARDDISK", "blockdevice_sdb_size"=>10485760, "blockdevice_sdb_vendor"=>"VBOX", "blockdevices"=>"sdb,sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"10.00 GiB", "size_bytes"=>10737418240, "vendor"=>"VBOX"}, "sdb"=>{"model"=>"HARDDISK", "size"=>"10.00 MiB", "size_bytes"=>10485760, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3"}}, "domain"=>"lan.asio", "facterversion"=>"3.14.9", "filesystems"=>"btrfs,ext2,ext3,ext4,iso9660,squashfs,vfat", "fips_enabled"=>false, "fqdn"=>"ubuntu-bionic.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ubuntu-bionic", "hypervisors"=>{"virtualbox"=>{"revision"=>"133895", "version"=>"6.0.14"}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_enp0s3"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.15", "kernelrelease"=>"4.15.0-54-generic", "kernelversion"=>"4.15.0", "load_averages"=>{"15m"=>0.1, "1m"=>0.31, "5m"=>0.23}, "lsbdistcodename"=>"bionic", "lsbdistdescription"=>"Ubuntu 18.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"18.04", "lsbmajdistrelease"=>"18.04", "macaddress"=>"02:bb:7d:e8:e9:23", "macaddress_enp0s3"=>"02:bb:7d:e8:e9:23", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"776.53 MiB", "available_bytes"=>814247936, "capacity"=>"21.19%", "total"=>"985.26 MiB", "total_bytes"=>1033121792, "used"=>"208.73 MiB", "used_bytes"=>218873856}}, "memoryfree"=>"776.53 MiB", "memoryfree_mb"=>776.52734375, "memorysize"=>"985.26 MiB", "memorysize_mb"=>985.26171875, "mountpoints"=>{"/"=>{"available"=>"8.14 GiB", "available_bytes"=>8742756352, "capacity"=>"15.32%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw", "relatime", "data=ordered"], "size"=>"9.63 GiB", "size_bytes"=>10340794368, "used"=>"1.47 GiB", "used_bytes"=>1581260800}, "/dev"=>{"available"=>"480.22 MiB", "available_bytes"=>503545856, "capacity"=>"0%", "device"=>"udev", "filesystem"=>"devtmpfs", "options"=>["rw", "nosuid", "relatime", "size=491744k", "nr_inodes=122936", "mode=755"], "size"=>"480.22 MiB", "size_bytes"=>503545856, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/hugepages"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"hugetlbfs", "filesystem"=>"hugetlbfs", "options"=>["rw", "relatime", "pagesize=2M"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/mqueue"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mqueue", "filesystem"=>"mqueue", "options"=>["rw", "relatime"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/pts"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"devpts", "filesystem"=>"devpts", "options"=>["rw", "nosuid", "noexec", "relatime", "gid=5", "mode=620", "ptmxmode=000"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/shm"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/run"=>{"available"=>"97.93 MiB", "available_bytes"=>102690816, "capacity"=>"0.60%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "noexec", "relatime", "size=100892k", "mode=755"], "size"=>"98.53 MiB", "size_bytes"=>103313408, "used"=>"608.00 KiB", "used_bytes"=>622592}, "/run/lock"=>{"available"=>"5.00 MiB", "available_bytes"=>5242880, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "noexec", "relatime", "size=5120k"], "size"=>"5.00 MiB", "size_bytes"=>5242880, "used"=>"0 bytes", "used_bytes"=>0}, "/run/user/1000"=>{"available"=>"98.52 MiB", "available_bytes"=>103309312, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "relatime", "size=100888k", "mode=700", "uid=1000", "gid=1000"], "size"=>"98.52 MiB", "size_bytes"=>103309312, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/vagrant"=>{"available"=>"122.93 GiB", "available_bytes"=>131996221440, "capacity"=>"85.01%", "device"=>"vagrant", "filesystem"=>"vboxsf", "options"=>["rw", "nodev", "relatime", "iocharset=utf8", "uid=1000", "gid=1000"], "size"=>"820.33 GiB", "size_bytes"=>880824786944, "used"=>"697.40 GiB", "used_bytes"=>748828565504}, "/var/lib/lxcfs"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"lxcfs", "filesystem"=>"fuse.lxcfs", "options"=>["rw", "nosuid", "nodev", "relatime", "user_id=0", "group_id=0", "allow_other"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_enp0s3"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"lan.asio", "fqdn"=>"ubuntu-bionic.lan.asio", "hostname"=>"ubuntu-bionic", "interfaces"=>{"enp0s3"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::bb:7dff:fee8:e923", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "scope6"=>"link"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1", "scope6"=>"host"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"enp0s3", "scope6"=>"link"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"18.04", "operatingsystemrelease"=>"18.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"bionic", "description"=>"Ubuntu 18.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "label"=>"cloudimg-rootfs", "mount"=>"/", "partuuid"=>"654c6dc7-01", "size"=>"10.00 GiB", "size_bytes"=>10736352768, "uuid"=>"8de716dd-d9b2-477f-b818-bb0b1eb036ce"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"6.14.0", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.7"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.7", "scope6"=>"link", "scope6_enp0s3"=>"link", "scope6_lo"=>"host", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c", "sha256"=>"SSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9", "sha256"=>"SSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f", "sha256"=>"SSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622", "sha256"=>"SSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "sshfp_dsa"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c\nSSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656", "sshfp_ecdsa"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9\nSSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99", "sshfp_ed25519"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f\nSSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4", "sshfp_rsa"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622\nSSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>336, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>336, "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3", "virtual"=>"virtualbox", "clientcert"=>"ubuntu-bionic.lan.asio", "clientversion"=>"6.14.0", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Ubuntu-18.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Windows_Server-2008r2-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Windows_Server-2008r2-64_spec.rb new file mode 100644 index 0000000..2f0d29a --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Windows_Server-2008r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Windows_Server-2008r2-64" do + node_facts = {"agent_specified_environment"=>"production", "aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x64", "common_appdata"=>"C:\\ProgramData", "concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"Local Area Connection"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "domain"=>"pdx.puppetlabs.demo", "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.0.2", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"server2008r2a", "id"=>"SERVER2008R2A\\vagrant", "identity"=>{"user"=>"SERVER2008R2A\\vagrant"}, "iis_version"=>"Get-ItemProperty : Cannot find path 'HKLM:\\SOFTWARE\\Microsoft\\InetStp\\' because it does not exist.\nAt line:1 char:18\n+ (Get-ItemProperty <<<< HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString(8,3)\n + CategoryInfo : ObjectNotFound: (HKLM:\\SOFTWARE\\Microsoft\\InetStp\\:String) [Get-ItemProperty], ItemNotFo \n undException\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\n \nYou cannot call a method on a null-valued expression.\nAt line:1 char:97\n+ (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString <<<< (8,3)\n + CategoryInfo : InvalidOperation: (SubString:String) [], RuntimeException\n + FullyQualifiedErrorId : InvokeMethodOnNull\n \n", "interfaces"=>"Local Area Connection 2,Local Area Connection", "ipaddress"=>"10.20.1.101", "ipaddress6"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress6_Local Area Connection"=>"fe80::50f8:86eb:f103:75b%12", "ipaddress6_Local Area Connection 2"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress_Local Area Connection"=>"10.0.2.15", "ipaddress_Local Area Connection 2"=>"10.20.1.101", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.1", "kernelrelease"=>"6.1.7600", "kernelversion"=>"6.1.7600", "macaddress"=>"08:00:27:7B:C7:40", "macaddress_Local Area Connection"=>"08:00:27:AB:52:FB", "macaddress_Local Area Connection 2"=>"08:00:27:7B:C7:40", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"448.14 MiB", "available_bytes"=>469909504, "capacity"=>"56.22%", "total"=>"1023.55 MiB", "total_bytes"=>1073274880, "used"=>"575.41 MiB", "used_bytes"=>603365376}}, "memoryfree"=>"448.14 MiB", "memoryfree_mb"=>448.140625, "memorysize"=>"1023.55 MiB", "memorysize_mb"=>1023.5546875, "mtu_Local Area Connection"=>1500, "mtu_Local Area Connection 2"=>1500, "mysql_server_id"=>8583088, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection 2"=>"ffff:ffff:ffff:ffff::", "netmask_Local Area Connection"=>"255.255.255.0", "netmask_Local Area Connection 2"=>"255.255.255.0", "network"=>"10.20.1.0", "network6"=>"fe80::%13", "network6_Local Area Connection"=>"fe80::%12", "network6_Local Area Connection 2"=>"fe80::%13", "network_Local Area Connection"=>"10.0.2.0", "network_Local Area Connection 2"=>"10.20.1.0", "networking"=>{"domain"=>"pdx.puppetlabs.demo", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hostname"=>"server2008r2a", "interfaces"=>{"Local Area Connection"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::50f8:86eb:f103:75b%12", "mac"=>"08:00:27:AB:52:FB", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}, "Local Area Connection 2"=>{"ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}}, "ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2008 R2", "operatingsystemrelease"=>"2008 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2008 R2", "major"=>"2008 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\ProgramData\\chocolatey\\bin;", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>false, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "serialnumber"=>"0", "staging_http_get"=>"powershell", "staging_windir"=>"C:\\ProgramData\\staging", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>266, "uptime"=>"0:04 hours"}, "timezone"=>"Pacific Daylight Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>266, "virtual"=>"virtualbox", "clientcert"=>"server2008r2a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Windows_Server-2008r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_Windows_Server-2012r2-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_Windows_Server-2012r2-64_spec.rb new file mode 100644 index 0000000..6fe8550 --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_Windows_Server-2012r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set Windows_Server-2012r2-64" do + node_facts = {"agent_specified_environment"=>"production", "architecture"=>"x64", "dhcp_servers"=>{"Ethernet"=>"10.0.2.2", "system"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.1.1", "fqdn"=>"WIN-E5K8TM30719", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"WIN-E5K8TM30719", "id"=>"WIN-E5K8TM30719\\vagrant", "identity"=>{"user"=>"WIN-E5K8TM30719\\vagrant"}, "interfaces"=>"Ethernet", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress6_Ethernet"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress_Ethernet"=>"10.0.2.15", "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.3", "kernelrelease"=>"6.3.9600", "kernelversion"=>"6.3.9600", "macaddress"=>"08:00:27:81:38:FA", "macaddress_Ethernet"=>"08:00:27:81:38:FA", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.42 GiB", "available_bytes"=>1521610752, "capacity"=>"29.13%", "total"=>"2.00 GiB", "total_bytes"=>2147012608, "used"=>"596.43 MiB", "used_bytes"=>625401856}}, "memoryfree"=>"1.42 GiB", "memoryfree_mb"=>1451.12109375, "memorysize"=>"2.00 GiB", "memorysize_mb"=>2047.55078125, "mtu_Ethernet"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Ethernet"=>"ffff:ffff:ffff:ffff::", "netmask_Ethernet"=>"255.255.255.0", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "network6_Ethernet"=>"fe80::%12", "network_Ethernet"=>"10.0.2.0", "networking"=>{"dhcp"=>"10.0.2.2", "fqdn"=>"WIN-E5K8TM30719", "hostname"=>"WIN-E5K8TM30719", "interfaces"=>{"Ethernet"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::a180:36e0:3a6e:1005%12", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::%12"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "primary"=>"Ethernet"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2012 R2", "operatingsystemrelease"=>"2012 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2012 R2", "major"=>"2012 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Git\\cmd;C:\\Program Files (x86)\\Git\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.3", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.7"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.7", "serialnumber"=>"0", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>287, "uptime"=>"0:04 hours"}, "timezone"=>"Coordinated Universal Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>287, "virtual"=>"virtualbox", "clientcert"=>"win-e5k8tm30719", "clientversion"=>"4.2.3", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'Windows_Server-2012r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_solaris-10_u9-sparc-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_solaris-10_u9-sparc-64_spec.rb new file mode 100644 index 0000000..d1f773d --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_solaris-10_u9-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set solaris-10_u9-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-10_u9-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.42", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.42", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"Generic_Virtual", "kernelrelease"=>"5.10", "kernelversion"=>"Generic_Virtual", "load_averages"=>{"15m"=>1.015625, "1m"=>1.89453125, "5m"=>1.25390625}, "macaddress"=>"02:08:20:f1:97:4b", "macaddress_net0"=>"02:08:20:f1:97:4b", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"3.25 GiB", "available_bytes"=>-806297600, "capacity"=>"78.94%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"12.18 GiB", "used_bytes"=>194560000}}, "memoryfree"=>"3.25 GiB", "memoryfree_mb"=>3327.0546875, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"1.14%", "device"=>"rpool/ROOT/zbe-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950161"], "size"=>"480.01 GiB", "size_bytes"=>13566464, "used"=>"5.49 GiB", "used_bytes"=>1602503680}, "/.SUNWnative/lib"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/lib", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/platform"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/platform", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/sbin"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/sbin", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/usr"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/usr", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc10", "nozonemod", "sharezone=36", "dev=8e0001b"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=9040025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e80025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/svc/volatile"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}, "/export"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950163"], "size"=>"474.52 GiB", "size_bytes"=>-1588904448, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950164"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8dc0024"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950165"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e40025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8f00025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/tmp"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.70%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec004a"], "size"=>"5.52 GiB", "size_bytes"=>1632608256, "used"=>"39.52 MiB", "used_bytes"=>41435136}, "/var"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.03%", "device"=>"rpool/ROOT/zbe-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/var", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950162"], "size"=>"474.66 GiB", "size_bytes"=>-1436724224, "used"=>"145.16 MiB", "used_bytes"=>152212992}, "/var/run"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"/etc/svc/volatile/", "filesystem"=>"lofs", "options"=>["rstchown", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"domain"=>"puppet.example", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "hostname"=>"solaris-10_u9-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.42", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10_u9", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"10_u9", "major"=>"10", "minor"=>"9"}}, "osfamily"=>"Solaris", "path"=>"/usr/local/bin:/usr/local/sbin:/opt/csw/bin:PATH:/opt/puppetlabs/bin:/usr/local/bin:/usr/local/sbin:/opt/csw/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-10-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>" SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.10", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.10", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"solaris-10_u9-sparc-t4-64", "zones"=>{"solaris-10_u9-sparc-t4-64"=>{"brand"=>"solaris10", "id"=>"36", "ip_type"=>"excl", "path"=>"/", "status"=>"running"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798", "sha256"=>"SSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15"}, "key"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4", "sha256"=>"SSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg==", "sshfp_dsa"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798\nSSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15", "sshfp_rsa"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4\nSSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U=", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1860, "uptime"=>"0:31 hours"}, "timezone"=>"PDT", "uptime"=>"0:31 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1860, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc10_brand"=>"solaris10", "zone_cisparc10_id"=>"36", "zone_cisparc10_iptype"=>"excl", "zone_cisparc10_name"=>"solaris-10_u9-sparc-t4-64", "zone_cisparc10_path"=>"/", "zone_cisparc10_status"=>"running", "zonename"=>"solaris-10_u9-sparc-t4-64", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-10_u9-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'solaris-10_u9-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_solaris-11.2-sparc-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_solaris-11.2-sparc-64_spec.rb new file mode 100644 index 0000000..e1336fa --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_solaris-11.2-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set solaris-11.2-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "dhcp_servers"=>{"net0"=>"10.32.22.10", "system"=>"10.32.22.10"}, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-11_2-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.68", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.68", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"11", "kernelrelease"=>"5.11", "kernelversion"=>"11.2", "load_averages"=>{"15m"=>1.0234375, "1m"=>1.21875, "5m"=>1.28125}, "macaddress"=>"02:08:20:41:26:8c", "macaddress_net0"=>"02:08:20:41:26:8c", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"2.34 GiB", "available_bytes"=>-1777401856, "capacity"=>"84.80%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"13.09 GiB", "used_bytes"=>1165664256}}, "memoryfree"=>"2.34 GiB", "memoryfree_mb"=>2400.9375, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.18%", "device"=>"rpool/ROOT/solaris-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017b"], "size"=>"476.16 GiB", "size_bytes"=>175171072, "used"=>"889.53 MiB", "used_bytes"=>932736000}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc", "nozonemod", "sharezone=38", "dev=8e0001c"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=9040027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/dfs/sharetab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"sharefs", "filesystem"=>"sharefs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f40016"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e80027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/export"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017f"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950180"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8dc0026"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950181"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e40027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f00027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/volatile"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004d"], "size"=>"4.53 GiB", "size_bytes"=>572342272, "used"=>"576.00 KiB", "used_bytes"=>589824}, "/tmp"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.95%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004e"], "size"=>"4.58 GiB", "size_bytes"=>618414080, "used"=>"44.50 MiB", "used_bytes"=>46661632}, "/var"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.05%", "device"=>"rpool/ROOT/solaris-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/var", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017d"], "size"=>"475.51 GiB", "size_bytes"=>-521269760, "used"=>"225.35 MiB", "used_bytes"=>236295168}, "/var/share"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017e"], "size"=>"475.30 GiB", "size_bytes"=>-756610048, "used"=>"932.50 KiB", "used_bytes"=>954880}, "/var/share/pkg"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950182"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/var/share/pkg/repositories"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg/repositories", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950183"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"dhcp"=>"10.32.22.10", "domain"=>"puppet.example", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "hostname"=>"solaris-11_2-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.68", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "dhcp"=>"10.32.22.10", "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.2", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"11.2", "major"=>"11", "minor"=>"2"}}, "osfamily"=>"Solaris", "path"=>"PATH:/opt/puppetlabs/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-11-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>"SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.11", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.11", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"cisparc", "zones"=>{"cisparc"=>{"brand"=>"solaris", "id"=>"38", "ip_type"=>"excl", "path"=>"/", "status"=>"running", "uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f", "sha256"=>"SSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607"}, "key"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3", "sha256"=>"SSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA=", "sshfp_dsa"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f\nSSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607", "sshfp_rsa"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3\nSSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw==", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>2, "hours"=>62, "seconds"=>225780, "uptime"=>"2 days"}, "timezone"=>"PDT", "uptime"=>"2 days", "uptime_days"=>2, "uptime_hours"=>62, "uptime_seconds"=>225780, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc_brand"=>"solaris", "zone_cisparc_id"=>"38", "zone_cisparc_iptype"=>"excl", "zone_cisparc_name"=>"cisparc", "zone_cisparc_path"=>"/", "zone_cisparc_status"=>"running", "zone_cisparc_uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782", "zonename"=>"cisparc", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-11_2-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'solaris-11.2-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__puppetserver_on_windows-10-64_spec.rb b/.onceover/spec/classes/role__puppetserver_on_windows-10-64_spec.rb new file mode 100644 index 0000000..25d856a --- /dev/null +++ b/.onceover/spec/classes/role__puppetserver_on_windows-10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::puppetserver" do + + context "using fact set windows-10-64" do + node_facts = {"puppetversion"=>"6.0.2", "puppet_inventory_metadata"=>{"packages"=>{"collection_enabled"=>false, "last_collection_time"=>"0.0s"}}, "package_provider"=>"windows", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "is_pe"=>false, "platform_symlink_writable"=>false, "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppet_environmentpath"=>"C:/ProgramData/PuppetLabs/code/environments", "puppet_server"=>"pe-puppet.localdomain", "service_provider"=>"windows", "staging_http_get"=>"curl", "common_appdata"=>"C:\\ProgramData", "architecture"=>"x64", "kernel"=>"windows", "virtual"=>"vmware", "is_virtual"=>true, "hardwaremodel"=>"x64", "operatingsystem"=>"windows", "os"=>{"name"=>"windows", "family"=>"windows", "release"=>{"major"=>"10", "full"=>"10"}}, "facterversion"=>"2.5.1", "fqdn"=>"VAGRANT-HB9G3RD", "hostname"=>"VAGRANT-HB9G3RD", "id"=>"vagrant-hb9g3rd\\vagrant", "interfaces"=>"Ethernet0_2", "ipaddress_ethernet0_2"=>"192.168.43.174", "ipaddress6_ethernet0_2"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "macaddress_ethernet0_2"=>"00:0C:29:A3:53:54", "netmask_ethernet0_2"=>"255.255.255.0", "mtu_ethernet0_2"=>0, "ipaddress"=>"192.168.43.174", "ipaddress6"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "kernelmajversion"=>"10.0", "kernelrelease"=>"10.0.17134", "kernelversion"=>"10.0.17134", "macaddress"=>"00:0C:29:A3:53:54", "manufacturer"=>"Phoenix Technologies LTD", "serialnumber"=>"VMware-56 4d 36 2e 2e a4 81 f9-0d 05 ae d0 e5 a3 53 54", "productname"=>"VMware Virtual Platform", "memorysize"=>"4.00 GB", "memoryfree"=>"2.30 GB", "memorysize_mb"=>"4095.49", "memoryfree_mb"=>"2360.00", "netmask"=>"255.255.255.0", "network_ethernet0_2"=>"192.168.43.0", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10", "osfamily"=>"windows", "path"=>"C:\\tools\\ruby24\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files (x86)\\vim\\vim80;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Users\\vagrant\\AppData\\Local\\Microsoft\\WindowsApps;", "physicalprocessorcount"=>4, "processors"=>{"models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "count"=>4, "physicalcount"=>4}, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "ps"=>"tasklist.exe", "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/tools/ruby24/lib/ruby/site_ruby/2.4.0", "rubyversion"=>"2.4.3", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"seconds"=>1113359, "hours"=>309, "days"=>12, "uptime"=>"12 days"}, "timezone"=>"GMT Standard Time", "uptime"=>"12 days", "uptime_days"=>12, "uptime_hours"=>309, "uptime_seconds"=>1113359, "clientcert"=>"vagrant-hb9g3rd.lan.asio", "clientversion"=>"6.0.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::puppetserver' +$onceover_node = 'windows-10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_AIX-6.1-powerpc_spec.rb b/.onceover/spec/classes/role__windows_on_AIX-6.1-powerpc_spec.rb new file mode 100644 index 0000000..ded2bd4 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_AIX-6.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set AIX-6.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.8.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.5.0", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-61-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.35", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.35", "ipaddress_lo0"=>"127.0.0.1", "kernel"=>"AIX", "kernelmajversion"=>"6100", "kernelrelease"=>"6100-07-04-1216", "kernelversion"=>"6100", "macaddress"=>"66:a4:d9:f8:4a:04", "macaddress_en0"=>"66:a4:d9:f8:4a:04", "memory"=>{"swap"=>{"available"=>"410.43 MiB", "available_bytes"=>430366720, "capacity"=>"19.84%", "total"=>"512.00 MiB", "total_bytes"=>536870912, "used"=>"101.57 MiB", "used_bytes"=>106504192}, "system"=>{"available"=>"10.88 MiB", "available_bytes"=>11403264, "capacity"=>"98.94%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1013.13 MiB", "used_bytes"=>1062338560}}, "memoryfree"=>"10.88 MiB", "memoryfree_mb"=>10.875, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-61-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-61-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.35", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.35", "mac"=>"66:a4:d9:f8:4a:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"6100", "operatingsystemrelease"=>"6100-07-04-1216", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"6100-07-04-1216", "major"=>"6100"}}, "osfamily"=>"AIX", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppetversion"=>"4.8.1", "ruby"=>{"platform"=>"powerpc-aix6.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix6.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2", "sha256"=>"SSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d", "sha256"=>"SSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPJEJEzFa4YmVyS17c4Cs8ZWFJIg+igYRWiG/oJ4KMAu9R+cq3TuokGp0h5/T69yNeOn32h1WPYPIjnr14FyOr5Bb6+h+ej3WKnS1IpAGSy2H8Z21r4Cz0qX+madm/dGrtN1TI+6OV1xXXICZB0F0Lg4xilzix431nGunqbm1XXLAAAAFQDjxidL5XtudVMcTUzGFQ33cVwdTwAAAIBUjvKhMQP1304lW+Fr7A35ypaQrCVbsJFQD4egb9fGKY5WKIlQo7UGS/jvDtPS7iRDaLdiC2K5D4MYM9EUHgkprIO1d/o0i2UsYgec8WCJSBja/I4n0slEl7XEwM3SmnYNT0xfZM01Caj9+AyJFtRoF7l00QjSoxyOGMlEfvbCDAAAAIEA8MTmNjwDneigJnnxK9ZL4cvW4zQ+PQDglCdjJ2sB/IcpSvVyu6R9jbHSnfKhergRmmNJzKNA1Oc/INvNr4i9FFAuXEKkafmUyMavgd19uMxdpTAcvOJxwhG8TCrLQtJbm8Rn1e5wFM+4wnpc2y7HsBYGonmK9O5p9Fd3qkUx4BY=", "sshfp_dsa"=>"SSHFP 2 1 571109ba578ea17c854dcefad0e667bbbe4232c2\nSSHFP 2 2 acd6ea2ff8cc0a0a8be88e6dada2688a17b7adb2a52312745208696f99dce945", "sshfp_rsa"=>"SSHFP 1 1 2faed3b06ba31bcbf069dcdb759d36730a2c649d\nSSHFP 1 2 51fbfd79200a8667eeb1a8a4eee2487bbdee663189a9ca86a07069f5d95f9826", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDP+DHJRMbR8a4WvTwUGnz9rq+hHDVcP26xG+WIvIC5vlBk/N2lcrD7qs45Ht1kpZo4k4td+PQmi2k6I3BSVEeR9FTwbHEtjv8op1F7VTPXSSdY+90/CiQ4MA5s7d2Lbm5jipMV6dCneYZWsEkHKHzcp/Qst3w+0JSAHpx1wEOAlk/uJuLHHvAFYPZtdwzxTOW8/di5CpBIz/Pl1gcO8vQrFygvkFdYKPL44/zS3MZbmi7Hi6Q0PdcarFlWn6IodAlVSrJ/hcBbMkXJWV2L3zCt5nX4tJkYoOU9IIjGQEh+1cmIcWGdXpyvyaUnbSXJsFP9yAzi+MszYLJq9mUKIYch", "swapfree"=>"410.43 MiB", "swapfree_mb"=>410.4296875, "swapsize"=>"512.00 MiB", "swapsize_mb"=>512.0, "system_uptime"=>{"days"=>418, "hours"=>10035, "seconds"=>36127200, "uptime"=>"418 days"}, "timezone"=>"PST", "uptime"=>"418 days", "uptime_days"=>418, "uptime_hours"=>10035, "uptime_seconds"=>36127200, "clientcert"=>"pe-aix-61-se.delivery.puppetlabs.net", "clientversion"=>"4.8.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'AIX-6.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_AIX-7.1-powerpc_spec.rb b/.onceover/spec/classes/role__windows_on_AIX-7.1-powerpc_spec.rb new file mode 100644 index 0000000..70eda23 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_AIX-7.1-powerpc_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set AIX-7.1-powerpc" do + node_facts = {"aio_agent_version"=>"1.5.2", "architecture"=>"PowerPC_POWER7", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "domain"=>"delivery.puppetlabs.net", "facterversion"=>"3.2.0", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "gid"=>"system", "hardwareisa"=>"powerpc", "hardwaremodel"=>"IBM,8231-E1D", "hostname"=>"pe-aix-71-se", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"system", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,en0", "ipaddress"=>"10.32.77.36", "ipaddress6_lo0"=>"::1", "ipaddress_en0"=>"10.32.77.36", "ipaddress_lo0"=>"127.0.0.1", "is_pe"=>false, "kernel"=>"AIX", "kernelmajversion"=>"7100", "kernelrelease"=>"7100-01-05-1228", "kernelversion"=>"7100", "macaddress"=>"66:a4:dc:28:bf:04", "macaddress_en0"=>"66:a4:dc:28:bf:04", "memory"=>{"swap"=>{"available"=>"1007.14 MiB", "available_bytes"=>1056063488, "capacity"=>"1.65%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"16.86 MiB", "used_bytes"=>17678336}, "system"=>{"available"=>"16.84 MiB", "available_bytes"=>17653760, "capacity"=>"98.36%", "total"=>"1.00 GiB", "total_bytes"=>1073741824, "used"=>"1007.16 MiB", "used_bytes"=>1056088064}}, "memoryfree"=>"16.84 MiB", "memoryfree_mb"=>16.8359375, "memorysize"=>"1.00 GiB", "memorysize_mb"=>1024.0, "mtu_en0"=>1500, "mtu_lo0"=>16896, "netmask"=>"255.255.255.0", "netmask6_lo0"=>"::", "netmask_en0"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "network"=>"10.32.77.0", "network6_lo0"=>"::", "network_en0"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "networking"=>{"domain"=>"delivery.puppetlabs.net", "fqdn"=>"pe-aix-71-se.delivery.puppetlabs.net", "hostname"=>"pe-aix-71-se", "interfaces"=>{"en0"=>{"bindings"=>[{"address"=>"10.32.77.36", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}, "lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"::", "network"=>"::"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16896, "netmask"=>"255.0.0.0", "netmask6"=>"::", "network"=>"127.0.0.0", "network6"=>"::"}}, "ip"=>"10.32.77.36", "mac"=>"66:a4:dc:28:bf:04", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"en0"}, "operatingsystem"=>"AIX", "operatingsystemmajrelease"=>"7100", "operatingsystemrelease"=>"7100-01-05-1228", "os"=>{"architecture"=>"PowerPC_POWER7", "family"=>"AIX", "hardware"=>"IBM,8231-E1D", "name"=>"AIX", "release"=>{"full"=>"7100-01-05-1228", "major"=>"7100"}}, "osfamily"=>"AIX", "package_provider"=>"aix", "path"=>"::/usr/bin:/etc:/usr/sbin:/sbin", "processor0"=>"PowerPC_POWER7", "processor1"=>"PowerPC_POWER7", "processor2"=>"PowerPC_POWER7", "processor3"=>"PowerPC_POWER7", "processor4"=>"PowerPC_POWER7", "processor5"=>"PowerPC_POWER7", "processor6"=>"PowerPC_POWER7", "processor7"=>"PowerPC_POWER7", "processorcount"=>8, "processors"=>{"count"=>8, "isa"=>"powerpc", "models"=>["PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7", "PowerPC_POWER7"], "speed"=>"4.23 GHz"}, "puppet_environmentpath"=>"/etc/puppetlabs/code/environments", "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.5.2", "root_home"=>"/root", "ruby"=>{"platform"=>"powerpc-aix7.1.0.0", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"powerpc-aix7.1.0.0", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "serialnumber"=>"21280CV", "service_provider"=>"src", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c", "sha256"=>"SSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5", "sha256"=>"SSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI5I6MVkSh3bO0WVTWIxbB0VyoFrpIXjAtBBveHKQDiB5I9OmCGkzytyR7ERBG/yqFS04hcEX8JV//3DoJeLJ0vupRCDLr4HoTYDGS3Dkvb3wqLn8aaaadz4Ca8IgRbx0vr8ANQbu/XT0/eTv5fRs3YWeijPe4Zgto2x55Ap7UDlAAAAFQDtb/7QYsDVPUt0dVWhOehzBNvybwAAAIBTxxfl95ZRcFG7b2cWljphohnZGzZCJortjE76JBIhnXRlVnlXQFT98hrjkPwedjsj9KWM0RpiKOdas3QAM6iTWLoAv/4GcvAWDa7TuJ5fs3eeQO0yCsTzRzpPwkOv6dcHK6OWWLiGybf/kPxIb546COFONVekdyIdksfZzwJ41QAAAIEAgj+4V9gdRBZcOX7XchaNUPaezTc3pNG1HG8iYTiCTV28EkpkQgzMtW7pPU1Nzqv5CX0LnFS+QN4lTWtuqtADYWSu3soz+7GuL8u3vximAAp6RcmWYSRpIdIQkHGvcyAzT5LlNRhGc/bBPM6RNoCkPzjEDHJDOgTdPx+tRNWXb8Y=", "sshfp_dsa"=>"SSHFP 2 1 1bbfbd9caff8924d4584cbb2a748f1be2690d04c\nSSHFP 2 2 73ec4c25ea880adfbb7f66c60e92fec0ff130c4988765b5799e4707a7cdde68a", "sshfp_rsa"=>"SSHFP 1 1 8957e5a6df12f351fd768ee9615b3906861ff4e5\nSSHFP 1 2 5a2dddf4df75bc8f4f352d30a8192824e01386b4720708d249edec6f05c5eb81", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC38I+hMQxC/++t3XvgXPtpVglDV2Qp5Xqqp/ZmdJrW7gh3ylKWlOrJOlx72p9Qa2fTAU+eJpYeI8vAAKxtBqqoxVNfn9rGt8wR3eubcwm6CRLTCOqf2OoDJzyJw3RcgidhHuT2KPVYtNOpNEkFyTjtpru3RWrO08PLpT0simATc5XJrvSH9ODQCqzVi5Fhe58Kn1kyAmH9gr0vz/9zrhllBjxVhc3YFz2TKqnZD+zIYlYhoI1vm5zQSzUWA+8B9XBEGs3TUaSDKPANEwof2lt+auTHySlGRXTPL4D9mYw2BhrxRBESgLsbba23SVCMGPILDvb4JwI4vYc7E6AvrFIB", "swapfree"=>"1007.14 MiB", "swapfree_mb"=>1007.140625, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1024.0, "system_uptime"=>{"days"=>160, "hours"=>3847, "seconds"=>13852500, "uptime"=>"160 days"}, "timezone"=>"PST", "uptime"=>"160 days", "uptime_days"=>160, "uptime_hours"=>3847, "uptime_seconds"=>13852500, "clientcert"=>"pe-aix-71-se.delivery.puppetlabs.net", "clientversion"=>"4.5.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'AIX-7.1-powerpc' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Amazon-2018.03_spec.rb b/.onceover/spec/classes/role__windows_on_Amazon-2018.03_spec.rb new file mode 100644 index 0000000..d861a7b --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Amazon-2018.03_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Amazon-2018.03" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"10/16/2017", "bios_vendor"=>"Amazon EC2", "bios_version"=>"1.0", "blockdevice_nvme0n1_model"=>"Amazon Elastic Block Store", "blockdevice_nvme0n1_size"=>8589934592, "blockdevices"=>"nvme0n1", "boardassettag"=>"i-0816d4c53ff8dc6a2", "boardmanufacturer"=>"Amazon EC2", "chassisassettag"=>"Amazon EC2", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"172.31.0.1", "system"=>"172.31.0.1"}, "disks"=>{"nvme0n1"=>{"model"=>"Amazon Elastic Block Store", "size"=>"8.00 GiB", "size_bytes"=>8589934592}}, "dmi"=>{"bios"=>{"release_date"=>"10/16/2017", "vendor"=>"Amazon EC2", "version"=>"1.0"}, "board"=>{"asset_tag"=>"i-0816d4c53ff8dc6a2", "manufacturer"=>"Amazon EC2"}, "chassis"=>{"asset_tag"=>"Amazon EC2", "type"=>"Other"}, "manufacturer"=>"Amazon EC2", "product"=>{"name"=>"t3a.xlarge", "serial_number"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA"}}, "domain"=>"us-west-2.compute.internal", "ec2_metadata"=>{"ami-id"=>"ami-01e24be29428c15b2", "ami-launch-index"=>"0", "ami-manifest-path"=>"(unknown)", "block-device-mapping"=>{"ami"=>"xvda", "root"=>"/dev/xvda"}, "events"=>{"maintenance"=>{"history"=>"[]", "scheduled"=>"[]"}}, "hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "identity-credentials"=>{"ec2"=>{"info"=>"{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2019-05-07T01:03:28Z\",\n \"AccountId\" : \"581165678935\"\n}"}}, "instance-action"=>"none", "instance-id"=>"i-0816d4c53ff8dc6a2", "instance-type"=>"t3a.xlarge", "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "metrics"=>{"vhostmd"=>""}, "network"=>{"interfaces"=>{"macs"=>{"0a:ca:e0:39:c1:f6"=>{"device-number"=>"0", "interface-id"=>"eni-04e7710af3cf1699c", "ipv4-associations"=>{"34.209.204.164"=>"172.31.3.153"}, "local-hostname"=>"ip-172-31-3-153.us-west-2.compute.internal", "local-ipv4s"=>"172.31.3.153", "mac"=>"0a:ca:e0:39:c1:f6", "owner-id"=>"581165678935", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4s"=>"34.209.204.164", "security-group-ids"=>"sg-05a2c52388c24f3ae", "security-groups"=>"launch-wizard-2", "subnet-id"=>"subnet-3bafc660", "subnet-ipv4-cidr-block"=>"172.31.0.0/20", "vpc-id"=>"vpc-287af44e", "vpc-ipv4-cidr-block"=>"172.31.0.0/16", "vpc-ipv4-cidr-blocks"=>"172.31.0.0/16"}}}}, "placement"=>{"availability-zone"=>"us-west-2c"}, "profile"=>"default-hvm", "public-hostname"=>"ec2-34-209-204-164.us-west-2.compute.amazonaws.com", "public-ipv4"=>"34.209.204.164", "public-keys"=>{"0"=>{"openssh-key"=>"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDk1QR+MwLPRohIOiWbCC8xjJKFYeCjIh2g2wAKnZFCkPjCG9BD3L4URnszJXdv+5XylfWO1y9O1Z95etjWfObApRZ5Ej22Dz1EExWWRNOKl9QdrEfCACSlc5gbT5rflHd/He9eD5OFRHlMY8fNIApEKdQrlxZgr1/NOusVQggoS/MiszxCl0dob3kz86XX6PrAmMyGfv7j/mPeeEUzP3bGxtjJyaZGcwukjPvlgq1yI4AzZlveY8fnokRsh9uDHXUEVB2hLNaBBZB/Evw261J/+QsnKopAuqQpwct/n/ulbg+w1h/2ZBiDXDBK8DQ8kOC4zuum6qwri1KNKdX9zIif thinkpad"}}, "reservation-id"=>"r-0b89c0e198506ec1f", "security-groups"=>"launch-wizard-2", "services"=>{"domain"=>"amazonaws.com", "partition"=>"aws"}}, "facterversion"=>"3.12.4", "filesystems"=>"ext3,ext4", "fips_enabled"=>false, "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ip-172-31-3-153", "hypervisors"=>{"kvm"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"172.31.3.153", "ipaddress6"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_eth0"=>"fe80::8ca:e0ff:fe39:c1f6", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"172.31.3.153", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.14", "kernelrelease"=>"4.14.77-70.59.amzn1.x86_64", "kernelversion"=>"4.14.77", "load_averages"=>{"15m"=>0.02, "1m"=>0.12, "5m"=>0.06}, "macaddress"=>"0a:ca:e0:39:c1:f6", "macaddress_eth0"=>"0a:ca:e0:39:c1:f6", "manufacturer"=>"Amazon EC2", "memory"=>{"system"=>{"available"=>"15.36 GiB", "available_bytes"=>16489611264, "capacity"=>"1.10%", "total"=>"15.53 GiB", "total_bytes"=>16673153024, "used"=>"175.04 MiB", "used_bytes"=>183541760}}, "memoryfree"=>"15.36 GiB", "memoryfree_mb"=>15725.71875, "memorysize"=>"15.53 GiB", "memorysize_mb"=>15900.7578125, "mountpoints"=>{"/"=>{"available"=>"6.55 GiB", "available_bytes"=>7033344000, "capacity"=>"15.45%", "device"=>"/dev/nvme0n1p1", "filesystem"=>"ext4", "options"=>["rw", "noatime", "data=ordered"], "size"=>"7.75 GiB", "size_bytes"=>8318783488, "used"=>"1.20 GiB", "used_bytes"=>1285439488}, "/dev/shm"=>{"available"=>"7.76 GiB", "available_bytes"=>8336576512, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"7.76 GiB", "size_bytes"=>8336576512, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>9001, "mtu_lo"=>65536, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.240.0", "netmask_lo"=>"255.0.0.0", "network"=>"172.31.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"172.31.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"172.31.0.1", "domain"=>"us-west-2.compute.internal", "fqdn"=>"ip-172-31-3-153.us-west-2.compute.internal", "hostname"=>"ip-172-31-3-153", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"172.31.3.153", "netmask"=>"255.255.240.0", "network"=>"172.31.0.0"}], "bindings6"=>[{"address"=>"fe80::8ca:e0ff:fe39:c1f6", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"172.31.0.1", "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"172.31.3.153", "ip6"=>"fe80::8ca:e0ff:fe39:c1f6", "mac"=>"0a:ca:e0:39:c1:f6", "mtu"=>9001, "netmask"=>"255.255.240.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"172.31.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"Amazon", "operatingsystemmajrelease"=>"2018", "operatingsystemrelease"=>"2018.03", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"Amazon", "release"=>{"full"=>"2018.03", "major"=>"2018", "minor"=>"03"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/nvme0n1p1"=>{"filesystem"=>"ext4", "label"=>"/", "mount"=>"/", "partlabel"=>"Linux", "partuuid"=>"893c59db-bd86-4d67-b40f-221bc82c14c8", "size"=>"8.00 GiB", "size_bytes"=>8587820544, "uuid"=>"f25f5092-0401-4edb-9fac-c57f3c673803"}, "/dev/nvme0n1p128"=>{"partlabel"=>"BIOS Boot Partition", "partuuid"=>"9d1c14c8-e25b-4405-9171-de3c756f61b2", "size"=>"1.00 MiB", "size_bytes"=>1048576}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin", "physicalprocessorcount"=>1, "processor0"=>"AMD EPYC 7571", "processor1"=>"AMD EPYC 7571", "processor2"=>"AMD EPYC 7571", "processor3"=>"AMD EPYC 7571", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571", "AMD EPYC 7571"], "physicalcount"=>1}, "productname"=>"t3a.xlarge", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>false, "serialnumber"=>"ec21b37d-28ce-a3c2-956e-527e2857aeda", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd", "sha256"=>"SSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f"}, "key"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4", "sha256"=>"SSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc", "sha256"=>"SSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28", "sha256"=>"SSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALzgFDQ4Hu4sjtB0gYwh2uv/00U15avjHKLuffc1+rDmjnoW99OlbeijOb9nPBTDR/+OkAJuVzFdfP/EmPAajAMSE2bOPn5jgNBoKdw7g4LMhtRGomJ8ZxJ9kphYbFaq1JdX6a06HSJHn8RlkV6MV9WYnGQiE89e/7kf3krFssXJAAAAFQDuL8oufyAzYtkWvApZlOX+UlFvxwAAAIEAhibNA8agHCpQIrswmMj9PUOhEVx3OqS/F+0TB/vOqWdubFK97zlt56biu+2R2gHNCiqyiGorBA83xonkHrdjn44Nw2KsZVE9xR4BCbqIyrkwQkWbTHfGYwq0QCo9UyuTdrhen2FnFdZXsQw4b4mcedNDxSPzgLy9Pl/EAVINm6EAAACBAJOfk9MzOocneM35ROEMKRZV5oWFwkglRg/qT3Xcvc3PabEUKlTWQs65fVlVkyipri/0cIuPEo8NKUFJ614FHYGedgja2lFz4xEAonJX3wG3c4GSdbv9uMJT0K1p3zbfCuBoZ9my2nJvWBYPYrXvZgXMt48ewJHMy3HlTnhNSklI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL2ZVP/li7lMY6UrniJHcWOjBvTs1xdw2NQlmzLtuyaPhnolyh2uwoZctB5tOnlG97NlGqkBKV9pl7+fplDWip0=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHtcpSu4oquHdhVu57O9BP/sHvy1vgMuEWZ2Aoq1elFP", "sshfp_dsa"=>"SSHFP 2 1 0b8e09e2fe5c820230d717a8f1c4bfd4bcb11dfd\nSSHFP 2 2 956e88a3dd192f4a401c05deccf92985b16542027b7a77d36172a3c014c8491f", "sshfp_ecdsa"=>"SSHFP 3 1 8fc1a45df472f27fd3fa19cd5e6df68434fa60d4\nSSHFP 3 2 c4b4bb4362c47a3d0feaf030779e1bf06e2fd95911b1f8636ad2032b57cf087b", "sshfp_ed25519"=>"SSHFP 4 1 10e0fcb0020748f776ff7178310be3e8e1c788bc\nSSHFP 4 2 ef9e38c12ab7fa4e4eb82e26d6707110352d82a5beae30887f3de96e7a83fb8f", "sshfp_rsa"=>"SSHFP 1 1 70e536ec33e8312c25b6c606546d7acb2f471e28\nSSHFP 1 2 ee810f2ab351653e9c2ca93270f9c73eb31dd824318b50af72d0afbe31d5d462", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDT/8RUum1jt8FZg8GJRvjjOQyU1VLn1199yjI4xr4aSx7yAmm3eHb5bsSPsxxPUMnlWcd8bq0hWQ5VI2G2WQfUpM4Tyx+wRnGdU1SB7xY8Flzg7w0JOIIIKf1ulxcscacCnGR2y/6rJUkdYVsiCKMADuQ6MUpqA6jLbWHAv8dJlvfq/vtCxBtTOzbhlWmmuvo0WPGXEmHW8Hvj94wcPkvRbf/Pohn+A5NrGs1SlIetn+N6tnK6CPK/g1dNMomPTwU+1+yAIUdTMedJPEeiB8pX5ydDhmO0X76KcXmaqIGvPWWMPEBoPKH8f/IFauOqkoaSAycdKBLYEUbb0iDIlXG1", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>136, "uptime"=>"0:02 hours"}, "timezone"=>"UTC", "uptime"=>"0:02 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>136, "uuid"=>"EC21B37D-28CE-A3C2-956E-527E2857AEDA", "virtual"=>"kvm", "clientcert"=>"ip-172-31-3-153.us-west-2.compute.internal", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Amazon-2018.03' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_CentOS-5.11-32_spec.rb b/.onceover/spec/classes/role__windows_on_CentOS-5.11-32_spec.rb new file mode 100644 index 0000000..075eaf3 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_CentOS-5.11-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set CentOS-5.11-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>0, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>0}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:febf:56", "ipaddress6_eth0"=>"fe80::a00:27ff:febf:56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.11, "1m"=>0.28, "5m"=>0.22}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:bf:00:56", "macaddress_eth0"=>"08:00:27:bf:00:56", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"429.48 MiB", "available_bytes"=>450342912, "capacity"=>"14.58%", "total"=>"502.80 MiB", "total_bytes"=>527220736, "used"=>"73.32 MiB", "used_bytes"=>76877824}}, "memoryfree"=>"429.48 MiB", "memoryfree_mb"=>429.48046875, "memorysize"=>"502.80 MiB", "memorysize_mb"=>502.796875, "mountpoints"=>{"/"=>{"available"=>"1.09 GiB", "available_bytes"=>1171632128, "capacity"=>"52.22%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"2.28 GiB", "size_bytes"=>-1842671616, "used"=>"1.19 GiB", "used_bytes"=>1280663552}, "/boot"=>{"available"=>"86.58 MiB", "available_bytes"=>90790912, "capacity"=>"12.29%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.13 MiB", "used_bytes"=>12721152}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:febf:56", "mac"=>"08:00:27:bf:00:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f", "sha256"=>"SSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940"}, "key"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5", "sha256"=>"SSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANIQgUl4dqCF84m1riBm7rlb5j6v6Dco/P7w0+AE0by81oHLA/i2V89okSrenm2scb4/u57ZpR/GeyVaLzicLyUjBICBwPOsv/+eLnVUtL/+vXwnVleBqaZn+2FUswdkz+J4QiDRSyl78kAkLMAFqEfNimMUB12DirtvgYIFqKaZAAAAFQDTiJhQ0rCPN0ax1rHbjLAMYYoCLwAAAIBWYAzgNYnG5TCzHWSdQZHeJPItH3MUrLFgggb3H9kFZBKCLSBW/EWV1s27G8a1Hd9JAsGEwDGBHn2VLz4uMSssEbJpdJY4jeRmeqeyqZ7My+83XLu0stm2xu6Tt7dwH//DPTTS1XmFXYdx/3tR5JWBIUm6yTb1WS43WUTSyxyPCQAAAIEAzyoULrHnqiBjuJeLB/2OF1vnRT58D53Vd3cQW1xZwyzsPSralv2lMGW0rGaduGrFQjCrDQk0k1fajZnjFX3qfdxaflFCgz2I1W46AcrGXeFy7AlRlCIE1LZtYGd04l3ERiqcUQT+vk2Jv54qMUwSQeyYWY67XcAnglf5GLqwqMo=", "sshfp_dsa"=>"SSHFP 2 1 3a63a36b70f2d9a56a9dc3a1159a64ff9f89536f\nSSHFP 2 2 610f5aaa0dc46e30df3fb0ecac0eb3e00e7cac79d610c8c9a2a1eac341244940", "sshfp_rsa"=>"SSHFP 1 1 6b3dbcd02fe71fb6106ad074454f8f16917327b5\nSSHFP 1 2 913a32e7a0b2c81b5419903654c1dc42680df07f4fe04c82d7d70892b77b824b", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAsNcmWEvgjOkr4XA4uYa9aAfcxv1IygDmFnM/zIFbcMUmCxoza/WWZwm/mDO319xq71YqpVtvhgpSTHLGek6Iwb1rZukQvbwZnlzrIe0G8Bc4JpSAmyZkZceve1cau6nOXEI8eDrlbRLtrUNeptaIVHaa85KJqv7Ksc+NxGIRS/xBTWus3rxx3cQaurcyIK1rBHLiL5VpN+ove3Nl3zsHyyOym6FjbqIQuVMStr5j0+lQ3B+AqZpJixwbGKaxSIKZUcQla1pGCchBt7BuAq+A4XE+XIdsi2gRks2IjPGMkOXh0IiYud1ph7JaO7iLjSalylvF9qZSO/70J3w7nKLJYQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1067, "uptime"=>"0:17 hours"}, "timezone"=>"UTC", "uptime"=>"0:17 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1067, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'CentOS-5.11-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_CentOS-5.11-64_spec.rb b/.onceover/spec/classes/role__windows_on_CentOS-5.11-64_spec.rb new file mode 100644 index 0000000..5a862bc --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_CentOS-5.11-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set CentOS-5.11-64" do + node_facts = {"architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_hda_size"=>21474836480, "blockdevices"=>"hda", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"hda"=>{"size"=>"20.00 GiB", "size_bytes"=>21474836480}}, "domain"=>"localdomain", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,iso9660", "fqdn"=>"localhost.localdomain", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo,sit0", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_eth0"=>"fe80::a00:27ff:fe3e:4987", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.18-398.el5", "kernelversion"=>"2.6.18", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"Final", "lsbdistdescription"=>"CentOS release 5.11 (Final)", "lsbdistid"=>"CentOS", "lsbdistrelease"=>"5.11", "lsbmajdistrelease"=>"5", "lsbminordistrelease"=>"11", "lsbrelease"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch", "macaddress"=>"08:00:27:3e:49:87", "macaddress_eth0"=>"08:00:27:3e:49:87", "memory"=>{"swap"=>{"available"=>"1023.99 MiB", "available_bytes"=>1073733632, "capacity"=>"0%", "total"=>"1023.99 MiB", "total_bytes"=>1073733632, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"389.45 MiB", "available_bytes"=>408363008, "capacity"=>"21.76%", "total"=>"497.78 MiB", "total_bytes"=>521961472, "used"=>"108.34 MiB", "used_bytes"=>113598464}}, "memoryfree"=>"389.45 MiB", "memoryfree_mb"=>389.4453125, "memorysize"=>"497.78 MiB", "memorysize_mb"=>497.78125, "mountpoints"=>{"/"=>{"available"=>"16.96 GiB", "available_bytes"=>18212638720, "capacity"=>"7.23%", "device"=>"/dev/mapper/VolGroup00-LogVol00", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"18.28 GiB", "size_bytes"=>19632164864, "used"=>"1.32 GiB", "used_bytes"=>1419526144}, "/boot"=>{"available"=>"86.04 MiB", "available_bytes"=>90215424, "capacity"=>"12.85%", "device"=>"/dev/hda1", "filesystem"=>"ext3", "options"=>["rw"], "size"=>"98.72 MiB", "size_bytes"=>103512064, "used"=>"12.68 MiB", "used_bytes"=>13296640}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "mtu_sit0"=>1480, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"localdomain", "fqdn"=>"localhost.localdomain", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}, "sit0"=>{"mtu"=>1480}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe3e:4987", "mac"=>"08:00:27:3e:49:87", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"5", "operatingsystemrelease"=>"5.11", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Final", "description"=>"CentOS release 5.11 (Final)", "id"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "specification"=>":core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"5.11", "major"=>"5", "minor"=>"11"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "path"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d", "sha256"=>"SSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7", "sha256"=>"SSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK4mrAWHX3BUGyimNDl6+rtP3BXx8hvZ8UCfySeFw3vliSb5uzCLSdbcLmNZxqVrYv9skhO7wIaRFo4xwLSBPbwMffwuO8/2kIXGxkkVKnucsYmsNNaaLAgrfTR+d2lj089fs/PBDGUiJThPPsbNLMVxDEy1SOuby5FAZvNGQTlxAAAAFQCivnpYKhk5wFrpmn1mZv7ayD8HLwAAAIBQ64m92s3WWK+tdChTH2rEvfn3lJlatruRDeZaXrTuuzA7K9uJhtfqg3KAs9gtZup6vOGNJbJWZVxTG+I3jLXgA2Mfd/lAcbtA1RXnqgUITgg2/sd/TkEkCrke/NVjBaiiXVhsly63OIv/JAvq4ulmNxvUT7Pj6Fz9dKvV1elbJQAAAIBqHveIC7RZnN4bGEc+rZZ63aOYI7Pm/9OE2soVjjvGYgk9Iew9S7xwDmcrDKICqSCwzE3ISalkGAkqXKBJnKx/gKziLWdj1VOoNv16X4nVTwxaL7u9nAg1cQ+H5whnWQ+KDoLJPtc8bCpnamGMY4W89a08Qv0U5RECNhv92AQcqQ==", "sshfp_dsa"=>"SSHFP 2 1 1139f2967264a610088812d1ed3ea8db448c417d\nSSHFP 2 2 ddb6064607ac29a8c83978d33e46ed56e677f27ed727341142a08156906bc9bb", "sshfp_rsa"=>"SSHFP 1 1 29e63bdd87c88c24251d791b474a8f3b56d581f7\nSSHFP 1 2 cfc171e3db64806593cd26571556b360882507938c9a71e477478837cfa6ea9c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA7Z6GmWepCT3oXq1qGkIq736GM5oXr4ISMuJtGF2+8yOyM+qqvM83zgnZVkCSkNwtiLOODfzbFmmfKKdLoN30xE6oRP+hu9LH7dzRnnIwsx2DBgaX6QPdbcsIG1dnfH34PO1/AvZGRU4YRwrBSVsURR5wow6BYTs56qznYUd6VALvDg0iOLde7eniqQlVbzfLsR+GFeQ9zp9qMI4JjL17RJYBeVam0wP3cYXglE5PsMYuJwVLP6aOIFx3nQPem76bh5fyTVFsav+jsdamw+dZ7uZn6lkRlCtqyxQzFyyT3RgCUW1qVwdus42xsJm8GPojfIcqhQ3HUEDZ61D5dgZjIQ==", "swapfree"=>"1023.99 MiB", "swapfree_mb"=>1023.9921875, "swapsize"=>"1023.99 MiB", "swapsize_mb"=>1023.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>847, "uptime"=>"0:14 hours"}, "timezone"=>"UTC", "uptime"=>"0:14 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>847, "virtual"=>"virtualbox", "clientcert"=>"localhost.localdomain", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'CentOS-5.11-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_CentOS-6.6-32_spec.rb b/.onceover/spec/classes/role__windows_on_CentOS-6.6-32_spec.rb new file mode 100644 index 0000000..e7f4c56 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_CentOS-6.6-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set CentOS-6.6-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_eth0"=>"fe80::a00:27ff:feff:42e5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.el6.i686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:ff:42:e5", "macaddress_eth0"=>"08:00:27:ff:42:e5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.00 GiB", "available_bytes"=>1073737728, "capacity"=>"0%", "total"=>"1.00 GiB", "total_bytes"=>1073737728, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"451.91 MiB", "available_bytes"=>473862144, "capacity"=>"9.40%", "total"=>"498.82 MiB", "total_bytes"=>523051008, "used"=>"46.91 MiB", "used_bytes"=>49188864}}, "memoryfree"=>"451.91 MiB", "memoryfree_mb"=>451.91015625, "memorysize"=>"498.82 MiB", "memorysize_mb"=>498.8203125, "mountpoints"=>{"/"=>{"available"=>"1.02 GiB", "available_bytes"=>1099689984, "capacity"=>"51.05%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"2.09 GiB", "size_bytes"=>-2048442368, "used"=>"1.07 GiB", "used_bytes"=>1146834944}, "/boot"=>{"available"=>"450.39 MiB", "available_bytes"=>472266752, "capacity"=>"5.42%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"25.83 MiB", "used_bytes"=>27088896}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feff:42e5", "mac"=>"08:00:27:ff:42:e5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"i386", "family"=>"RedHat", "hardware"=>"i686", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"bc353fb2-82b1-4d41-a43e-6512030a2a28"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"eb19f39e-a1cc-4e43-bf33-809fa7f52044"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"51727e98-6cd5-4fba-8a1f-7d4dfb575e1f"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>-525336576, "uuid"=>"vkG7sJ-bfu3-Cko3-YJ7v-jPys-3uHe-vki0jZ"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe", "sha256"=>"SSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877"}, "key"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8", "sha256"=>"SSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAME6dtbuRJGNiBgp3QqD50a8LmJLduCTsifX5ST6RA5l+LHIx/UpCo66dsSY29mXVsMIK6tlZyu0MDR4iOz/4oFcKwkgHvbZ33WFY7G526IDrszdLdWnEqxPw7pUC+izWmD337K0gcZnDMJGZk1PVEjK6i5MeFYI4SwYkdd/m7DTAAAAFQCzZLb3M4+Y0TBLUVImfxc31+KXiQAAAIAbk33qNmIiB4+iHJ0coB4MfSdwoPnhU+vG7XpqiA0W/68U6lGIFFFHW0R1utZUQ28E8jUhSwzM0EGXtiSyFpTzjAnS44UiIWvulTkbpa9RnTn1gVzR2Tpbc24LMiKqiz/ZrvKmp8jLUO1/BPCmD80yNXXo+v59wXnVD8Yak4u07QAAAIB0lpeV5gShABSEIBXBuAPGW67mjCdUqbj6Ry1ZV3XTPtUXWVhCehWQrPh9yYCItpepKWp55t7neSqVjaxFo7W8O2gBkYwv24eQiqaqI8vgV3fJf4mdb10cdAb6IzM46WVhSxo1al2XPLBDVtx1z/4RH/7agKpbfmP6QrDgKkMKow==", "sshfp_dsa"=>"SSHFP 2 1 5c44d0a9f52668fbaaf05e6957f058d90264adfe\nSSHFP 2 2 de1d70753fc8dcce901b997fca065a08cdfcc9d7ba44f630e0e16be7a54df877", "sshfp_rsa"=>"SSHFP 1 1 d1002ff7e5e42c3c9c9681d65afe0f195277d2a8\nSSHFP 1 2 ac639861032637e9c24f0af7126242086540c3d1f41640576c011d6eb9f4bf24", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEArd8ro8164ykLYynBWxSiPBNUy1hLeh2S284vuYCbJwNC/naFBmcXORUFIsegfJpRxFKg3YsCbQUrHfZ6cfAc/xKUdoORUkF+8ixsVl4YzHg6vybxnRlaanBvS0eiR/wzxsVepqC/S3gd7YF3/Lca5sHNixNuqgxsd9iy9VEz7XMZ32mMxBqgTabR1KorBSufGMRADq/jauXpd2QRul+bih5uAL/Ilb2bZutcHUohnWi3UQnR10bO9MS1wr6c42VJBOHW6fZXvGjRvjd94AhNB7RTKvmRCucPCMvkgaDsr+z0cCjmpmptsdy119UpKmv4uCHalPbtHOWMYk2QVnqoQw==", "swapfree"=>"1.00 GiB", "swapfree_mb"=>1023.99609375, "swapsize"=>"1.00 GiB", "swapsize_mb"=>1023.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>430, "uptime"=>"0:07 hours"}, "timezone"=>"UTC", "uptime"=>"0:07 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>430, "uuid"=>"6C33275E-3132-4167-9318-9BDE31E82035", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'CentOS-6.6-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_CentOS-6.6-64_spec.rb b/.onceover/spec/classes/role__windows_on_CentOS-6.6-64_spec.rb new file mode 100644 index 0000000..d24227a --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_CentOS-6.6-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set CentOS-6.6-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext4,iso9660", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos6a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.7", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth0"=>"fe80::a00:27ff:fe0f:d276", "ipaddress6_eth1"=>"fe80::a00:27ff:fe66:988a", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.88", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.7", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-504.8.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "macaddress"=>"08:00:27:0f:d2:76", "macaddress_eth0"=>"08:00:27:0f:d2:76", "macaddress_eth1"=>"08:00:27:66:98:8a", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"992.00 MiB", "available_bytes"=>1040183296, "capacity"=>"0%", "total"=>"992.00 MiB", "total_bytes"=>1040183296, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"348.41 MiB", "available_bytes"=>365338624, "capacity"=>"28.95%", "total"=>"490.39 MiB", "total_bytes"=>514215936, "used"=>"141.98 MiB", "used_bytes"=>148877312}}, "memoryfree"=>"348.41 MiB", "memoryfree_mb"=>348.4140625, "memorysize"=>"490.39 MiB", "memorysize_mb"=>490.39453125, "mountpoints"=>{"/"=>{"available"=>"16.94 GiB", "available_bytes"=>18193268736, "capacity"=>"6.51%", "device"=>"/dev/mapper/VolGroup-lv_root", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"18.12 GiB", "size_bytes"=>19459338240, "used"=>"1.18 GiB", "used_bytes"=>1266069504}, "/boot"=>{"available"=>"448.35 MiB", "available_bytes"=>470125568, "capacity"=>"5.85%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"27.88 MiB", "used_bytes"=>29230080}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8555670, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"centos6a.pdx.puppetlabs.demo", "hostname"=>"centos6a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.88", "ip6"=>"fe80::a00:27ff:fe66:988a", "mac"=>"08:00:27:66:98:8a", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe0f:d276", "mac"=>"08:00:27:0f:d2:76", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.6", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/VolGroup-lv_root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"a29409f8-0b58-4271-a348-032caefec8b8"}, "/dev/mapper/VolGroup-lv_swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b30b464a-8ac9-492a-a1c5-2da75bb7488a"}, "/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"da946872-1406-4ac1-9a4d-f7ce5f7be47e"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"nRdWPh-INkA-aHPs-TNtk-HjJG-SxBU-DdqI8a"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-6-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8", "sha256"=>"SSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745"}, "key"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef", "sha256"=>"SSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAJSFgQJi2VfgHnp2MQsV2wNpONevQuhi1Jb/nX0EjHtrAgc8MNRXLQTmjunh5q4+mjcYMHXDIx6F0Oc4XCnR5g6uQwBOGg70oXJmUkmwCw/mdgu3ppepOQJssBKnKFCR7QsbrBL+U1YmYmV8eGYDB76eXWRBOd9LewcGkjhHYbpzAAAAFQCShhFDlgHvmj6kcr6XRUuYPNziNwAAAIBBjLzEbwqoedlUKXRGuKc7nU71qWAkahN8rI4lU7d6PrVS7XziNX3OTCXbRCF3wT/dlYBU+grjmOIF4dbOrjBCHmmYVzlntXsefyR6XIbJw/H08L2LdDT6aye+MDWdYGK0PqgV6AZ5pWUzu7wS+qJduOaNMts5YrzqvlhiFDO8EAAAAIAJoqYk2bkNTPnjYi4qhIP3o+7Lhpxh5akAkjPMpM4tf/BedBqzKimvWhtDNVTcNCOZwJuSkHL4SSafvPCoxbKY4YhFWYykS/Vdle9ixNtH+wMU5d8DsSsvZpfa4lvj9FpzgfcM+NT1aYHis/pIRpBblPfHHnFBsxGKX66v6webHg==", "sshfp_dsa"=>"SSHFP 2 1 5dad11db93cde6e3b1d5ce5a5fe5ad02825037e8\nSSHFP 2 2 576fe2b6a8412ada50cb776e6f1da5dd4bc301f2aa682be2ff82c70558c14745", "sshfp_rsa"=>"SSHFP 1 1 e1e2811771eb093d9b74333a111e089bc8e434ef\nSSHFP 1 2 4513b7ba6b47b22319ea40fe9e0f12e9ac200b367b78508364a80a2a9b92409c", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA3Gn072MPvlL1R0RpTGod7BxiCvm4Wp6p8gRYJgEba9FLtYTWYhx18ueLnuFWKnK6WMpwe24732ZGGCsagjBkEo8DFJZABZbfSHxW1gsmU6smUM9o2wt9ZEeYJ036DqIkg4DzsBLc206NKStuKCTOINFSwBtHAWkZCeGdon8ssEoery//yZchbHBXQB1f312Re42W4eLNpWm0T93eEwRRMOpnLtNFrVa9kvHv71eQx2crvDG2xd6BfN0PkU0tx0TBzDS2xUqBg5m1MdNbarxWH1Km8JUEH40jl3YKgh5g0lrfEE36xIItPtW2mFawsMBpMK0iPerqs60or9SjM1LwXQ==", "staging_http_get"=>"curl", "swapfree"=>"992.00 MiB", "swapfree_mb"=>991.99609375, "swapsize"=>"992.00 MiB", "swapsize_mb"=>991.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>352, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>352, "uuid"=>"DA4CD203-2C23-4E21-B169-293D1749C38C", "virtual"=>"virtualbox", "clientcert"=>"centos6a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'CentOS-6.6-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_CentOS-7.0-64_spec.rb b/.onceover/spec/classes/role__windows_on_CentOS-7.0-64_spec.rb new file mode 100644 index 0000000..bc0f5a1 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_CentOS-7.0-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set CentOS-7.0-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"sydney", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "enp0s8"=>"192.168.56.100", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF"}}, "domain"=>"syd.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"xfs", "fqdn"=>"centos7b.syd.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"centos7b", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,enp0s8,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s3"=>"fe80::a00:27ff:fe39:183c", "ipaddress6_enp0s8"=>"fe80::a00:27ff:fe39:832c", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_enp0s8"=>"10.20.1.92", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-123.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.26, "5m"=>0.12}, "macaddress"=>"08:00:27:39:18:3c", "macaddress_enp0s3"=>"08:00:27:39:18:3c", "macaddress_enp0s8"=>"08:00:27:39:83:2c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"1.03 GiB", "available_bytes"=>1107292160, "capacity"=>"0%", "total"=>"1.03 GiB", "total_bytes"=>1107292160, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"297.76 MiB", "available_bytes"=>312225792, "capacity"=>"39.28%", "total"=>"490.41 MiB", "total_bytes"=>514228224, "used"=>"192.64 MiB", "used_bytes"=>202002432}}, "memoryfree"=>"297.76 MiB", "memoryfree_mb"=>297.76171875, "memorysize"=>"490.41 MiB", "memorysize_mb"=>490.40625, "mountpoints"=>{"/"=>{"available"=>"17.30 GiB", "available_bytes"=>18574749696, "capacity"=>"6.32%", "device"=>"/dev/mapper/centos-root", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"18.47 GiB", "size_bytes"=>19828572160, "used"=>"1.17 GiB", "used_bytes"=>1253822464}, "/boot"=>{"available"=>"393.11 MiB", "available_bytes"=>412209152, "capacity"=>"20.85%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.67 MiB", "size_bytes"=>520794112, "used"=>"103.55 MiB", "used_bytes"=>108584960}}, "mtu_enp0s3"=>1500, "mtu_enp0s8"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8563388, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s8"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_enp0s8"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_enp0s8"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_enp0s8"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"syd.puppetlabs.demo", "fqdn"=>"centos7b.syd.puppetlabs.demo", "hostname"=>"centos7b", "interfaces"=>{"enp0s3"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "enp0s8"=>{"dhcp"=>"192.168.56.100", "ip"=>"10.20.1.92", "ip6"=>"fe80::a00:27ff:fe39:832c", "mac"=>"08:00:27:39:83:2c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe39:183c", "mac"=>"08:00:27:39:18:3c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"CentOS", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.0.1406", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"CentOS", "release"=>{"full"=>"7.0.1406", "major"=>"7", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/mapper/centos-root"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"db651e5f-a2c2-4236-9570-6226f63e1fcd"}, "/dev/mapper/centos-swap"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"ff4ec16c-28c0-4715-846d-11e7c9b4e53b"}, "/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"39ce4ad1-4e9d-49a4-bce0-8a30b459490a"}, "/dev/sda2"=>{"filesystem"=>"LVM2_member", "size"=>"19.51 GiB", "size_bytes"=>20949499904, "uuid"=>"pg7zVv-M3hI-zpjY-eYlZ-06aD-ZRO2-J30GLd"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_razor_server_version"=>"package pe-razor-server is not installed", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"el-7-x86_64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb", "sha256"=>"SSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581", "sha256"=>"SSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBcSUcHQOfBDZElr6PBmxc/4ZDaIhsugXM7OE2SQj35iOMCN/I3XfINMo8SvBIQ6CsBqPnzgbKRBs7e1FPFnsT4=", "sshfp_ecdsa"=>"SSHFP 3 1 91edfdf5e7e098f4392606865c017dabc26804bb\nSSHFP 3 2 f00c65a1884bfec52db11de89254f0bfd46baf9e759546654c94371a05ee0dba", "sshfp_rsa"=>"SSHFP 1 1 f25e9ad2faddbe75263cfee4fa97dc965bc1d581\nSSHFP 1 2 0173e386031a134e4cbfb7f6971788761a5aa3d9e39dafcf163f003de2537199", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDLMo35gwbuqQvRq1gy6L8vddeyMNBYr5WPVcftMKSJR1jmwzxcZ+h0AEb3KPfoMHkqe9Xy+3oN981qe5ZCE780HO884AaXzXry9zdWQjGysrI+zHQbqbpOkYAGsVbJiQ7VnH7lMVZo2jCbABj4OdsbeCOeP3oDXTNCTaWWdQChzqvYgNBvb0mg/na1l0naQ1nsJYD85O8ZRQ9U/JOADMaOjummfOb2z7MgskZ9abm5eFCCQl+wUUNXKqQx+uyVM4lyyoTHpW3M2IV0P9wxhWJF6eovwyREGuMgJCs6kbHCFty7HtAYbzziabgQav8pMe68aBqjshbpU6ll/+aXWhD1", "staging_http_get"=>"curl", "swapfree"=>"1.03 GiB", "swapfree_mb"=>1055.99609375, "swapsize"=>"1.03 GiB", "swapsize_mb"=>1055.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>78, "uptime"=>"0:01 hours"}, "timezone"=>"UTC", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>78, "uuid"=>"9D7BE471-F3DA-47EE-B023-F659129270EF", "virtual"=>"virtualbox", "clientcert"=>"centos7b.syd.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'CentOS-7.0-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Debian-6.0.10-32_spec.rb b/.onceover/spec/classes/role__windows_on_Debian-6.0.10-32_spec.rb new file mode 100644 index 0000000..0626ea7 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Debian-6.0.10-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Debian-6.0.10-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_eth0"=>"fe80::a00:27ff:fead:dc1c", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-686", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:ad:dc:1c", "macaddress_eth0"=>"08:00:27:ad:dc:1c", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"434.46 MiB", "available_bytes"=>455565312, "capacity"=>"13.56%", "total"=>"502.63 MiB", "total_bytes"=>527040512, "used"=>"68.16 MiB", "used_bytes"=>71475200}}, "memoryfree"=>"434.46 MiB", "memoryfree_mb"=>434.4609375, "memorysize"=>"502.63 MiB", "memorysize_mb"=>502.625, "mountpoints"=>{"/"=>{"available"=>"1.69 GiB", "available_bytes"=>1819041792, "capacity"=>"35.07%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"937.10 MiB", "used_bytes"=>982618112}, "/boot"=>{"available"=>"213.27 MiB", "available_bytes"=>223632384, "capacity"=>"6.35%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"14.45 MiB", "used_bytes"=>15155200}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fead:dc1c", "mac"=>"08:00:27:ad:dc:1c", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"092d5625-eb03-443c-953f-006bec7d5476"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"f9e1cf7c-ab54-4949-8e55-290adc8d853f"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"2c798378-1738-426f-a847-c929a507fc73"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"cG2Syv-bT1d-2TyA-Wqgz-33I2-RnTz-jA2LxS"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57", "sha256"=>"SSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09"}, "key"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b", "sha256"=>"SSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAInFvAyGI1vy23JgBDC4/AZeO2jhNRqlX0kdL9utKPaMgrIzIiEN0aqdlSJY4uTFcYAdfYxMuIkYaMh0FM3EMDB0ZL/1k9W2dCVFYpSHgIa/zJwSEqY7sFHdXjRsD3mjOzEZwpjV+dFq8sHoIouIhMcTC4nejrDRno994JoJSyP3AAAAFQCjjYeNB9geUQHIrcE/nY90aiI9pQAAAIBDoY90WppP0db2EyCgnAsl9J70YQg6bCPHHxl61ktEwStzGu7eEZxXVBDCPtFDYKL2gtmIlF0lAbt5KoC9NnVCb0n9vV4qY+xdwxWAjQI3CtrOfEZTaSlsn7lbgcnjXCODnALL92/nS6ahcVRt1KfmWTjCYnP1We+9QBSz/mRD8wAAAIBT+9TbXOqhlfNP/J3X3rEzZ1HsYh7DoLGbh3krSO0vpdC0crj6vx6NTDfJhwye6axWAgQOXF8g87FFTFERgmxEHhZE/QH7YxueNllJxKPtC77uiDBfaHsGtpIhISirr1fPSRTOVeVN3aCqHMualyCCH2xaYC8yGYwvL8W+mgqG6g==", "sshfp_dsa"=>"SSHFP 2 1 3e0f92fe3eb7ee9737cead81e7465b5903d6ce57\nSSHFP 2 2 c67d0777eb694d679a1d24335e76dd0475ca92077ff8d02c91f26a4b9cf56b09", "sshfp_rsa"=>"SSHFP 1 1 d1795dbe0b42f87f01a7a9f822b8ceb40bd6420b\nSSHFP 1 2 7a4b0b01598345e44894393168d2e803b2dfbae8795a844b02e7ac16a999417a", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCyhapWpsFVIKdKwjNSiqZQYx6m5w7k3+bsmaNs7YU6qg+HrmBXBR/HwckXTPDMAHPVmmDYwi80N89Gp8NPZvnYJnhZwyQPmMUfORWO0aW8SE/TQKgbpbatZOzKb7pYtLT7g7ZbaWBPJBEqU0aCKAl3AW8FX8Hfja7+GD4DBLUi+rPyGPCr+uxa//NL9PE5nO1mQGLsn0Sy1Z7ChECrFVL7mXZ4xVSfTM3v0HI/SNUuq8qCpw8ysZFmUEbRzVEwTFm5zff8IaTZPQi7e/RofgELzn4+cuXiYHYKyiZDSJVDoHnc61OGmPWVxRHzcxNZDJS4dnc1mO48wyKpaM9xZF7B", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1441, "uptime"=>"0:24 hours"}, "timezone"=>"PST", "uptime"=>"0:24 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1441, "uuid"=>"6E39B0C5-08BD-4595-AC3D-576DAA677DED", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Debian-6.0.10-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Debian-6.0.10-64_spec.rb b/.onceover/spec/classes/role__windows_on_Debian-6.0.10-64_spec.rb new file mode 100644 index 0000000..a199251 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Debian-6.0.10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Debian-6.0.10-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_eth0"=>"fe80::a00:27ff:fe62:fa69", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-5-amd64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.0, "1m"=>0.0, "5m"=>0.0}, "lsbdistcodename"=>"squeeze", "lsbdistdescription"=>"Debian GNU/Linux 6.0.10 (squeeze)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"6.0.10", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"0", "macaddress"=>"08:00:27:62:fa:69", "macaddress_eth0"=>"08:00:27:62:fa:69", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"871.99 MiB", "available_bytes"=>914350080, "capacity"=>"0%", "total"=>"871.99 MiB", "total_bytes"=>914350080, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.43 MiB", "available_bytes"=>401010688, "capacity"=>"23.04%", "total"=>"496.90 MiB", "total_bytes"=>521035776, "used"=>"114.46 MiB", "used_bytes"=>120025088}}, "memoryfree"=>"382.43 MiB", "memoryfree_mb"=>382.43359375, "memorysize"=>"496.90 MiB", "memorysize_mb"=>496.8984375, "mountpoints"=>{"/"=>{"available"=>"17.65 GiB", "available_bytes"=>18949697536, "capacity"=>"5.16%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "errors=remount-ro"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"984.03 MiB", "used_bytes"=>1031831552}, "/boot"=>{"available"=>"212.24 MiB", "available_bytes"=>222552064, "capacity"=>"6.80%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"15.48 MiB", "used_bytes"=>16235520}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe62:fa69", "mac"=>"08:00:27:62:fa:69", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.0.10", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"squeeze", "description"=>"Debian GNU/Linux 6.0.10 (squeeze)", "id"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"6.0.10", "major"=>"6", "minor"=>"0"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"d2763d16-5203-4625-8733-a6f2ecc94f5a"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b5661448-0339-4ba3-8593-21cc6a049d33"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"415531d6-6955-433f-921e-8f266ab56649"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vGb2LM-M1SP-IynO-OZJV-sYKl-Pcfo-fAFbiz"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f", "sha256"=>"SSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad"}, "key"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2", "sha256"=>"SSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALw6MnSlMUiVwDHFe5OUWDLBt0OooRutGu9pH1L3Ir6oZRNCbeFf3qoi+WWBU0cradbi0H1vlwtApdxVwymseyn9OqzfSt8urWkZS0o87vrJ1Hrz8RJe/B0TrWqgI1lm8h3zVBYsR7OXVFlSQC4ljK/3yZXfkIWEDBn8yXAsVMv5AAAAFQDuMctG71BY6fTAWG754jypFIJ/QwAAAIEAkqkhJdtDwZKty47LzSKIPne0t4TfbY8zHRN6atEtEFuOjgSBJoeYY7ILJL8zK8G7YO6nNdY0gVJv5x/R2ac1mfn06cq7xR2I/rD+BICmRt69kyFNi9newk2C7cLG8Mi6JvIHMduU8DegYeqz0kjh8WPUZWPakY5nqbYob6NE6vMAAACBAKh42Jooiu2+P1yrHjuYmjB9Wq8CoDSUwyNslY47HcEvzCuMcEZ8sVutpP0gjvO72bvFUPDzLP4HwqzphLVbGvBCc2N9RPTgJzijnHryB/LFXWS6evePwo4LMLhUMgzPOyIyxXxhG4bTTLR2jBmQe75EDqz3ibKJgb3CKz+hf6SZ", "sshfp_dsa"=>"SSHFP 2 1 c9683f8ef6dc226d83a014be6349f496b65d329f\nSSHFP 2 2 23aa109e68ed1d1b6766259c72d5168a93df3b0818fc975727b203aa6c4eb6ad", "sshfp_rsa"=>"SSHFP 1 1 8e4b010ef208a5d1ecbbef4999ddb1a20ec0b6d2\nSSHFP 1 2 1819579b1d40afe00107ef9d153e916f443fbddbefdf7f77583e84f32a3503b3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCx/7sL2SPCsd/gcIPPvJhhOwYZdZSboDWqbIyUzzothrO7aKGHf7bxRdn+zu4vWUwBMoueGB1lf3xnDbrbDMxdh5sTpKYHWGKvBdgat+sWlEH3YiRd9vkji28R0+GEWdvmRTKfUxGEoJ7/NVZ0RroCMKlWO7tsDIUPhWn2NDZ3z4V3FAv4WvaE0YF1g0+71kF263+9IJCoxx6ztWBQfdJvEdu/k9cvCIJ6IMxscZ48vAqLRali6QCKRNHUqZFOLattqKFvGHdU/WvX+xpEj2QLTD+Tuat2uImblM4wge44oS8nlhN+reO1Cjafjf6lh3cCfUWphndK3Wvv7a18l2av", "swapfree"=>"871.99 MiB", "swapfree_mb"=>871.9921875, "swapsize"=>"871.99 MiB", "swapsize_mb"=>871.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1211, "uptime"=>"0:20 hours"}, "timezone"=>"PST", "uptime"=>"0:20 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1211, "uuid"=>"8AFC52E0-2A7C-42BA-BAFA-62B8413FB7C2", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Debian-6.0.10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Debian-7.8-32_spec.rb b/.onceover/spec/classes/role__windows_on_Debian-7.8-32_spec.rb new file mode 100644 index 0000000..5168c8e --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Debian-7.8-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Debian-7.8-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_eth0"=>"fe80::a00:27ff:fe18:59a5", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-686-pae", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:18:59:a5", "macaddress_eth0"=>"08:00:27:18:59:a5", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"432.02 MiB", "available_bytes"=>453001216, "capacity"=>"14.00%", "total"=>"502.32 MiB", "total_bytes"=>526725120, "used"=>"70.31 MiB", "used_bytes"=>73723904}}, "memoryfree"=>"432.02 MiB", "memoryfree_mb"=>432.015625, "memorysize"=>"502.32 MiB", "memorysize_mb"=>502.32421875, "mountpoints"=>{"/"=>{"available"=>"1.52 GiB", "available_bytes"=>1633996800, "capacity"=>"41.68%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"2.61 GiB", "size_bytes"=>-1493307392, "used"=>"1.09 GiB", "used_bytes"=>1167663104}, "/boot"=>{"available"=>"211.24 MiB", "available_bytes"=>221499392, "capacity"=>"7.24%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"16.49 MiB", "used_bytes"=>17288192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe18:59a5", "mac"=>"08:00:27:18:59:a5", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c87cb2c9-ffb8-48d1-bc31-024a57d3e44e"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"864df30a-fc50-4a93-8cfd-4624251c1589"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"b8ab8500-a238-4554-8d11-9c194ebba70c"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"NvdPwA-esP3-xUuv-n9OR-Ep7r-kQAr-qyUAzr"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa", "sha256"=>"SSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906"}, "key"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4", "sha256"=>"SSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d", "sha256"=>"SSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBANJna2zK1ufiBINsA3RgaBhVXUFlya5rxD6A2KkeYr1yWcDECATGcsSh6KDEC4asOEtoyIogsZx/5ygefXeR+0R1XYQghrFsZWSwIdVV+jrt6IWddub3KXp8UvfWYUUXKAm0fiGXzTJ7sodap1ep/FBM0cyyaWYXvQCgiBr/T+lLAAAAFQCGGv9dGnuyKCMssoWebZ7PRd41cQAAAIEAsmFTg56Q5KwsFyYrtUR+fZlL983DI4m+/PPWI/pZ4sgvRjA7NWfr+gfJrSObH88ZAccu7edbVSfOyRVcOqCjBYU3nybG9vuelacqm4qdTnZbUWlMZJ1clJ4GlRVPO9zEhuODBleyxQW13XiwgNe9h9vOXlu/xu8aogaIyLfXGZgAAACAMe0yNEoADrHDE8rXr6nvytfibxofPnCtZj7L54OY7HuaBv1I0OqdJVjLw7SjJQ3vIiiR2pMMFVioROgVWUokdskTT/M3RvEcoNG55iYFVe8p43Z1HY4NNLgHIoPZ4C3EDDxiwCxiFK0kmhbg9boyV0Dyra/rbEAyZH6xNZYBR/c=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOkAfihhbn6Ht/z9rqOPlshRbi8MFhg12kUUf9PBVvKOBA3wgmHzOlcwSdhpO9olPla92uplSlntiE+bqR7eZhA=", "sshfp_dsa"=>"SSHFP 2 1 ffc65c9d4e1956519935d902798fc58cbafde1fa\nSSHFP 2 2 3a59447b36760803f33fdda5c1f58681b271a8a5e6fb4997ee7241cb29a59906", "sshfp_ecdsa"=>"SSHFP 3 1 5222b070970562793c4df0db8916f7828334bad4\nSSHFP 3 2 920d4e5ef5dc8064271df26a5cda37211772a9133537d4520addef0e2dc0a480", "sshfp_rsa"=>"SSHFP 1 1 5bd78bebc725f3afc34cff576f09eaa052ef6c3d\nSSHFP 1 2 c9e8b904a928e59d86e90e84d972b95bc3eabbfcf465ce0bb9569547ac5c2aa6", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQD4eO7mc/0jHFMbrPCrT6ktvNPzIqceRoIo6Kf/E845UlOO0eX425jMKVLqmnQCorZnN168LyyRfBoKXCmC/EEe18BlTcosCBseh/RytFcOpaUcX5etnmaqf8yBg4Hcp2zkRQx4HsHJMK5/52Dha7ZU7FvgJBMfCJULaEL9t+eRp1bOLN7GnFsMkXAaLmUqI3d6cVI8rc10ocQMu1nhzzNX4FDjoSvRH/AKGTzcIm8LBXUAR3v1ubFf+8Qc8vYF/sGcyJAJ0Bhcmg9/KH9NQMT01u0cgCOsxzBXu56CF5zeKERrbi8k6OJzz0t+rT8/7mwJOgKx4QhHt69jqt4KVeJv", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>800, "uptime"=>"0:13 hours"}, "timezone"=>"PST", "uptime"=>"0:13 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>800, "uuid"=>"75AFEC9A-DECD-40F4-B25F-A737EE8BA7CA", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Debian-7.8-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Debian-7.8-64_spec.rb b/.onceover/spec/classes/role__windows_on_Debian-7.8-64_spec.rb new file mode 100644 index 0000000..55cb488 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Debian-7.8-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Debian-7.8-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"unknown", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_eth0"=>"fe80::a00:27ff:fe83:ad56", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.2", "kernelrelease"=>"3.2.0-4-amd64", "kernelversion"=>"3.2.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"wheezy", "lsbdistdescription"=>"Debian GNU/Linux 7.8 (wheezy)", "lsbdistid"=>"Debian", "lsbdistrelease"=>"7.8", "lsbmajdistrelease"=>"7", "lsbminordistrelease"=>"8", "macaddress"=>"08:00:27:83:ad:56", "macaddress_eth0"=>"08:00:27:83:ad:56", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"872.00 MiB", "available_bytes"=>914354176, "capacity"=>"0%", "total"=>"872.00 MiB", "total_bytes"=>914354176, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"382.02 MiB", "available_bytes"=>400576512, "capacity"=>"23.13%", "total"=>"496.96 MiB", "total_bytes"=>521101312, "used"=>"114.94 MiB", "used_bytes"=>120524800}}, "memoryfree"=>"382.02 MiB", "memoryfree_mb"=>382.01953125, "memorysize"=>"496.96 MiB", "memorysize_mb"=>496.9609375, "mountpoints"=>{"/"=>{"available"=>"17.49 GiB", "available_bytes"=>18781380608, "capacity"=>"6.01%", "device"=>"/dev/mapper/localhost-root", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=remount-ro", "user_xattr", "acl", "barrier=1", "data=ordered"], "size"=>"18.61 GiB", "size_bytes"=>19981529088, "used"=>"1.12 GiB", "used_bytes"=>1200148480}, "/boot"=>{"available"=>"210.36 MiB", "available_bytes"=>220575744, "capacity"=>"7.63%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw", "relatime", "errors=continue"], "size"=>"227.73 MiB", "size_bytes"=>238787584, "used"=>"17.37 MiB", "used_bytes"=>18211840}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe83:ad56", "mac"=>"08:00:27:83:ad:56", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Debian", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.8", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"wheezy", "description"=>"Debian GNU/Linux 7.8 (wheezy)", "id"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Debian", "release"=>{"full"=>"7.8", "major"=>"7", "minor"=>"8"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost-root"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"7b853135-fb91-48ff-a25c-8d34ada8d549"}, "/dev/mapper/localhost-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"486756ce-bdd1-45f4-864d-e4b6fce59b9d"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"8aa50802-2811-43ec-9686-a30f6a1c3ade"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"eGBBBU-DZw3-wy0f-OMxw-Sf5d-jDyA-ctqcpx"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"unknown", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac", "sha256"=>"SSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a", "sha256"=>"SSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37", "sha256"=>"SSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKo52UJRnjkvuOvraymZ2bDiTUEUexIZ50eR2hx47JpOCUW0OMFH443axvl4TeCpPwqTbf0MH3RdkdSqpGOSAAcBmDfOyI5o9dgzWwSIiplNTxO29tUB9YinkduLEe4pXL5FwZ20owYnvcbrlc8t+LNl8Vku3zWWMrng6mf620MVAAAAFQC5KtOLXLxKD3hk3ATXQbnli4wMRwAAAIAy3bLl4X5yk+WYssTadam8ScUdvzVBCXsrfK9o8HNHfdHCAQqYRYYlC7muDATZxhyw72IhZsFzw/Wswr+5K35hElvrH8j3pFXafe+5dp18CP3V+vXTAzVBiiOnA+AG1tvudBRsrh7bhD9oq1LnXqijLRiI9nD0Faem4uGcT7/jqgAAAIBudV2Q2VYl/N+pRv4/JTgsNLtNz3X12dMjeNXwbpM9LJZUVZDq/KsT1vdDTYOy42g/v14ucRU50QyyAxx78prRgyTIfyKFDEiff9i5uok0c/YN0t2w9ayYkYl6xBWVj+q2SiUM6WdqJdb7sltOLGwsjkroqAV0xdBpbiN6ZWvzKA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEspGa8fuYvtfy2pnBhKV/d/xfmUmvAVUhCJLOlwRURmszRQBW/+GwvhPIT1avptddqTUF2HeA1XKLkbabnxoHI=", "sshfp_dsa"=>"SSHFP 2 1 36d929686c60f981438c3e708f76eaa8aea811ac\nSSHFP 2 2 f509f25d24c474bf0f2b0fae387b1c798174632af84f7e7b064ead1d1e23b144", "sshfp_ecdsa"=>"SSHFP 3 1 263f3632f018d8535aaf8374ff4e8bdfc2eb118a\nSSHFP 3 2 f14b4e61f1569a8181800a082ce91452ce352122bffe4e39314888b280f598a6", "sshfp_rsa"=>"SSHFP 1 1 3f543127df57aceb9be2259918ff9115e507be37\nSSHFP 1 2 90114d6c22d6a759b85f4df1316c567828da41411ae36e8eb09e480bf3cd8ac3", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC8R/CbG0zr75BfoeoCv0GuLcxEIf8Yp5+s2OJKrYRqRmfD9gM6f4J3lVGB/+i5WRiQqJ61Mogstd4CSFmIUhq+opARvDQGxIz1mgV4aHAZDIAGYZ9b1nwS//JWb7nW5mMQqOW3fq59XWxssWjkW6kjJqNSvJtH24kDayxg3jB6Xt2jChz6NLq0t+WmRf24EKCymfnTOdXc4a2sSusAwSb1yl6iHnLpkd5efsUm/ZNCOzHbUtUsnAfDW4MNCUTzq8M/9SpCy2CRid4F29bD1jnJEvyPRrIRAwfPdJTuNZ06pzOWexvS0PcOY6tb0XbdFE78iDdUrVHqTGJiVrFHLoAx", "swapfree"=>"872.00 MiB", "swapfree_mb"=>871.99609375, "swapsize"=>"872.00 MiB", "swapsize_mb"=>871.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>650, "uptime"=>"0:10 hours"}, "timezone"=>"PST", "uptime"=>"0:10 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>650, "uuid"=>"117385F3-E367-4C81-BEE6-78384BAAA1DB", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Debian-7.8-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_RHEL-6.7_spec.rb b/.onceover/spec/classes/role__windows_on_RHEL-6.7_spec.rb new file mode 100644 index 0000000..ee3d586 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_RHEL-6.7_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set RHEL-6.7" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"sr0,sdb,sda", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-9727-3914-2228-1494-64", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-9727-3914-2228-1494-64"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0016-4348-2410-5386-3288-39", "uuid"=>"723914E4-94CB-0743-9847-001D218884D8"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext4,iso9660,udf", "fips_enabled"=>false, "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel6box", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.5", "ipaddress6"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_eth0"=>"fe80::20d:3aff:fe96:ed47", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.5", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"2.6", "kernelrelease"=>"2.6.32-573.45.1.el6.x86_64", "kernelversion"=>"2.6.32", "load_averages"=>{"15m"=>0.06, "1m"=>0.15, "5m"=>0.14}, "lsbdistcodename"=>"Santiago", "lsbdistdescription"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "lsbdistid"=>"RedHatEnterpriseServer", "lsbdistrelease"=>"6.7", "lsbmajdistrelease"=>"6", "lsbminordistrelease"=>"7", "lsbrelease"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch", "macaddress"=>"00:0d:3a:96:ed:47", "macaddress_eth0"=>"00:0d:3a:96:ed:47", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.55 GiB", "available_bytes"=>8103010304, "capacity"=>"3.24%", "total"=>"7.80 GiB", "total_bytes"=>8374747136, "used"=>"259.15 MiB", "used_bytes"=>271736832}}, "memoryfree"=>"7.55 GiB", "memoryfree_mb"=>7727.6328125, "memorysize"=>"7.80 GiB", "memorysize_mb"=>7986.78125, "mountpoints"=>{"/"=>{"available"=>"27.90 GiB", "available_bytes"=>29956210688, "capacity"=>"9.68%", "device"=>"/dev/sda2", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"30.89 GiB", "size_bytes"=>33168420864, "used"=>"2.99 GiB", "used_bytes"=>3212210176}, "/boot"=>{"available"=>"402.87 MiB", "available_bytes"=>422435840, "capacity"=>"15.40%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"476.22 MiB", "size_bytes"=>499355648, "used"=>"73.36 MiB", "used_bytes"=>76919808}, "/dev/shm"=>{"available"=>"3.90 GiB", "available_bytes"=>4187373568, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "rootcontext=\"system_u:object_r:tmpfs_t:s0\""], "size"=>"3.90 GiB", "size_bytes"=>4187373568, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506543104, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw"], "size"=>"49.09 GiB", "size_bytes"=>52708372480, "used"=>"2.05 GiB", "used_bytes"=>2201829376}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel6box", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.5", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe96:ed47", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.5", "ip6"=>"fe80::20d:3aff:fe96:ed47", "mac"=>"00:0d:3a:96:ed:47", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"6", "operatingsystemrelease"=>"6.7", "os"=>{"architecture"=>"x86_64", "distro"=>{"codename"=>"Santiago", "description"=>"Red Hat Enterprise Linux Server release 6.7 (Santiago)", "id"=>"RedHatEnterpriseServer", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "specification"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch"}, "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"6.7", "major"=>"6", "minor"=>"7"}, "selinux"=>{"config_mode"=>"enforcing", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"24"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"ce2ad98e-bb9f-4603-abce-3db7fd857a6c"}, "/dev/sda2"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"be4cc18d-b110-4914-a6f9-52dc0dc66f68"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"aafc7ffe-f0b2-4872-8174-a05f24f6c3d4"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"24", "serialnumber"=>"0000-0016-4348-2410-5386-3288-39", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce", "sha256"=>"SSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd"}, "key"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "type"=>"ssh-dss"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d", "sha256"=>"SSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAL//vXVYQWUZ0FmIEo76fECXpnTXBM5k9XpvJ/hHo+C9AAhkDz8OIPKW/mWjJWkux4nGASNKeHLaya+3Y9vtNZ/MdGw4ivJOR4rCCOfcPzuo3PbBsRE2gKaqc53F6/SwLufGPW2WF8deD6vgTs/OfklbK1evvPBSFAEYrGXlGyJPAAAAFQDY6orVttfPBu50B7OUA5k9ObNLaQAAAIBwX43NbThII85Bv6et0FdeQftDwoLNCTjBI0+DFNqxTVH/LO10fwqcdOMI1jAmmUSe0Dt+PpWQ1ZosK1UKN+hq3jWc84vxyL7l4KYigrvZJoKWvljazNN2unetwLUiPE4X2KL/CmTnXv/N9SeWsSnr86thNVRioQx+znoy8WZHOAAAAIEAkNIj1FhjzCMK4/f2Wg6tJHsW8wRwcGEzAymIj++aBYGPy5BI5Fa6kOcMEyJ+nl+8U3Mps+mJY5EYE/FvsinOrSJzFqowofABd7NgtoRLTGQyohBHP41+RPqXdPGDzPHHvOnuFP/vSKe+sgtJ6j6OqpddLPVybv/7EbylU9n1OpA=", "sshfp_dsa"=>"SSHFP 2 1 2e57bf0a973182ca91a3a9da9df2d332e55624ce\nSSHFP 2 2 e2bbc2a273c58f32c9680300045705133d3efc571bda04798fc67b74463126cd", "sshfp_rsa"=>"SSHFP 1 1 3c9465989548635bc20a034f98be3dd917074a7d\nSSHFP 1 2 22cec87904c8057c2fa6b92e252b95496b678d042fe19d3f58332d67755bbb39", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAuHC1qI3c48QrKuSLHo54im7OIGQyFL/KwoP4jig+LbIdduwmGMlXejZr+E3yb/RKvwQJGkGJ8HCLf8hyz0AmQf2690rXD7M3Ibq8Q3OrpteC46N3JbvnAFockJPLkMt3g/4sWTTmQbMStBAsfhaergAhXHp8x/xmqYnXtYWbKLyY1aFynWiyXx0omJLd3n0zCnDpEDTRlwn/LAwotK/b/lZ58RXJhafA5AbquKYANtg3png+FYX2MAWj75NXwY4h5dQGtMa8dWqWyZYE4Z9bzWFx4A6YAQPwyheKs4GWCU7dCDuiE4z6oZ3BMbfnfO4oX7bnmDtFRoE2GUElBi46Bw==", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>239, "uptime"=>"0:03 hours"}, "timezone"=>"EDT", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>239, "uuid"=>"723914E4-94CB-0743-9847-001D218884D8", "virtual"=>"hyperv", "clientcert"=>"rhel6box.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'RHEL-6.7' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_RHEL-7.4_spec.rb b/.onceover/spec/classes/role__windows_on_RHEL-7.4_spec.rb new file mode 100644 index 0000000..c76765f --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_RHEL-7.4_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set RHEL-7.4" do + node_facts = {"aio_agent_version"=>"6.0.9", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.11.0"}, "augeasversion"=>"1.11.0", "bios_release_date"=>"06/02/2017", "bios_vendor"=>"American Megatrends Inc.", "bios_version"=>"090007", "blockdevice_fd0_size"=>4096, "blockdevice_sda_model"=>"Virtual Disk", "blockdevice_sda_size"=>34359738368, "blockdevice_sda_vendor"=>"Msft", "blockdevice_sdb_model"=>"Virtual Disk", "blockdevice_sdb_size"=>53687091200, "blockdevice_sdb_vendor"=>"Msft", "blockdevice_sr0_model"=>"Virtual CD/ROM", "blockdevice_sr0_size"=>643072, "blockdevice_sr0_vendor"=>"Msft", "blockdevices"=>"fd0,sda,sdb,sr0", "boardmanufacturer"=>"Microsoft Corporation", "boardproductname"=>"Virtual Machine", "boardserialnumber"=>"0000-0010-6006-7746-5828-7871-43", "chassisassettag"=>"7783-7084-3265-9085-8269-3286-77", "chassistype"=>"Desktop", "dhcp_servers"=>{"eth0"=>"168.63.129.16", "system"=>"168.63.129.16"}, "disks"=>{"fd0"=>{"size"=>"4.00 KiB", "size_bytes"=>4096}, "sda"=>{"model"=>"Virtual Disk", "size"=>"32.00 GiB", "size_bytes"=>34359738368, "vendor"=>"Msft"}, "sdb"=>{"model"=>"Virtual Disk", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"Msft"}, "sr0"=>{"model"=>"Virtual CD/ROM", "size"=>"628.00 KiB", "size_bytes"=>643072, "vendor"=>"Msft"}}, "dmi"=>{"bios"=>{"release_date"=>"06/02/2017", "vendor"=>"American Megatrends Inc.", "version"=>"090007"}, "board"=>{"manufacturer"=>"Microsoft Corporation", "product"=>"Virtual Machine", "serial_number"=>"0000-0010-6006-7746-5828-7871-43"}, "chassis"=>{"asset_tag"=>"7783-7084-3265-9085-8269-3286-77", "type"=>"Desktop"}, "manufacturer"=>"Microsoft Corporation", "product"=>{"name"=>"Virtual Machine", "serial_number"=>"0000-0017-8302-7891-2115-8198-39", "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7"}}, "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "facterversion"=>"3.12.4", "filesystems"=>"ext2,ext3,ext4,udf,xfs", "fips_enabled"=>false, "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"rhel7test", "hypervisors"=>{"hyperv"=>{}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.0.6", "ipaddress6"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_eth0"=>"fe80::20d:3aff:fe90:5780", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.0.6", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.10", "kernelrelease"=>"3.10.0-693.46.1.el7.x86_64", "kernelversion"=>"3.10.0", "load_averages"=>{"15m"=>0.08, "1m"=>0.32, "5m"=>0.19}, "macaddress"=>"00:0d:3a:90:57:80", "macaddress_eth0"=>"00:0d:3a:90:57:80", "manufacturer"=>"Microsoft Corporation", "memory"=>{"swap"=>{"available"=>"2.00 GiB", "available_bytes"=>2147479552, "capacity"=>"0%", "total"=>"2.00 GiB", "total_bytes"=>2147479552, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"7.42 GiB", "available_bytes"=>7963906048, "capacity"=>"4.67%", "total"=>"7.78 GiB", "total_bytes"=>8353742848, "used"=>"371.78 MiB", "used_bytes"=>389836800}}, "memoryfree"=>"7.42 GiB", "memoryfree_mb"=>7594.97265625, "memorysize"=>"7.78 GiB", "memorysize_mb"=>7966.75, "mountpoints"=>{"/"=>{"available"=>"29.95 GiB", "available_bytes"=>32156790784, "capacity"=>"4.91%", "device"=>"/dev/sda2", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"31.50 GiB", "size_bytes"=>33817882624, "used"=>"1.55 GiB", "used_bytes"=>1661091840}, "/boot"=>{"available"=>"393.75 MiB", "available_bytes"=>412880896, "capacity"=>"20.72%", "device"=>"/dev/sda1", "filesystem"=>"xfs", "options"=>["rw", "seclabel", "relatime", "attr2", "inode64", "noquota"], "size"=>"496.66 MiB", "size_bytes"=>520785920, "used"=>"102.91 MiB", "used_bytes"=>107905024}, "/dev/shm"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}, "/mnt/resource"=>{"available"=>"47.04 GiB", "available_bytes"=>50506170368, "capacity"=>"4.18%", "device"=>"/dev/sdb1", "filesystem"=>"ext4", "options"=>["rw", "seclabel", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52708212736, "used"=>"2.05 GiB", "used_bytes"=>2202042368}, "/run"=>{"available"=>"3.88 GiB", "available_bytes"=>4168146944, "capacity"=>"0.21%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"8.32 MiB", "used_bytes"=>8724480}, "/run/user/1000"=>{"available"=>"796.68 MiB", "available_bytes"=>835375104, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "seclabel", "nosuid", "nodev", "relatime", "size=815796k", "mode=700", "uid=1000", "gid=1000"], "size"=>"796.68 MiB", "size_bytes"=>835375104, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"3.89 GiB", "available_bytes"=>4176871424, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "seclabel", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"3.89 GiB", "size_bytes"=>4176871424, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.0.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.0.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"168.63.129.16", "domain"=>"104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "fqdn"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "hostname"=>"rhel7test", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.0.6", "netmask"=>"255.255.255.0", "network"=>"10.0.0.0"}], "bindings6"=>[{"address"=>"fe80::20d:3aff:fe90:5780", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"168.63.129.16", "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.0.6", "ip6"=>"fe80::20d:3aff:fe90:5780", "mac"=>"00:0d:3a:90:57:80", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.0.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"RedHat", "operatingsystemmajrelease"=>"7", "operatingsystemrelease"=>"7.4", "os"=>{"architecture"=>"x86_64", "family"=>"RedHat", "hardware"=>"x86_64", "name"=>"RedHat", "release"=>{"full"=>"7.4", "major"=>"7", "minor"=>"4"}, "selinux"=>{"config_mode"=>"enforcing", "config_policy"=>"targeted", "current_mode"=>"enforcing", "enabled"=>true, "enforced"=>true, "policy_version"=>"28"}}, "osfamily"=>"RedHat", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"xfs", "mount"=>"/boot", "size"=>"500.00 MiB", "size_bytes"=>524288000, "uuid"=>"b3f65ad5-0571-4ae4-937a-13ef2fda43e3"}, "/dev/sda2"=>{"filesystem"=>"xfs", "mount"=>"/", "size"=>"31.51 GiB", "size_bytes"=>33834401792, "uuid"=>"e9643aa4-b339-43c4-afc5-fcac22af1584"}, "/dev/sdb1"=>{"filesystem"=>"ext4", "mount"=>"/mnt/resource", "size"=>"50.00 GiB", "size_bytes"=>53684994048, "uuid"=>"07908b37-1661-4130-9d5a-e1fdb0a4bdb2"}}, "path"=>"/sbin:/bin:/usr/sbin:/usr/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processor1"=>"Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz"], "physicalcount"=>1}, "productname"=>"Virtual Machine", "puppetversion"=>"6.0.9", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.3"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.3", "selinux"=>true, "selinux_config_mode"=>"enforcing", "selinux_config_policy"=>"targeted", "selinux_current_mode"=>"enforcing", "selinux_enforced"=>true, "selinux_policyversion"=>"28", "serialnumber"=>"0000-0017-8302-7891-2115-8198-39", "ssh"=>{"ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7", "sha256"=>"SSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929", "sha256"=>"SSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a", "sha256"=>"SSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "type"=>"ssh-rsa"}}, "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMYggL8slLxRmDxaMceOJ4c8pVKIVA4uUZ4b4jPo7+s8xUHEZkngmqSfHGJpJ4uaDSwO4rNOYVAyCZVK4sDJBuU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAINswqLjeLueVwG3UgsjhTNQGUg2Y7zayfIXJd783I44K", "sshfp_ecdsa"=>"SSHFP 3 1 8b4b534a70cc57bfbebb88a6d980c397fa9dddf7\nSSHFP 3 2 ab2e72961bc6515482c34e7c8358f929026fc8af979d5a9fa16bd9a25bf4bcb2", "sshfp_ed25519"=>"SSHFP 4 1 559ecc22a9b45200bd56dd86455250e203668929\nSSHFP 4 2 d005f680bbb24dc3c670c16d4cc87a59a871c4bed2763a17141b03d10d480282", "sshfp_rsa"=>"SSHFP 1 1 ec0afe862095855d6ca6174cceec173e241afe6a\nSSHFP 1 2 af54fb6de7ea67ba7e8b93f99af27d7984dc02224aee7de886d269797ae64b11", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfGHvDLYXMARhNOK21bV8ZWnwOSxtAcdenfMP/wVlLshAPtqXMzXiDeaFJKfXrKMuiP3aWEbqtERPQnmu+AGfvOekwM6YoHIHCszhnP4ASSpITEuY3ZgVM6qQLgdClBMSdbEoHQ2f6Lem3Uy/7fekA1ofvofp6BtqO5s/Sk3zQhYhDS/TfSw2wlB6J/VrmOimnqhoMq6JLDFJtbYtBFFPqlpf5CZfzOXwAGBnoAuSRO7rtRzXE7caAHMRAdFWlGX1S5zzCJueUyQm3cVvMfqyjbGWJmxDbtIUaDpE+63jLwMidaSu1ZF0Q3mMRvPP0x/g8EZ+EnATl5rPYvVJqcq1", "swapfree"=>"2.00 GiB", "swapfree_mb"=>2047.99609375, "swapsize"=>"2.00 GiB", "swapsize_mb"=>2047.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>215, "uptime"=>"0:03 hours"}, "timezone"=>"UTC", "uptime"=>"0:03 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>215, "uuid"=>"33E071F7-CDA2-3F45-931D-2BFD893683C7", "virtual"=>"hyperv", "clientcert"=>"rhel7test.104sjco4dnxe3mx0wbzfwnbl1h.gx.internal.cloudapp.net", "clientversion"=>"6.0.9", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'RHEL-7.4' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_SLES-11.3-64_spec.rb b/.onceover/spec/classes/role__windows_on_SLES-11.3-64_spec.rb new file mode 100644 index 0000000..2405603 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_SLES-11.3-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set SLES-11.3-64" do + node_facts = {"aio_agent_version"=>"1.8.3", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D"}}, "domain"=>"lan.asio", "facterversion"=>"3.5.1", "filesystems"=>"ext3,iso9660,squashfs", "fqdn"=>"sles11-sp3.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles11-sp3", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe48:617f", "ipaddress6_eth0"=>"fe80::216:3eff:fe48:617f", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.0", "kernelrelease"=>"3.0.101-0.47.67-default", "kernelversion"=>"3.0.101", "load_averages"=>{"15m"=>0.06, "1m"=>0.18, "5m"=>0.08}, "macaddress"=>"00:16:3e:48:61:7f", "macaddress_eth0"=>"00:16:3e:48:61:7f", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"354.30 MiB", "available_bytes"=>371511296, "capacity"=>"27.78%", "total"=>"490.61 MiB", "total_bytes"=>514437120, "used"=>"136.30 MiB", "used_bytes"=>142925824}}, "memoryfree"=>"354.30 MiB", "memoryfree_mb"=>354.30078125, "memorysize"=>"490.61 MiB", "memorysize_mb"=>490.60546875, "mountpoints"=>{"/"=>{"available"=>"47.14 GiB", "available_bytes"=>50611761152, "capacity"=>"4.22%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "errors=continue", "barrier=1", "data=ordered"], "size"=>"49.21 GiB", "size_bytes"=>52843638784, "used"=>"2.08 GiB", "used_bytes"=>2231877632}, "/dev/shm"=>{"available"=>"245.29 MiB", "available_bytes"=>257208320, "capacity"=>"0.00%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "relatime"], "size"=>"245.30 MiB", "size_bytes"=>257216512, "used"=>"8.00 KiB", "used_bytes"=>8192}}, "mtu_eth0"=>1500, "mtu_lo"=>16436, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"lan.asio", "fqdn"=>"sles11-sp3.lan.asio", "hostname"=>"sles11-sp3", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe48:617f", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, {"address"=>"127.0.0.2", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>16436, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe48:617f", "mac"=>"00:16:3e:48:61:7f", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.3", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"11.3", "major"=>"11", "minor"=>"3"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "mount"=>"/", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"586adc21-9cfc-4e12-93e6-c711ab2400b1"}}, "path"=>"/usr/bin:/bin:/usr/sbin:/sbin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.8.2", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5", "sha256"=>"SSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11"}, "key"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17", "sha256"=>"SSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41", "sha256"=>"SSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBALvEn/P3Kfg/yFWplaqFsrUOk/Kh9aOZTNNCoJX7lsSQkWpLDkjz03IZZ1pUsykZp6HUhzfW1ZCOKme5503MAsflB78fjgsfGaVL2IcWOvPhurC8SXGivanS5+rL3CFqja/+nMJBPFg8oEyjJei6RJZCQtlEFSEJziKMVI368fxLAAAAFQCC8c+IrxPZc4zVe5EF6qsPnZtMiwAAAIEApfv1xS6ECWq1f8J43BXFdiRszBXQecgdPtf6STvabnYdLKScAPyu3JdosrPswlZWEXLz+srkqqai6xISeSxLKrlY570GNVPmgnBFmoz+iJRi6kakroNe5xjGT45aTyZ16cyg9LFHFLL3KadlzZXu+9XwS9kv09SFlvH6+9+XNGMAAACBALLbpqIZKISARdnFviWOWzFbvYzZHiO3ddAYnXVCGfW1ywmGDqc5kUNTZsBFNYVA56YcaHR/kwFHjOij3SJnvy6VxSG9sSZ4wex/FGBmTUmklelZQsywITGps3MWxiyO3TGfIEXJlqgyVxXZhXnIshN//NCCPbq2X7X7VyTyGjhI", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK9w38lDcCpjkGqrTdhhsZCVzS2XKgC6Q9fTvkZn1RLhvvWjDBHyFg0KyTAqfepMNNjdgHqEBFumKc3w+L5xLuY=", "sshfp_dsa"=>"SSHFP 2 1 2f39a5ddd25d30676bceb1b99faec8330cb80cd5\nSSHFP 2 2 d17b59f49908df6bd337918a31a4e38f8489a0c46ada06963cb67ab3a4bdfb11", "sshfp_ecdsa"=>"SSHFP 3 1 7fc0ef4bb2d2d14db8fc0bc0b1b97a9d83c6dc17\nSSHFP 3 2 a0b01ecd2461ed45e0b51ebec48f79957a9710c3ec441cde0e6c4e5d8939c15e", "sshfp_rsa"=>"SSHFP 1 1 20cdd84628cfad3edff17edf9ce3c2f7f1756f41\nSSHFP 1 2 f48e7e96ed7708c6225367ada2a29309f159a12443eeaed6c86efee0660f3f78", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC2nt/gDBidRKDNUmDDThXA+mMWQxq83odOXzx4/3NHMMfIfu3nuvcCaTI+Tp1EiNcbb6Q2ummoGdJpCXT6/W4cjfluuun1rBDeQzzFfthdBAasNKbSCy+cYKwda0zfP9X4Az0SqsbHM5DekNS0w0stCB+L5qqlhaKyunyid2PaeLfSalP5RbcAxGSy5ijLNcAZqbuNOEiq1v0IIySCPplvzvEv//Ht8PhPhXQiRRtKMeq5pAgqjLeUq5zRlXIVqTYfZPfa5tuteaZNxpRxbDvog7h57LWsHKZSjc8ND2ocoehIymNeL4kpFkLg6TMm6BEEOEks5Kue/SXdYUbHkRKN", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>524, "uptime"=>"0:08 hours"}, "timezone"=>"UTC", "uptime"=>"0:08 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>524, "uuid"=>"8B82075A-B071-4035-A96A-3B5D08F6841D", "virtual"=>"virtualbox", "clientcert"=>"sles11-sp3.lan.asio", "clientversion"=>"4.8.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'SLES-11.3-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_SLES-12.1-64_spec.rb b/.onceover/spec/classes/role__windows_on_SLES-12.1-64_spec.rb new file mode 100644 index 0000000..3d0cb2d --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_SLES-12.1-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set SLES-12.1-64" do + node_facts = {"aio_agent_build"=>"1.7.2", "aio_agent_version"=>"1.7.2", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>53687091200, "blockdevice_sda_vendor"=>"VBOX", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"50.00 GiB", "size_bytes"=>53687091200, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E"}}, "domain"=>"openstack.site", "facterversion"=>"3.4.2", "filesystems"=>"ext2,ext3,ext4", "fqdn"=>"sles12-sp1.openstack.site", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"sles12-sp1", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth0"=>"fe80::216:3eff:fe72:f121", "ipaddress6_eth1"=>"fe80::a00:27ff:fe60:90e", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"192.168.33.15", "ipaddress_lo"=>"127.0.0.1", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.12", "kernelrelease"=>"3.12.62-60.64.8-default", "kernelversion"=>"3.12.62", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.02}, "macaddress"=>"00:16:3e:72:f1:21", "macaddress_eth0"=>"00:16:3e:72:f1:21", "macaddress_eth1"=>"08:00:27:60:09:0e", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.78 GiB", "available_bytes"=>1907027968, "capacity"=>"68.84%", "total"=>"5.70 GiB", "total_bytes"=>6119927808, "used"=>"3.92 GiB", "used_bytes"=>4212899840}}, "memoryfree"=>"1.78 GiB", "memoryfree_mb"=>1818.68359375, "memorysize"=>"5.70 GiB", "memorysize_mb"=>5836.41796875, "mountpoints"=>{"/"=>{"available"=>"45.34 GiB", "available_bytes"=>48682504192, "capacity"=>"7.64%", "device"=>"/dev/sda1", "filesystem"=>"ext3", "options"=>["rw", "relatime", "data=ordered"], "size"=>"49.09 GiB", "size_bytes"=>52709421056, "used"=>"3.75 GiB", "used_bytes"=>4026916864}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"192.168.33.0", "network_lo"=>"127.0.0.0", "networking"=>{"domain"=>"openstack.site", "fqdn"=>"sles12-sp1.openstack.site", "hostname"=>"sles12-sp1", "interfaces"=>{"eth0"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::216:3eff:fe72:f121", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"bindings"=>[{"address"=>"192.168.33.15", "netmask"=>"255.255.255.0", "network"=>"192.168.33.0"}], "bindings6"=>[{"address"=>"fe80::a00:27ff:fe60:90e", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "ip"=>"192.168.33.15", "ip6"=>"fe80::a00:27ff:fe60:90e", "mac"=>"08:00:27:60:09:0e", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"192.168.33.0", "network6"=>"fe80::"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::216:3eff:fe72:f121", "mac"=>"00:16:3e:72:f1:21", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"eth0"}, "operatingsystem"=>"SLES", "operatingsystemmajrelease"=>"12", "operatingsystemrelease"=>"12.1", "os"=>{"architecture"=>"x86_64", "family"=>"Suse", "hardware"=>"x86_64", "name"=>"SLES", "release"=>{"full"=>"12.1", "major"=>"12", "minor"=>"1"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Suse", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext3", "label"=>"ROOT", "mount"=>"/", "partuuid"=>"3d2745bf-01", "size"=>"50.00 GiB", "size_bytes"=>53686042624, "uuid"=>"dcf2494f-2b02-466b-aa2c-9e7c01bdbdd7"}}, "path"=>"/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/games", "pe_build"=>"2016.4.3", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "pe_server_version"=>"2016.4.3", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"sles-12-x86_64", "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "processors"=>{"count"=>4, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppetversion"=>"4.7.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.9"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.9", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1", "sha256"=>"SSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5"}, "key"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b", "sha256"=>"SSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459", "sha256"=>"SSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51", "sha256"=>"SSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAK+haL65A0ALR7nw0X5re26C23ncFgxvedmnE2iUbjbeM7F//EBeA4Gn3mjbtPkTVDu61Tfl45tCHKHa36l2w5rC2mt71yMGJQoHeDtA4ddO2uA+B19fmkfhAICtjrvYc8vj5jwwcVmmP0FUasIunM0/9uAhZ+97E7+I91bPhp/RAAAAFQDNpq248quBrulsV6qkoYv00XODZwAAAIBAe5mwq4iS3DH5ABJSJoGGrWZBrY2ZPYcpzqStDN12I+lNL0HqoZF3dRdXUiiAl0qGpO9vtaTtrJzQuahTpB0k/HkMP042Kqa/hhkobuPlvu5Xuuj5cNzLuditXn5ScKs8BXaoh6mvOAAIS1jY9BZ+dGxZfygvjjtcAWHWCVAxoQAAAIACBpgms8yMLnEd5qY7kF5hqO7DNJ6Q0xyFOB5zWKhj1nbCUmxKBiF2XjXZGZc+6LD0Hg1fs1EiW9ed9g7F7/7LLtlgzeJPIg8vuqsRvCj3JkwFDmGHfA2Z0EYU4sn8dmw1RLeoWY0fCaPM+x00hSa36VMMXAHEd2MCUPYTTiMmaQ==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnNFUni4th60YWWMAHbe9fByciHV0mswnuc2CzGSzziVAUbsSKmJktAHNmcYKssztsMpBPsPMLM9j8ceD59jmI=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIB9nMKgF7UeoNyuUwz3ifm0M4QjlEjGNSLxvFm6xXVhx", "sshfp_dsa"=>"SSHFP 2 1 4c29775fbdf4c3c3899d036510ced3a377023cd1\nSSHFP 2 2 6b21d41b5df2640a9b710884c10d8f87dbc2944e639a5e46273bfb4aa76522c5", "sshfp_ecdsa"=>"SSHFP 3 1 d1c37b4313689a7afe74eead74ea53699234505b\nSSHFP 3 2 60246f4a32257320dc990997d7373eede1667aaead6ea95baa32fa07fec824cd", "sshfp_ed25519"=>"SSHFP 4 1 37cbc33c742e357446b82735b529cd0d6dd5c459\nSSHFP 4 2 2228771c3a8436da3436b331f293b2394f8e24f12cf6590d75d5077b37e7cacf", "sshfp_rsa"=>"SSHFP 1 1 d1ccfdf4e0afc38d26ab2d3b44f37c1ec7eefe51\nSSHFP 1 2 f492d7edf7cc14c5e8472aa10aa6e7cf049032f9a52584e07c10101af807fe38", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTmNl1i5lo2aP6quMk+/thACsrOK50twMge6KfZ6J1Q6ncsjjpZNA745pgvUJuQx2STl2vCMT3aTbGIrw+FXGNbfRWRa9pUUTJE82mgcPnYsMqWo+JQwuJOjhdaDlV8r7U197ZIsOM+eo2CBYYUP/ZAFbGzFL4Wb29hld1MiHSACcRC7HozgAxPCUyOZ0mcckofFIW/XO289UmEJj27RSnM3YyaOXxg+xv7tjxjLaq7j4HlFR5HZt4OYdzoHMTSwexcNtyM8TyNu9OKSGSYuQNWxghltrElP+Hg1Zgw8Bxhyf+a9KqF9/Q7Z0zWvwoJE3II9kHij2M73eiadZPj/", "staging_http_get"=>"curl", "system_uptime"=>{"days"=>1, "hours"=>41, "seconds"=>148058, "uptime"=>"1 day"}, "timezone"=>"UTC", "uptime"=>"1 day", "uptime_days"=>1, "uptime_hours"=>41, "uptime_seconds"=>148058, "uuid"=>"7733628A-3D10-4F0B-B6E2-DB6D0CBB8F7E", "virtual"=>"virtualbox", "clientcert"=>"sles12-sp1.openstack.site", "clientversion"=>"4.7.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'SLES-12.1-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Ubuntu-12.04-32_spec.rb b/.onceover/spec/classes/role__windows_on_Ubuntu-12.04-32_spec.rb new file mode 100644 index 0000000..80c9dd7 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Ubuntu-12.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Ubuntu-12.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_eth0"=>"fe80::a00:27ff:fe8d:6188", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.03, "1m"=>0.23, "5m"=>0.09}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:8d:61:88", "macaddress_eth0"=>"08:00:27:8d:61:88", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"407.73 MiB", "available_bytes"=>427540480, "capacity"=>"17.64%", "total"=>"495.05 MiB", "total_bytes"=>519102464, "used"=>"87.32 MiB", "used_bytes"=>91561984}}, "memoryfree"=>"407.73 MiB", "memoryfree_mb"=>407.734375, "memorysize"=>"495.05 MiB", "memorysize_mb"=>495.0546875, "mountpoints"=>{"/"=>{"available"=>"1.81 GiB", "available_bytes"=>1940865024, "capacity"=>"36.14%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.02 GiB", "used_bytes"=>1098407936}, "/boot"=>{"available"=>"203.56 MiB", "available_bytes"=>213447680, "capacity"=>"13.50%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"31.76 MiB", "used_bytes"=>33307648}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe8d:6188", "mac"=>"08:00:27:8d:61:88", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"3fff8935-622f-4e9a-944f-38108c71af34"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"185fbdf2-880c-4aa6-ada8-8dade7aa3fc6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"31f2e84f-0e99-4531-9ecb-2b151fc6ce31"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"S8Vl05-TIfO-rk5Y-gIDu-TIwj-L8Ub-3OjoJb"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b", "sha256"=>"SSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0"}, "key"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21", "sha256"=>"SSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f", "sha256"=>"SSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAOBWnH+OxYCpvG4X6e4AFQNUreLJ3AvvgUUyIirhJ+zhg3IgAoe0LGc1i8t1HPBrmnZDe0jLJJVzQU42jrfQZHlZSlydnkfjoa/Z8R2ruMa+972wODUvSTAtIkuJeYKTMdNQVJCTkiy6DwU2K8UT32uVb6nN/oLHLroM7rQGaZuXAAAAFQC+aaKJlj/9kRyIiQjmYWrMJiry5wAAAIB9Q1hRlr7ZIlDSpmXPk1cVh7e4s0B89NAd4M/49iM5ZXj4FyMtFvsO+tWlRrNhgVJYTK/2agwf9FhBVD0nTqqAKOnisjmRv6QD8jADoVdI7sxxqGRs+HneMjfSXe2sCD8LFQENB3+uY1fIgfvVqAgCRR7QOFA7Xm0xh/iiu2H6+AAAAIEAsnZ59SDy2ISkiaZu9s6TXnt+WrBqtkAqpLMr7Sy+lsV1zWkoEgHKPUrBW1Yfc4tByXCqJk/YrYbkPrVN7ng5E30QACV//YmCaBD76Jm+VDjHFGgaGzh18PhuR/vnhByQ+b+MAE22IE3kqMakxnLpxowWUVVbm0CTG3lFMGvGFnA=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF5AGWyOlygr7/VMxZepE9A7W5UxuQY9NqxokurV4IR0hWR3K3qZ+ro8ai55HE07W16EGHt5FPLi3ocnzr0U1R0=", "sshfp_dsa"=>"SSHFP 2 1 9cb1f6d6a1730dcc9e02dc62be68874f11e5dd6b\nSSHFP 2 2 6e391d8fc3ab5c57147ba946aafe236972ec89cca3dfb2937f6a874524f1bce0", "sshfp_ecdsa"=>"SSHFP 3 1 75fd3452191ff0c693a6e76d75a9a617230e8b21\nSSHFP 3 2 0ae893992e316dcbed9e14b009a8f00df48a352377da435a4d75a97f7c8e6668", "sshfp_rsa"=>"SSHFP 1 1 198e8faaf2a7b3c5d0d8071a5fb89d3673baa48f\nSSHFP 1 2 3c8ba605220954898d29864d617d8e1330d5ac3df2bd73e718fb2ab97098f9ee", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDGzlnmGodUPjwICVkKWpSoIG47EJLT2SYCsCMFjHLUbD6mgXe2vAhgTSwaxxL8lEecc9lZRi1VCG/CaUZFCwirSysADa5pewIA6fFfYNiBqwg56MOEC2cyeQePshi73FRkvPpwQsisAhieW8XCA+93fDPbaQaQpDpc8lIeraVFRkhxSZ2MD2j+4/gMvTH+oIHFa12GidUoRpEryt6qXFrV0dg+L5OKvIGDntssFnBE+zG3lhlFcdm3CwQp34MaVolaDtkCt5klO2GaVLHxtcyG+8wM54urHuW7HK3jxaZwKBeAQJ00rQsuC2dRljOZ9RFFCUWPf/XuCP9nNXEu1hEN", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>60, "uptime"=>"0:01 hours"}, "timezone"=>"PST", "uptime"=>"0:01 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>60, "uuid"=>"3A7F9D94-3B88-45AB-99A4-57745C934A08", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Ubuntu-12.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Ubuntu-12.04-64_spec.rb b/.onceover/spec/classes/role__windows_on_Ubuntu-12.04-64_spec.rb new file mode 100644 index 0000000..0b06e76 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Ubuntu-12.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Ubuntu-12.04-64" do + node_facts = {"architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_eth0"=>"fe80::a00:27ff:fe5f:df27", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.13", "kernelrelease"=>"3.13.0-32-generic", "kernelversion"=>"3.13.0", "load_averages"=>{"15m"=>0.01, "1m"=>0.0, "5m"=>0.01}, "lsbdistcodename"=>"precise", "lsbdistdescription"=>"Ubuntu 12.04.5 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"12.04", "lsbmajdistrelease"=>"12.04", "macaddress"=>"08:00:27:5f:df:27", "macaddress_eth0"=>"08:00:27:5f:df:27", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"350.97 MiB", "available_bytes"=>368017408, "capacity"=>"28.33%", "total"=>"489.72 MiB", "total_bytes"=>513507328, "used"=>"138.75 MiB", "used_bytes"=>145489920}}, "memoryfree"=>"350.97 MiB", "memoryfree_mb"=>350.96875, "memorysize"=>"489.72 MiB", "memorysize_mb"=>489.71875, "mountpoints"=>{"/"=>{"available"=>"17.68 GiB", "available_bytes"=>18981703680, "capacity"=>"6.12%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.15 GiB", "used_bytes"=>1237438464}, "/boot"=>{"available"=>"202.55 MiB", "available_bytes"=>212389888, "capacity"=>"13.93%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"32.77 MiB", "used_bytes"=>34365440}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe5f:df27", "mac"=>"08:00:27:5f:df:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"12.04", "operatingsystemrelease"=>"12.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"precise", "description"=>"Ubuntu 12.04.5 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"12.04", "major"=>"12.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"96092a10-847b-4a55-b5dc-87d2cc56ee5e"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"50695407-158d-4b0e-975a-b575fa5f5359"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"829f03e2-ceb8-4f8d-9f32-e1336456f719"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"P6GCnD-xaHj-APeE-m1Em-fr5a-z3Kk-iFVziN"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630", "sha256"=>"SSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420", "sha256"=>"SSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740", "sha256"=>"SSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPHTvj71+XfT0li+zpLYPbY5wKyO36Mij5D4Otl1RMIbZK68No9pDhiPdxMgZrLSq9bHLYs+cxqtSrpZgnNLvT44P+BPZbbQE4HrfcYuv0o2ifa0bqzlyHYl+BT6qSmx8zgBh3iImuhAJhLPnGCzgQ2FkfjAiHKHT1LG4h2knvtTAAAAFQDHa6q8yJo47htrK8LG0D3iAfTT2QAAAIEAtFgO4Qw6K2fQnLSfxL7h98lRopA4tokzKinUjJAoQ86eu9oR4mHDh3FRQlaHJX52RT1GABctV5MyG9LJxUuJLdeyIA7bmJrIPi0TROlHCd3NaS+0r6d1BzmMy+v7cVZsDK+8fqYBjC3b3e+lr3khnUU9uz8GqtrGFrDxjkl8y8QAAACAIKPdIYNLGaoreSz/L0PLSE6xw6+bButDCuuODpGXtD6Q6Cwo+4bjvAwV/yNMVIbrZdic8xjWh1YLxaCx0622XX8wr8GPLr3HViJ74VryCRkvsgXXuZcDl3z5+eEq1YDd5ELzpCcpkW31f64VWYLOIqz3Uo5hXeeCrSEt2vmh+Eo=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPZ7/g0ZAcDbNMyMEABW/giY5lPyalZ717tzqmt1baNzEXALYoFN2FMHL/Wid8DUl7oKnXHGSkc4JYYFgpvt11Q=", "sshfp_dsa"=>"SSHFP 2 1 59bc746d9ab774867521d076613863790a696630\nSSHFP 2 2 8d5bdb7662b7b938beb6517c7d001cc68136d3f1ded5b240cbee1a89dad2d79f", "sshfp_ecdsa"=>"SSHFP 3 1 cc6522d24466d3704070e9fda54dc60147978420\nSSHFP 3 2 9ac8780c7818c208926a847d5f2c3fc274a37a0ed8ae0276f96fb3203e0e0e00", "sshfp_rsa"=>"SSHFP 1 1 0ea50bd46b70a8f9efae23a8bea49388972e9740\nSSHFP 1 2 0c1c44799be36031d1a8da2d02b9ed4b299ab924c647605afecb1c73063fb307", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCvijE5JYtnXa4uibGq6UEqXn7fboZYCvwZ3RFSkkG6qQ51Q7685OJgayGAZkrbiTeEWOHN6MQPr3TKwSQD2YxoUw3qKQ+hsuTydPK/ZXtNxM0ejFvpIprG1U1NDwj2YVxwo4tQveUewbBQYzEyI1aNQaE2z/fPypQOEj0v9QNAapmGGlV8ab0q0izCM4Aen5pccRZLJuibUUY3nOEfE0QTIM3QmOZoKEmj/Ez3P3+16iGeRNId/+8Bf4R5eVrKhorUUt+H/y/WcCHT5KrbCWkEH6G3eEQ7UA6XCB/sQ5pC6ZKxBbyYjy8N5wySv+5PVpoUHhHjKoSuYy6qQDE2MwRz", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>368, "uptime"=>"0:06 hours"}, "timezone"=>"PST", "uptime"=>"0:06 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>368, "uuid"=>"47C86ACE-B882-46AD-8D6D-4260BF97C669", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Ubuntu-12.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Ubuntu-14.04-32_spec.rb b/.onceover/spec/classes/role__windows_on_Ubuntu-14.04-32_spec.rb new file mode 100644 index 0000000..b2dcb9c --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Ubuntu-14.04-32_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Ubuntu-14.04-32" do + node_facts = {"architecture"=>"i386", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>0, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>0, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7"}}, "domain"=>"wifredrick.local", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"localhost.wifredrick.local", "gid"=>"root", "hardwareisa"=>"i686", "hardwaremodel"=>"i686", "hostname"=>"localhost", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_eth0"=>"fe80::a00:27ff:fe71:8945", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.05, "1m"=>0.0, "5m"=>0.07}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:71:89:45", "macaddress_eth0"=>"08:00:27:71:89:45", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"414.97 MiB", "available_bytes"=>435126272, "capacity"=>"16.34%", "total"=>"496.04 MiB", "total_bytes"=>520130560, "used"=>"81.07 MiB", "used_bytes"=>85004288}}, "memoryfree"=>"414.97 MiB", "memoryfree_mb"=>414.96875, "memorysize"=>"496.04 MiB", "memorysize_mb"=>496.03515625, "mountpoints"=>{"/"=>{"available"=>"1.72 GiB", "available_bytes"=>1846272000, "capacity"=>"39.25%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"2.83 GiB", "size_bytes"=>-1255694336, "used"=>"1.11 GiB", "used_bytes"=>1193000960}, "/boot"=>{"available"=>"200.06 MiB", "available_bytes"=>209779712, "capacity"=>"14.98%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"35.26 MiB", "used_bytes"=>36975616}}, "mtu_eth0"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"wifredrick.local", "fqdn"=>"localhost.wifredrick.local", "hostname"=>"localhost", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:fe71:8945", "mac"=>"08:00:27:71:89:45", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"i386", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"i686", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"b31f5de0-8805-43da-b3f2-da9e51c3401b"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"569bc4ac-b4e8-4e62-8503-551a63285383"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"f00f661b-b4b5-4e6f-bba3-3dcacf85fd8e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>-257949696, "uuid"=>"vF1RtV-BHmi-b0UW-QR1z-tJ48-g6Tn-aGgEn7"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"i686", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"i686-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"i686-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf", "sha256"=>"SSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375"}, "key"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1", "sha256"=>"SSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7", "sha256"=>"SSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae", "sha256"=>"SSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAKG/fk+L4qOg6yF5DOrNdiTsaSvD7lsYpJAFGR5AJqtmtXZsRckVuydvmsbLVDNi+P+XaO6Sr/dkFfj89vAx6gB+qZxtEbasdoUiddpjzONvjmvfzmGlFZhlptlYTSu3Ci89mY6ZergBMtGqLGh8VmcNPI54eNexasVdG4nbkcxPAAAAFQCaJGszl2tCCa6KY7GYCOisCeGwtwAAAIBDzQlFkAi7IZAQpaUS6V+1frDgnCipxXjDSZD+ObJ4Wgwrj01+vXdeHKj30mIRo7ZatXxZs2dkQHUeL0SJ/bpsdd1jOu4Mf8c+cHqSHcC4Qz2vtlARKNMXAY5vJHh7QBwaPf3/s8tWqX9lnyu1UdTjE/SgF322Nwkz9OFvCHbuuwAAAIBPA32N7qVPwEOsTBG8xVPcUXwguj6ube0n0OUsZB5i8PFjQ99nLbZce9ucLqVzPCYeClgbPrVH1MBtRc67QLKb6Kms8pseuFCtiB78j9A36PfNfTDervnF1Aw/nIb/DQImtmmDKbPhv4uniseqgSdnh2awLVy6UO7haf3Wz6maFA==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCK+3h6/GsmbpRd/xdgTi+vsoh+N6gTB5IZFpZdaJVK6H6cSwmhiEiby/3yqwQFGlSXug8aQiQJ3YZI471wScbU=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAICobX2RUot4PEA4s4fTvltDWEWIXFMehgbTwvLezavoq", "sshfp_dsa"=>"SSHFP 2 1 1d072f5a62c6f3ecb283ca8a54906665550fb2cf\nSSHFP 2 2 216358286cef61e3340afe60750513fc6bdbfc96a7190e32929fc11aeefcd375", "sshfp_ecdsa"=>"SSHFP 3 1 a6f44c1518708b08d997c7a97cc75b0654b098d1\nSSHFP 3 2 2ccda56b2fb9bd95c2327cceaaf8f868daebb1f7dfc5bd0a9d816fff06f7b474", "sshfp_ed25519"=>"SSHFP 4 1 4ca8bd8a83038bc1339ee7037ab2043f41e4b4e7\nSSHFP 4 2 7326c4dfce373f219025f41f127535f0fb9aacc221adf34e75db8eccc118ab3d", "sshfp_rsa"=>"SSHFP 1 1 9da876f061d5f203345c99b047a48b24775f77ae\nSSHFP 1 2 90ca5e6b808b9f47c78e26f9c228dab88b19536d56f6c72443b1d06502646ecf", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQC+fl/b51y7U6i6DGQ+FwkYKIzBSVV6DcIZj+Q3BVRLzviOQIQMfNJ0wvLMKKHK96gWaGlknnU0Tn/cvVShuWbaWFBpOTLDsM2cm0usZot8+EmYGnql8D3AFMxhgWBb7pBa5KJOfJidrprXLcSjW82bKhIYbLDDVWMgaoIEVAbufOCobffpwTBYSPS4OdF3WyqNJj2B9tklkUdeUFYKkCFO/mszwSZdY+0xxTyilmyrHr8evbmoA34LREnktKFiu/I5gPXts1CdVLVzvNsMt0VM+ldLEtGPy7qvcddXy34yax538n+A6VOOBg2wpKwEsmqjkCHdq8s/2eWeeu+xGFch", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>354, "uptime"=>"0:05 hours"}, "timezone"=>"PST", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>354, "uuid"=>"C138B01C-ADF6-4D36-8A3A-D9FCE21FF0C7", "virtual"=>"virtualbox", "clientcert"=>"localhost.wifredrick.local", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Ubuntu-14.04-32' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Ubuntu-14.04-64_spec.rb b/.onceover/spec/classes/role__windows_on_Ubuntu-14.04-64_spec.rb new file mode 100644 index 0000000..ddaa893 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Ubuntu-14.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Ubuntu-14.04-64" do + node_facts = {"aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"amd64", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"VBOX HARDDISK", "blockdevice_sda_size"=>21474836480, "blockdevice_sda_vendor"=>"ATA", "blockdevices"=>"sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "concat_basedir"=>"/opt/puppetlabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"eth0"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"VBOX HARDDISK", "size"=>"20.00 GiB", "size_bytes"=>21474836480, "vendor"=>"ATA"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115"}}, "domain"=>"pdx.puppetlabs.demo", "facterversion"=>"3.0.2", "filesystems"=>"ext2,ext3,ext4,vfat", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "homedir"=>"/root", "hostname"=>"ubuntu1404a", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"eth0,eth1,lo", "ip6tables_version"=>"1.4.21", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth0"=>"fe80::a00:27ff:feea:2027", "ipaddress6_eth1"=>"fe80::a00:27ff:fe61:1916", "ipaddress6_lo"=>"::1", "ipaddress_eth0"=>"10.0.2.15", "ipaddress_eth1"=>"10.20.1.93", "ipaddress_lo"=>"127.0.0.1", "iptables_version"=>"1.4.21", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"3.16", "kernelrelease"=>"3.16.0-30-generic", "kernelversion"=>"3.16.0", "load_averages"=>{"15m"=>0.06, "1m"=>0.49, "5m"=>0.17}, "lsbdistcodename"=>"trusty", "lsbdistdescription"=>"Ubuntu 14.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"14.04", "lsbmajdistrelease"=>"14.04", "macaddress"=>"08:00:27:ea:20:27", "macaddress_eth0"=>"08:00:27:ea:20:27", "macaddress_eth1"=>"08:00:27:61:19:16", "manufacturer"=>"innotek GmbH", "memory"=>{"swap"=>{"available"=>"512.00 MiB", "available_bytes"=>536866816, "capacity"=>"0%", "total"=>"512.00 MiB", "total_bytes"=>536866816, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"331.30 MiB", "available_bytes"=>347394048, "capacity"=>"32.35%", "total"=>"489.74 MiB", "total_bytes"=>513531904, "used"=>"158.44 MiB", "used_bytes"=>166137856}}, "memoryfree"=>"331.30 MiB", "memoryfree_mb"=>331.30078125, "memorysize"=>"489.74 MiB", "memorysize_mb"=>489.7421875, "mountpoints"=>{"/"=>{"available"=>"17.58 GiB", "available_bytes"=>18880684032, "capacity"=>"6.62%", "device"=>"/dev/mapper/localhost--vg-root", "filesystem"=>"ext4", "options"=>["rw", "errors=remount-ro"], "size"=>"18.83 GiB", "size_bytes"=>20219142144, "used"=>"1.25 GiB", "used_bytes"=>1338458112}, "/boot"=>{"available"=>"198.65 MiB", "available_bytes"=>208301056, "capacity"=>"15.58%", "device"=>"/dev/sda1", "filesystem"=>"ext2", "options"=>["rw"], "size"=>"235.32 MiB", "size_bytes"=>246755328, "used"=>"36.67 MiB", "used_bytes"=>38454272}}, "mtu_eth0"=>1500, "mtu_eth1"=>1500, "mtu_lo"=>65536, "mysql_server_id"=>8608807, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_eth0"=>"ffff:ffff:ffff:ffff::", "netmask6_eth1"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_eth0"=>"255.255.255.0", "netmask_eth1"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_eth0"=>"fe80::", "network6_eth1"=>"fe80::", "network6_lo"=>"::1", "network_eth0"=>"10.0.2.0", "network_eth1"=>"10.20.1.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"pdx.puppetlabs.demo", "fqdn"=>"ubuntu1404a.pdx.puppetlabs.demo", "hostname"=>"ubuntu1404a", "interfaces"=>{"eth0"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "eth1"=>{"ip"=>"10.20.1.93", "ip6"=>"fe80::a00:27ff:fe61:1916", "mac"=>"08:00:27:61:19:16", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::"}, "lo"=>{"ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a00:27ff:feea:2027", "mac"=>"08:00:27:ea:20:27", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"14.04", "operatingsystemrelease"=>"14.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"trusty", "description"=>"Ubuntu 14.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"14.04", "major"=>"14.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/mapper/localhost--vg-root"=>{"filesystem"=>"ext4", "mount"=>"/", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"c94f234c-f947-450d-aaaf-d32be1b7f27f"}, "/dev/mapper/localhost--vg-swap_1"=>{"filesystem"=>"swap", "size"=>"0 bytes", "size_bytes"=>0, "uuid"=>"5501b007-e44b-46cf-b22b-177428cbe5d6"}, "/dev/sda1"=>{"filesystem"=>"ext2", "mount"=>"/boot", "size"=>"243.00 MiB", "size_bytes"=>254803968, "uuid"=>"3a97a5b0-ebd0-4ce6-ba62-d39b4fd0719e"}, "/dev/sda5"=>{"filesystem"=>"LVM2_member", "size"=>"19.76 GiB", "size_bytes"=>21216886784, "uuid"=>"vgfiUo-lVmS-57wx-qv4m-N3fR-efa0-iBI6Cn"}}, "path"=>"/opt/puppetlabs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"ubuntu-14.04-amd64", "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"/opt/puppetlabs/puppet/cache", "puppetversion"=>"4.2.1", "root_home"=>"/root", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c", "sha256"=>"SSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4"}, "key"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A=="}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad", "sha256"=>"SSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo="}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234", "sha256"=>"SSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51", "sha256"=>"SSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAI8c8/RV/kAfEuo71eUt5O1BBbzk34v7b14bi3swzOnzJslJXt2KR/3Dy+8eazzkcw8nbmzZSHvcyo93yQ0LjsExXfG0EkzN7uiE840Fcpg5LFmeCHan0So3Cc1FLavcGu8N+RpWHYYLLmPjlQqPdHSS1rhhXdqKIoiTdlaocXD5AAAAFQCJ0mBV1SSayMNI6tTF4W0o1Y6+cQAAAIBWY05wbeTi/vFgkhH57X0/S7Kr86K3Q/BMz7ZmKF2XCzZW9LJ6Ou0T7tHKAr472DBwUm6IxGHoUXky0Q0+XDCVut9YLYXJK8L/P8SbGwhMfj1YPiv9uorECcrqJMB5W1GCFS+HIo4DvmKYzivcmpE25b/y0V1u5Oas9cQaNZnhxwAAAIBqvLMiEyQPpemji+p+p/9E3sdX6RMUeSHj7n3WSkRTdq09nZ0ewtH12LpbENCjoc4PFh02/qqdub0tjpbgJrMYgwJDADD/AsrdcDBd3gU7mDjyF8PFzWV9nEVYExu447svRt422OW6gkkJ6sn3fovBAvDaWy7OR5YYrg5JLp+/4A==", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJKYyLqXe/n2LFUbqMkwhLyOpg10LYOx/MpdgFXTxUB67AP4/GoX8zfz5Lb6fOidSJTlrzD5FB584JiRlEGUGLo=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIAAhP8P8zhiQrKmyV/U+e5M7nd5X+ZuIEYCPHDoza0rP", "sshfp_dsa"=>"SSHFP 2 1 528b28369558620d8fb12d7bea179e437823154c\nSSHFP 2 2 5a7688dbb06e4b0c72e6e78ae4ca8b379620ba14b019d5b3ae5670936e1acdf4", "sshfp_ecdsa"=>"SSHFP 3 1 505ac6e68fa78305f635f305e11fbb0cc597e8ad\nSSHFP 3 2 d5840c440b5f52a582589e3b2b583ecea53fd6618851dbcfce2e5cca7624f3c8", "sshfp_ed25519"=>"SSHFP 4 1 53784fee8fc968dca5c5d17e731716a012e59234\nSSHFP 4 2 95b82a785582818106bf403e53667fc559eeabf176f103a929a210a38e9c4e05", "sshfp_rsa"=>"SSHFP 1 1 4d3d498c7a3377c8f95ac713db4866c32199be51\nSSHFP 1 2 949c0790f27d5ef7e8b0c35ceabb23bdd50d81611093531c0354330a7234b833", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPayGCFe5RUpJ8/UsH6gf+ecMRWo1dc20+HAy0bV4KalYWN5jUB/wrs41rdJRwMKWczgSDi2gFMsJ7q8Vjvpm2hUy+3H3/AEASRij99+37X1T4A6vPpT45EhTpS6JgGROii1Q2+9AJ/6BE6fSawymgR7jDx5QNLbKRy/FiwZAG+A0n29iUALeKqEZMd/1fU0hQCy/V+9V4DgRbHcJz4lKgc6nYrMymj8tUivTd8zm+CQov+YsUAdaXHSxIGVofnFQYXzbPqWGVV8S3fpwvrn/IY6paZ2F/lHoWombHwE271Bw863oWdkKpzP1nhjR3+Q1z++Tl2ZXT+rp6mhS9Pwv", "staging_http_get"=>"curl", "swapfree"=>"512.00 MiB", "swapfree_mb"=>511.99609375, "swapsize"=>"512.00 MiB", "swapsize_mb"=>511.99609375, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>47, "uptime"=>"0:00 hours"}, "timezone"=>"PDT", "uptime"=>"0:00 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>47, "uuid"=>"C3C98552-9F17-434C-866B-0E254F5CD115", "virtual"=>"virtualbox", "clientcert"=>"ubuntu1404a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Ubuntu-14.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Ubuntu-18.04-64_spec.rb b/.onceover/spec/classes/role__windows_on_Ubuntu-18.04-64_spec.rb new file mode 100644 index 0000000..c8cd316 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Ubuntu-18.04-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Ubuntu-18.04-64" do + node_facts = {"aio_agent_version"=>"6.14.0", "architecture"=>"amd64", "augeas"=>{"version"=>"1.12.0"}, "augeasversion"=>"1.12.0", "bios_release_date"=>"12/01/2006", "bios_vendor"=>"innotek GmbH", "bios_version"=>"VirtualBox", "blockdevice_sda_model"=>"HARDDISK", "blockdevice_sda_size"=>10737418240, "blockdevice_sda_vendor"=>"VBOX", "blockdevice_sdb_model"=>"HARDDISK", "blockdevice_sdb_size"=>10485760, "blockdevice_sdb_vendor"=>"VBOX", "blockdevices"=>"sdb,sda", "boardmanufacturer"=>"Oracle Corporation", "boardproductname"=>"VirtualBox", "boardserialnumber"=>"0", "chassistype"=>"Other", "dhcp_servers"=>{"enp0s3"=>"10.0.2.2", "system"=>"10.0.2.2"}, "disks"=>{"sda"=>{"model"=>"HARDDISK", "size"=>"10.00 GiB", "size_bytes"=>10737418240, "vendor"=>"VBOX"}, "sdb"=>{"model"=>"HARDDISK", "size"=>"10.00 MiB", "size_bytes"=>10485760, "vendor"=>"VBOX"}}, "dmi"=>{"bios"=>{"release_date"=>"12/01/2006", "vendor"=>"innotek GmbH", "version"=>"VirtualBox"}, "board"=>{"manufacturer"=>"Oracle Corporation", "product"=>"VirtualBox", "serial_number"=>"0"}, "chassis"=>{"type"=>"Other"}, "manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0", "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3"}}, "domain"=>"lan.asio", "facterversion"=>"3.14.9", "filesystems"=>"btrfs,ext2,ext3,ext4,iso9660,squashfs,vfat", "fips_enabled"=>false, "fqdn"=>"ubuntu-bionic.lan.asio", "gid"=>"root", "hardwareisa"=>"x86_64", "hardwaremodel"=>"x86_64", "hostname"=>"ubuntu-bionic", "hypervisors"=>{"virtualbox"=>{"revision"=>"133895", "version"=>"6.0.14"}}, "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "privileged"=>true, "uid"=>0, "user"=>"root"}, "interfaces"=>"enp0s3,lo", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_enp0s3"=>"fe80::bb:7dff:fee8:e923", "ipaddress6_lo"=>"::1", "ipaddress_enp0s3"=>"10.0.2.15", "ipaddress_lo"=>"127.0.0.1", "is_virtual"=>true, "kernel"=>"Linux", "kernelmajversion"=>"4.15", "kernelrelease"=>"4.15.0-54-generic", "kernelversion"=>"4.15.0", "load_averages"=>{"15m"=>0.1, "1m"=>0.31, "5m"=>0.23}, "lsbdistcodename"=>"bionic", "lsbdistdescription"=>"Ubuntu 18.04.2 LTS", "lsbdistid"=>"Ubuntu", "lsbdistrelease"=>"18.04", "lsbmajdistrelease"=>"18.04", "macaddress"=>"02:bb:7d:e8:e9:23", "macaddress_enp0s3"=>"02:bb:7d:e8:e9:23", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"776.53 MiB", "available_bytes"=>814247936, "capacity"=>"21.19%", "total"=>"985.26 MiB", "total_bytes"=>1033121792, "used"=>"208.73 MiB", "used_bytes"=>218873856}}, "memoryfree"=>"776.53 MiB", "memoryfree_mb"=>776.52734375, "memorysize"=>"985.26 MiB", "memorysize_mb"=>985.26171875, "mountpoints"=>{"/"=>{"available"=>"8.14 GiB", "available_bytes"=>8742756352, "capacity"=>"15.32%", "device"=>"/dev/sda1", "filesystem"=>"ext4", "options"=>["rw", "relatime", "data=ordered"], "size"=>"9.63 GiB", "size_bytes"=>10340794368, "used"=>"1.47 GiB", "used_bytes"=>1581260800}, "/dev"=>{"available"=>"480.22 MiB", "available_bytes"=>503545856, "capacity"=>"0%", "device"=>"udev", "filesystem"=>"devtmpfs", "options"=>["rw", "nosuid", "relatime", "size=491744k", "nr_inodes=122936", "mode=755"], "size"=>"480.22 MiB", "size_bytes"=>503545856, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/hugepages"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"hugetlbfs", "filesystem"=>"hugetlbfs", "options"=>["rw", "relatime", "pagesize=2M"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/mqueue"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mqueue", "filesystem"=>"mqueue", "options"=>["rw", "relatime"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/pts"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"devpts", "filesystem"=>"devpts", "options"=>["rw", "nosuid", "noexec", "relatime", "gid=5", "mode=620", "ptmxmode=000"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/shm"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/run"=>{"available"=>"97.93 MiB", "available_bytes"=>102690816, "capacity"=>"0.60%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "noexec", "relatime", "size=100892k", "mode=755"], "size"=>"98.53 MiB", "size_bytes"=>103313408, "used"=>"608.00 KiB", "used_bytes"=>622592}, "/run/lock"=>{"available"=>"5.00 MiB", "available_bytes"=>5242880, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "noexec", "relatime", "size=5120k"], "size"=>"5.00 MiB", "size_bytes"=>5242880, "used"=>"0 bytes", "used_bytes"=>0}, "/run/user/1000"=>{"available"=>"98.52 MiB", "available_bytes"=>103309312, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["rw", "nosuid", "nodev", "relatime", "size=100888k", "mode=700", "uid=1000", "gid=1000"], "size"=>"98.52 MiB", "size_bytes"=>103309312, "used"=>"0 bytes", "used_bytes"=>0}, "/sys/fs/cgroup"=>{"available"=>"492.63 MiB", "available_bytes"=>516558848, "capacity"=>"0%", "device"=>"tmpfs", "filesystem"=>"tmpfs", "options"=>["ro", "nosuid", "nodev", "noexec", "mode=755"], "size"=>"492.63 MiB", "size_bytes"=>516558848, "used"=>"0 bytes", "used_bytes"=>0}, "/vagrant"=>{"available"=>"122.93 GiB", "available_bytes"=>131996221440, "capacity"=>"85.01%", "device"=>"vagrant", "filesystem"=>"vboxsf", "options"=>["rw", "nodev", "relatime", "iocharset=utf8", "uid=1000", "gid=1000"], "size"=>"820.33 GiB", "size_bytes"=>880824786944, "used"=>"697.40 GiB", "used_bytes"=>748828565504}, "/var/lib/lxcfs"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"lxcfs", "filesystem"=>"fuse.lxcfs", "options"=>["rw", "nosuid", "nodev", "relatime", "user_id=0", "group_id=0", "allow_other"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}}, "mtu_enp0s3"=>1500, "mtu_lo"=>65536, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_enp0s3"=>"ffff:ffff:ffff:ffff::", "netmask6_lo"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "netmask_enp0s3"=>"255.255.255.0", "netmask_lo"=>"255.0.0.0", "network"=>"10.0.2.0", "network6"=>"fe80::", "network6_enp0s3"=>"fe80::", "network6_lo"=>"::1", "network_enp0s3"=>"10.0.2.0", "network_lo"=>"127.0.0.0", "networking"=>{"dhcp"=>"10.0.2.2", "domain"=>"lan.asio", "fqdn"=>"ubuntu-bionic.lan.asio", "hostname"=>"ubuntu-bionic", "interfaces"=>{"enp0s3"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::bb:7dff:fee8:e923", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "scope6"=>"link"}, "lo"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "bindings6"=>[{"address"=>"::1", "netmask"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"::1"}], "ip"=>"127.0.0.1", "ip6"=>"::1", "mtu"=>65536, "netmask"=>"255.0.0.0", "netmask6"=>"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "network"=>"127.0.0.0", "network6"=>"::1", "scope6"=>"host"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::bb:7dff:fee8:e923", "mac"=>"02:bb:7d:e8:e9:23", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::", "primary"=>"enp0s3", "scope6"=>"link"}, "operatingsystem"=>"Ubuntu", "operatingsystemmajrelease"=>"18.04", "operatingsystemrelease"=>"18.04", "os"=>{"architecture"=>"amd64", "distro"=>{"codename"=>"bionic", "description"=>"Ubuntu 18.04.2 LTS", "id"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}}, "family"=>"Debian", "hardware"=>"x86_64", "name"=>"Ubuntu", "release"=>{"full"=>"18.04", "major"=>"18.04"}, "selinux"=>{"enabled"=>false}}, "osfamily"=>"Debian", "partitions"=>{"/dev/sda1"=>{"filesystem"=>"ext4", "label"=>"cloudimg-rootfs", "mount"=>"/", "partuuid"=>"654c6dc7-01", "size"=>"10.00 GiB", "size_bytes"=>10736352768, "uuid"=>"8de716dd-d9b2-477f-b818-bb0b1eb036ce"}}, "path"=>"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/opt/puppetlabs/bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>2, "processors"=>{"count"=>2, "isa"=>"x86_64", "models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"6.14.0", "ruby"=>{"platform"=>"x86_64-linux", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "version"=>"2.5.7"}, "rubyplatform"=>"x86_64-linux", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0", "rubyversion"=>"2.5.7", "scope6"=>"link", "scope6_enp0s3"=>"link", "scope6_lo"=>"host", "selinux"=>false, "serialnumber"=>"0", "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c", "sha256"=>"SSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656"}, "key"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "type"=>"ssh-dss"}, "ecdsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9", "sha256"=>"SSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99"}, "key"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "type"=>"ecdsa-sha2-nistp256"}, "ed25519"=>{"fingerprints"=>{"sha1"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f", "sha256"=>"SSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4"}, "key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "type"=>"ssh-ed25519"}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622", "sha256"=>"SSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346"}, "key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "type"=>"ssh-rsa"}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAPemHtx92WDon/zDA0oaO5wWOXCUx45+6X9QxJugdryqG3RV0J/ZkKhayANq7NO1GeC3/3EC8celhsHyZFILEEJpFPzW32053dVnOZ6JyQCGb4JKFaCH7DjVnZLlTPyqvraykF3beEhp7dArSpsgsIURJLDRvE3PJdd9DDNtOapXAAAAFQC27/RqfyRjrjSOjNrfsqLm6GoT0QAAAIAJm6rGXMlZ+xNfPfVHsugGNP7BdcFLSWnUGaBQ+51FGkRdVesun6HF5A9/TNBfQ6U2k1BE8Qtc3H8uHrwenIQKyWuhVejvpYVD3NA6hztMWYiidiQ7Ji0O3qkPv4CY5QhlmyPit1gR4aly/fG1H8p+J/XbwrJXMtfR6ND3OXbeYwAAAIEAzDOkrJJgq5f+oPSVaOOmvbNdJ0B003fTyJEH+2yCm3q41O7vakoWv9Qt9mH7T/ivqwMK3yzk1eIpozx8TPU1aOQC3OyehoEXXFY6U5Jcgp0K8WUvVgnC47hAKBkf562aGdWftWNu4GkjI6wcNtZqkeVN/wyazilHRF9GyPdsvHg=", "sshecdsakey"=>"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF02SaI3oPW6CVWEvzDuf/XqaUF+OAr4RKNW3hAR8RRBSDEjQGdoejQEYP8lEFa1KeVlkJYnvgrPYwxVSUI6hUA=", "sshed25519key"=>"AAAAC3NzaC1lZDI1NTE5AAAAIHmh1Z/od2mbHDUkAL2bXswdwp43dPXQOKo9DA8AUDO1", "sshfp_dsa"=>"SSHFP 2 1 7024118ae71eead4750a74d458472e89e38c7e7c\nSSHFP 2 2 e5606c7ee1cf32f5591b42c98a9bc87d27cef4bc75c7802cd3f22bcb39333656", "sshfp_ecdsa"=>"SSHFP 3 1 aa6b8ac4bccb5afded59e2bf680cc151bbb27ef9\nSSHFP 3 2 4ee2dc2ded938a37ef44de4fd3f3add478abfe272f0a50dc7dbb1f9a4839ca99", "sshfp_ed25519"=>"SSHFP 4 1 a20e01cf434a802607e1aff21e621dd3ada6499f\nSSHFP 4 2 569917b95c5299fe3cdd1cc4a37166d1e81106a22bb75a15b99bb8694b2ac8c4", "sshfp_rsa"=>"SSHFP 1 1 3bc833bc8e3e259da03d37aa0c0244ae98f30622\nSSHFP 1 2 f27f0e09326c1c8abc2b0691bc6444b77781c0a21e9d99933492f269e5163346", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCw+QuEhOY+IrmAaG1/PgO0nyxYY0VYilhjcM5daSKb61z+XBmBuAsgVxWaQ815OxlwYQunPJZlKnaXZ8yTlnjk8eekxvWnoSLtqKZWW1+RfMyy6n6MyXdno1mwez+5HG3tThC63xE4EWbmKH+fsWuNT2ZpQ49fuWnG8sObv/66QLyCjt+KHMpy9ClHjpYli+0hFhdHTwxGo9H/r4I2En9rBcTy3nQZhZGm1FFh6xnHxnSGm02r2fhsk2x0kw9K1pA7IFtr31hBOu5Po5CJBVJQBd1TEozmNELl2ZISmT0HK3sIV4AG/FmFEsd9+63ST5BbeurlcOEzvxudDJmuroZX", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>336, "uptime"=>"0:05 hours"}, "timezone"=>"UTC", "uptime"=>"0:05 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>336, "uuid"=>"2C7D24ED-FB7D-4B4C-BC4B-B9FC32C8BDC3", "virtual"=>"virtualbox", "clientcert"=>"ubuntu-bionic.lan.asio", "clientversion"=>"6.14.0", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Ubuntu-18.04-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Windows_Server-2008r2-64_spec.rb b/.onceover/spec/classes/role__windows_on_Windows_Server-2008r2-64_spec.rb new file mode 100644 index 0000000..044c319 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Windows_Server-2008r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Windows_Server-2008r2-64" do + node_facts = {"agent_specified_environment"=>"production", "aio_agent_build"=>"1.2.2", "aio_agent_version"=>"1.2.2", "architecture"=>"x64", "common_appdata"=>"C:\\ProgramData", "concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/concat", "custom_auth_conf"=>"false", "datacenter"=>"portland", "dhcp_servers"=>{"Local Area Connection"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "domain"=>"pdx.puppetlabs.demo", "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.0.2", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"server2008r2a", "id"=>"SERVER2008R2A\\vagrant", "identity"=>{"user"=>"SERVER2008R2A\\vagrant"}, "iis_version"=>"Get-ItemProperty : Cannot find path 'HKLM:\\SOFTWARE\\Microsoft\\InetStp\\' because it does not exist.\nAt line:1 char:18\n+ (Get-ItemProperty <<<< HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString(8,3)\n + CategoryInfo : ObjectNotFound: (HKLM:\\SOFTWARE\\Microsoft\\InetStp\\:String) [Get-ItemProperty], ItemNotFo \n undException\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\n \nYou cannot call a method on a null-valued expression.\nAt line:1 char:97\n+ (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString <<<< (8,3)\n + CategoryInfo : InvalidOperation: (SubString:String) [], RuntimeException\n + FullyQualifiedErrorId : InvokeMethodOnNull\n \n", "interfaces"=>"Local Area Connection 2,Local Area Connection", "ipaddress"=>"10.20.1.101", "ipaddress6"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress6_Local Area Connection"=>"fe80::50f8:86eb:f103:75b%12", "ipaddress6_Local Area Connection 2"=>"fe80::2c34:c353:1aaa:a872%13", "ipaddress_Local Area Connection"=>"10.0.2.15", "ipaddress_Local Area Connection 2"=>"10.20.1.101", "is_admin"=>true, "is_pe"=>false, "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.1", "kernelrelease"=>"6.1.7600", "kernelversion"=>"6.1.7600", "macaddress"=>"08:00:27:7B:C7:40", "macaddress_Local Area Connection"=>"08:00:27:AB:52:FB", "macaddress_Local Area Connection 2"=>"08:00:27:7B:C7:40", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"448.14 MiB", "available_bytes"=>469909504, "capacity"=>"56.22%", "total"=>"1023.55 MiB", "total_bytes"=>1073274880, "used"=>"575.41 MiB", "used_bytes"=>603365376}}, "memoryfree"=>"448.14 MiB", "memoryfree_mb"=>448.140625, "memorysize"=>"1023.55 MiB", "memorysize_mb"=>1023.5546875, "mtu_Local Area Connection"=>1500, "mtu_Local Area Connection 2"=>1500, "mysql_server_id"=>8583088, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection"=>"ffff:ffff:ffff:ffff::", "netmask6_Local Area Connection 2"=>"ffff:ffff:ffff:ffff::", "netmask_Local Area Connection"=>"255.255.255.0", "netmask_Local Area Connection 2"=>"255.255.255.0", "network"=>"10.20.1.0", "network6"=>"fe80::%13", "network6_Local Area Connection"=>"fe80::%12", "network6_Local Area Connection 2"=>"fe80::%13", "network_Local Area Connection"=>"10.0.2.0", "network_Local Area Connection 2"=>"10.20.1.0", "networking"=>{"domain"=>"pdx.puppetlabs.demo", "fqdn"=>"server2008r2a.pdx.puppetlabs.demo", "hostname"=>"server2008r2a", "interfaces"=>{"Local Area Connection"=>{"dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::50f8:86eb:f103:75b%12", "mac"=>"08:00:27:AB:52:FB", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}, "Local Area Connection 2"=>{"ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}}, "ip"=>"10.20.1.101", "ip6"=>"fe80::2c34:c353:1aaa:a872%13", "mac"=>"08:00:27:7B:C7:40", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.20.1.0", "network6"=>"fe80::%13"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2008 R2", "operatingsystemrelease"=>"2008 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2008 R2", "major"=>"2008 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\ProgramData\\chocolatey\\bin;", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>false, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppetversion"=>"4.2.1", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.6"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.6", "serialnumber"=>"0", "staging_http_get"=>"powershell", "staging_windir"=>"C:\\ProgramData\\staging", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>266, "uptime"=>"0:04 hours"}, "timezone"=>"Pacific Daylight Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>266, "virtual"=>"virtualbox", "clientcert"=>"server2008r2a.pdx.puppetlabs.demo", "clientversion"=>"4.2.1", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Windows_Server-2008r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_Windows_Server-2012r2-64_spec.rb b/.onceover/spec/classes/role__windows_on_Windows_Server-2012r2-64_spec.rb new file mode 100644 index 0000000..9826e00 --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_Windows_Server-2012r2-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set Windows_Server-2012r2-64" do + node_facts = {"agent_specified_environment"=>"production", "architecture"=>"x64", "dhcp_servers"=>{"Ethernet"=>"10.0.2.2", "system"=>"10.0.2.2"}, "dmi"=>{"manufacturer"=>"innotek GmbH", "product"=>{"name"=>"VirtualBox", "serial_number"=>"0"}}, "env_windows_installdir"=>"C:\\Program Files\\Puppet Labs\\Puppet", "facterversion"=>"3.1.1", "fqdn"=>"WIN-E5K8TM30719", "hardwareisa"=>"x64", "hardwaremodel"=>"x86_64", "hostname"=>"WIN-E5K8TM30719", "id"=>"WIN-E5K8TM30719\\vagrant", "identity"=>{"user"=>"WIN-E5K8TM30719\\vagrant"}, "interfaces"=>"Ethernet", "ipaddress"=>"10.0.2.15", "ipaddress6"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress6_Ethernet"=>"fe80::a180:36e0:3a6e:1005%12", "ipaddress_Ethernet"=>"10.0.2.15", "is_virtual"=>true, "kernel"=>"windows", "kernelmajversion"=>"6.3", "kernelrelease"=>"6.3.9600", "kernelversion"=>"6.3.9600", "macaddress"=>"08:00:27:81:38:FA", "macaddress_Ethernet"=>"08:00:27:81:38:FA", "manufacturer"=>"innotek GmbH", "memory"=>{"system"=>{"available"=>"1.42 GiB", "available_bytes"=>1521610752, "capacity"=>"29.13%", "total"=>"2.00 GiB", "total_bytes"=>2147012608, "used"=>"596.43 MiB", "used_bytes"=>625401856}}, "memoryfree"=>"1.42 GiB", "memoryfree_mb"=>1451.12109375, "memorysize"=>"2.00 GiB", "memorysize_mb"=>2047.55078125, "mtu_Ethernet"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "netmask6_Ethernet"=>"ffff:ffff:ffff:ffff::", "netmask_Ethernet"=>"255.255.255.0", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "network6_Ethernet"=>"fe80::%12", "network_Ethernet"=>"10.0.2.0", "networking"=>{"dhcp"=>"10.0.2.2", "fqdn"=>"WIN-E5K8TM30719", "hostname"=>"WIN-E5K8TM30719", "interfaces"=>{"Ethernet"=>{"bindings"=>[{"address"=>"10.0.2.15", "netmask"=>"255.255.255.0", "network"=>"10.0.2.0"}], "bindings6"=>[{"address"=>"fe80::a180:36e0:3a6e:1005%12", "netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::%12"}], "dhcp"=>"10.0.2.2", "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12"}}, "ip"=>"10.0.2.15", "ip6"=>"fe80::a180:36e0:3a6e:1005%12", "mac"=>"08:00:27:81:38:FA", "mtu"=>1500, "netmask"=>"255.255.255.0", "netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.0.2.0", "network6"=>"fe80::%12", "primary"=>"Ethernet"}, "operatingsystem"=>"windows", "operatingsystemmajrelease"=>"2012 R2", "operatingsystemrelease"=>"2012 R2", "os"=>{"architecture"=>"x64", "family"=>"windows", "hardware"=>"x86_64", "name"=>"windows", "release"=>{"full"=>"2012 R2", "major"=>"2012 R2"}, "windows"=>{"system32"=>"C:\\Windows\\system32"}}, "osfamily"=>"windows", "path"=>"C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Git\\cmd;C:\\Program Files (x86)\\Git\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin", "physicalprocessorcount"=>1, "processor0"=>"Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz", "processorcount"=>1, "processors"=>{"count"=>1, "isa"=>"x64", "models"=>["Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"], "physicalcount"=>1}, "productname"=>"VirtualBox", "puppetversion"=>"4.2.3", "ruby"=>{"platform"=>"x64-mingw32", "sitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.7"}, "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.7", "serialnumber"=>"0", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>287, "uptime"=>"0:04 hours"}, "timezone"=>"Coordinated Universal Time", "uptime"=>"0:04 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>287, "virtual"=>"virtualbox", "clientcert"=>"win-e5k8tm30719", "clientversion"=>"4.2.3", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'Windows_Server-2012r2-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_solaris-10_u9-sparc-64_spec.rb b/.onceover/spec/classes/role__windows_on_solaris-10_u9-sparc-64_spec.rb new file mode 100644 index 0000000..0f9966e --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_solaris-10_u9-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set solaris-10_u9-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-10_u9-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.42", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.42", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"Generic_Virtual", "kernelrelease"=>"5.10", "kernelversion"=>"Generic_Virtual", "load_averages"=>{"15m"=>1.015625, "1m"=>1.89453125, "5m"=>1.25390625}, "macaddress"=>"02:08:20:f1:97:4b", "macaddress_net0"=>"02:08:20:f1:97:4b", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"3.25 GiB", "available_bytes"=>-806297600, "capacity"=>"78.94%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"12.18 GiB", "used_bytes"=>194560000}}, "memoryfree"=>"3.25 GiB", "memoryfree_mb"=>3327.0546875, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"1.14%", "device"=>"rpool/ROOT/zbe-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950161"], "size"=>"480.01 GiB", "size_bytes"=>13566464, "used"=>"5.49 GiB", "used_bytes"=>1602503680}, "/.SUNWnative/lib"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/lib", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/platform"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/platform", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/sbin"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/sbin", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/.SUNWnative/usr"=>{"available"=>"212.34 GiB", "available_bytes"=>361699840, "capacity"=>"13.19%", "device"=>"/.SUNWnative/usr", "filesystem"=>"lofs", "options"=>["ro", "nodevices", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950002"], "size"=>"244.59 GiB", "size_bytes"=>629606400, "used"=>"32.25 GiB", "used_bytes"=>267906560}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc10", "nozonemod", "sharezone=36", "dev=8e0001b"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=9040025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e80025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/svc/volatile"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}, "/export"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950163"], "size"=>"474.52 GiB", "size_bytes"=>-1588904448, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950164"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8dc0024"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc10", "sharezone=36", "dev=4950165"], "size"=>"474.52 GiB", "size_bytes"=>-1588905472, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8e40025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc10", "sharezone=36", "dev=8f00025"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/tmp"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.70%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc10", "sharezone=36", "dev=8ec004a"], "size"=>"5.52 GiB", "size_bytes"=>1632608256, "used"=>"39.52 MiB", "used_bytes"=>41435136}, "/var"=>{"available"=>"474.52 GiB", "available_bytes"=>-1588937216, "capacity"=>"0.03%", "device"=>"rpool/ROOT/zbe-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc10/root/var", "zone=cisparc10", "nozonemod", "sharezone=36", "dev=4950162"], "size"=>"474.66 GiB", "size_bytes"=>-1436724224, "used"=>"145.16 MiB", "used_bytes"=>152212992}, "/var/run"=>{"available"=>"5.48 GiB", "available_bytes"=>1591173120, "capacity"=>"0.01%", "device"=>"/etc/svc/volatile/", "filesystem"=>"lofs", "options"=>["rstchown", "zone=cisparc10", "sharezone=36", "dev=8ec0049"], "size"=>"5.48 GiB", "size_bytes"=>1591631872, "used"=>"448.00 KiB", "used_bytes"=>458752}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"domain"=>"puppet.example", "fqdn"=>"solaris-10_u9-sparc-t4-64.puppet.example", "hostname"=>"solaris-10_u9-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.42", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.42", "mac"=>"02:08:20:f1:97:4b", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10_u9", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"10_u9", "major"=>"10", "minor"=>"9"}}, "osfamily"=>"Solaris", "path"=>"/usr/local/bin:/usr/local/sbin:/opt/csw/bin:PATH:/opt/puppetlabs/bin:/usr/local/bin:/usr/local/sbin:/opt/csw/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-10-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>" SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.10", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.10", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"solaris-10_u9-sparc-t4-64", "zones"=>{"solaris-10_u9-sparc-t4-64"=>{"brand"=>"solaris10", "id"=>"36", "ip_type"=>"excl", "path"=>"/", "status"=>"running"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798", "sha256"=>"SSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15"}, "key"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg=="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4", "sha256"=>"SSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAIBt3ynjIBp7/uKbi9RdcO5DiIA0l7y4BmHsfm9042jYtMvIZkMF9cqwvxHjgoHW9JZGGNgIxUK/q0vjuGzctspVUovGBfL+m7F9Lp0rAHZVRkRm1wzGtjCPcdq35J9uVVj0YiHKvuuRvpooVtF55fe9ZfvwPBW41n9+eCX+yjY9AAAAFQC79jdm/KtE/8yXT6r1dMs63sF70wAAAIBC1yGHJcpRJt5NPi0t+eFQu6sDxxUeaaChW4u8BFLT4NXQ6SgBGW7FpT/zEaYEn2UZeQ8Mk3jAycUckyq5qSmWpunTHWdz8iKuuzPSyMgAYXwv0nGL+soRwGcjFdHIhCi2LGloN8JZpE/Kz2ry7yThwL7qMq3i8FFlovWDesAyzAAAAIATGYMDBcEnIY8+CvG3qFtsX4oM//ExuislYawqmChhp7A8IaMLeBoXmc3AdvvuZ/7CS/Kq/XwJApIPy9apRtqJp5zG5R9TvqEmCtCqtemvAmT0n9WsvDWev4YCIWj9wMiRlmT7HemL+5qFiKOmvo9lTd4NPRL3+gIPHCqXHyxacg==", "sshfp_dsa"=>"SSHFP 2 1 c9a8316e12052c89f9c8eea38c433c50950d5798\nSSHFP 2 2 26773f31bd38b64224ee474eec7659dc05f23f8cb43e8352c1b58545bf5bbb15", "sshfp_rsa"=>"SSHFP 1 1 ea3ecdaaf4d5112fe3148cb52385f928a3cc53f4\nSSHFP 1 2 961dddd0fb580a5c0d1db74c16560fa37529cf4d162c13de99a880b1e91fd424", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAIEAz60kx84oy4edq6Nt2/SMQfQVVXoic/64JQ45EnwGKlMYvU3Okp3pT7uqyl+I5mXFjTB7wzLfIxzK5beofKDUbXNM5BwVeFQuZLR/hRusuvR5ntOce2kFMnyFteuvBue7Tg8YMGHAEM7fjfcqvuQgxWMELMJFwq0yUcl/aOL/o+U=", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>0, "hours"=>0, "seconds"=>1860, "uptime"=>"0:31 hours"}, "timezone"=>"PDT", "uptime"=>"0:31 hours", "uptime_days"=>0, "uptime_hours"=>0, "uptime_seconds"=>1860, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc10_brand"=>"solaris10", "zone_cisparc10_id"=>"36", "zone_cisparc10_iptype"=>"excl", "zone_cisparc10_name"=>"solaris-10_u9-sparc-t4-64", "zone_cisparc10_path"=>"/", "zone_cisparc10_status"=>"running", "zonename"=>"solaris-10_u9-sparc-t4-64", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-10_u9-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'solaris-10_u9-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_solaris-11.2-sparc-64_spec.rb b/.onceover/spec/classes/role__windows_on_solaris-11.2-sparc-64_spec.rb new file mode 100644 index 0000000..72491ba --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_solaris-11.2-sparc-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set solaris-11.2-sparc-64" do + node_facts = {"aio_agent_build"=>"1.4.2", "aio_agent_version"=>"1.4.2", "architecture"=>"sun4v", "augeas"=>{"version"=>"1.4.0"}, "augeasversion"=>"1.4.0", "blockdevice_sd4_size"=>-1168154624, "blockdevice_sd4_vendor"=>"HITACHI", "blockdevice_sd5_size"=>-647710720, "blockdevice_sd5_vendor"=>"HITACHI", "blockdevice_sd6_size"=>0, "blockdevice_sd6_vendor"=>"AMI", "blockdevice_sd7_size"=>0, "blockdevice_sd7_vendor"=>"TEAC", "blockdevice_sd8_size"=>-1168154624, "blockdevice_sd8_vendor"=>"HITACHI", "blockdevice_sd9_size"=>-647710720, "blockdevice_sd9_vendor"=>"HITACHI", "blockdevices"=>"sd4,sd5,sd8,sd9,sd7,sd6", "custom_auth_conf"=>false, "dhcp_servers"=>{"net0"=>"10.32.22.10", "system"=>"10.32.22.10"}, "disks"=>{"sd4"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd5"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}, "sd6"=>{"product"=>"Virtual CDROM Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"AMI"}, "sd7"=>{"product"=>"DV-W28SS-W Revision", "size"=>"0 bytes", "size_bytes"=>0, "vendor"=>"TEAC"}, "sd8"=>{"product"=>"H109060SESUN600GRevision", "size"=>"558.91 GiB", "size_bytes"=>-1168154624, "vendor"=>"HITACHI"}, "sd9"=>{"product"=>"H109030SESUN300GRevision", "size"=>"279.40 GiB", "size_bytes"=>-647710720, "vendor"=>"HITACHI"}}, "dmi"=>{"manufacturer"=>"Oracle Corporation"}, "domain"=>"puppet.example", "facterversion"=>"3.1.6", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "gid"=>"root", "hardwareisa"=>"sparc", "hardwaremodel"=>"sun4v", "hostname"=>"solaris-11_2-sparc-t4-64", "id"=>"root", "identity"=>{"gid"=>0, "group"=>"root", "uid"=>0, "user"=>"root"}, "interfaces"=>"lo0,net0", "ipaddress"=>"10.32.77.68", "ipaddress_lo0"=>"127.0.0.1", "ipaddress_net0"=>"10.32.77.68", "is_pe"=>false, "is_virtual"=>true, "kernel"=>"SunOS", "kernelmajversion"=>"11", "kernelrelease"=>"5.11", "kernelversion"=>"11.2", "load_averages"=>{"15m"=>1.0234375, "1m"=>1.21875, "5m"=>1.28125}, "macaddress"=>"02:08:20:41:26:8c", "macaddress_net0"=>"02:08:20:41:26:8c", "manufacturer"=>"Oracle Corporation", "memory"=>{"swap"=>{"available"=>"4.00 GiB", "available_bytes"=>-8192, "capacity"=>"0%", "total"=>"4.00 GiB", "total_bytes"=>-8192, "used"=>"0 bytes", "used_bytes"=>0}, "system"=>{"available"=>"2.34 GiB", "available_bytes"=>-1777401856, "capacity"=>"84.80%", "total"=>"15.43 GiB", "total_bytes"=>-611737600, "used"=>"13.09 GiB", "used_bytes"=>1165664256}}, "memoryfree"=>"2.34 GiB", "memoryfree_mb"=>2400.9375, "memorysize"=>"15.43 GiB", "memorysize_mb"=>15800.6015625, "mountpoints"=>{"/"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.18%", "device"=>"rpool/ROOT/solaris-0", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017b"], "size"=>"476.16 GiB", "size_bytes"=>175171072, "used"=>"889.53 MiB", "used_bytes"=>932736000}, "/dev"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"/dev", "filesystem"=>"dev", "options"=>["zone=cisparc", "nozonemod", "sharezone=38", "dev=8e0001c"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/dev/fd"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"fd", "filesystem"=>"fd", "options"=>["rw", "nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=9040027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/dfs/sharetab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"sharefs", "filesystem"=>"sharefs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f40016"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/etc/mnttab"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"mnttab", "filesystem"=>"mntfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e80027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/export"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017f"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/export/home"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/export/home", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950180"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/proc"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"proc", "filesystem"=>"proc", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8dc0026"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/rpool"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950181"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}, "/system/contract"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"ctfs", "filesystem"=>"ctfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8e40027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/object"=>{"available"=>"0 bytes", "available_bytes"=>0, "capacity"=>"100%", "device"=>"objfs", "filesystem"=>"objfs", "options"=>["nodevices", "rstchown", "zone=cisparc", "sharezone=38", "dev=8f00027"], "size"=>"0 bytes", "size_bytes"=>0, "used"=>"0 bytes", "used_bytes"=>0}, "/system/volatile"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.01%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004d"], "size"=>"4.53 GiB", "size_bytes"=>572342272, "used"=>"576.00 KiB", "used_bytes"=>589824}, "/tmp"=>{"available"=>"4.53 GiB", "available_bytes"=>571752448, "capacity"=>"0.95%", "device"=>"swap", "filesystem"=>"tmpfs", "options"=>["nodevices", "rstchown", "xattr", "zone=cisparc", "sharezone=38", "dev=8ec004e"], "size"=>"4.58 GiB", "size_bytes"=>618414080, "used"=>"44.50 MiB", "used_bytes"=>46661632}, "/var"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.05%", "device"=>"rpool/ROOT/solaris-0/var", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "mountpoint=/zones/cisparc/root/var", "zone=cisparc", "nozonemod", "sharezone=38", "dev=495017d"], "size"=>"475.51 GiB", "size_bytes"=>-521269760, "used"=>"225.35 MiB", "used_bytes"=>236295168}, "/var/share"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=495017e"], "size"=>"475.30 GiB", "size_bytes"=>-756610048, "used"=>"932.50 KiB", "used_bytes"=>954880}, "/var/share/pkg"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950182"], "size"=>"475.29 GiB", "size_bytes"=>-757532160, "used"=>"32.00 KiB", "used_bytes"=>32768}, "/var/share/pkg/repositories"=>{"available"=>"475.29 GiB", "available_bytes"=>-757564928, "capacity"=>"0.00%", "device"=>"rpool/VARSHARE/pkg/repositories", "filesystem"=>"zfs", "options"=>["rw", "nodevices", "setuid", "nonbmand", "exec", "rstchown", "xattr", "atime", "zone=cisparc", "sharezone=38", "dev=4950183"], "size"=>"475.29 GiB", "size_bytes"=>-757533184, "used"=>"31.00 KiB", "used_bytes"=>31744}}, "mtu_lo0"=>8232, "mtu_net0"=>1500, "netmask"=>"255.255.255.0", "netmask_lo0"=>"255.0.0.0", "netmask_net0"=>"255.255.255.0", "network"=>"10.32.77.0", "network_lo0"=>"127.0.0.0", "network_net0"=>"10.32.77.0", "networking"=>{"dhcp"=>"10.32.22.10", "domain"=>"puppet.example", "fqdn"=>"solaris-11_2-sparc-t4-64.puppet.example", "hostname"=>"solaris-11_2-sparc-t4-64", "interfaces"=>{"lo0"=>{"bindings"=>[{"address"=>"127.0.0.1", "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}], "ip"=>"127.0.0.1", "mtu"=>8232, "netmask"=>"255.0.0.0", "network"=>"127.0.0.0"}, "net0"=>{"bindings"=>[{"address"=>"10.32.77.68", "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}], "dhcp"=>"10.32.22.10", "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0"}}, "ip"=>"10.32.77.68", "mac"=>"02:08:20:41:26:8c", "mtu"=>1500, "netmask"=>"255.255.255.0", "network"=>"10.32.77.0", "primary"=>"net0"}, "operatingsystem"=>"Solaris", "operatingsystemmajrelease"=>"11", "operatingsystemrelease"=>"11.2", "os"=>{"architecture"=>"sun4v", "family"=>"Solaris", "hardware"=>"sun4v", "name"=>"Solaris", "release"=>{"full"=>"11.2", "major"=>"11", "minor"=>"2"}}, "osfamily"=>"Solaris", "path"=>"PATH:/opt/puppetlabs/bin:/usr/sbin:/usr/bin:/sbin", "pe_concat_basedir"=>"/opt/puppetlabs/puppet/cache/pe_concat", "physicalprocessorcount"=>1, "platform_symlink_writable"=>true, "platform_tag"=>"solaris-11-sparc", "processor0"=>"SPARC-T4", "processor1"=>"SPARC-T4", "processor10"=>"SPARC-T4", "processor11"=>"SPARC-T4", "processor12"=>"SPARC-T4", "processor13"=>"SPARC-T4", "processor14"=>"SPARC-T4", "processor15"=>"SPARC-T4", "processor16"=>"SPARC-T4", "processor17"=>"SPARC-T4", "processor18"=>"SPARC-T4", "processor19"=>"SPARC-T4", "processor2"=>"SPARC-T4", "processor20"=>"SPARC-T4", "processor21"=>"SPARC-T4", "processor22"=>"SPARC-T4", "processor23"=>"SPARC-T4", "processor24"=>"SPARC-T4", "processor25"=>"SPARC-T4", "processor26"=>"SPARC-T4", "processor27"=>"SPARC-T4", "processor28"=>"SPARC-T4", "processor29"=>"SPARC-T4", "processor3"=>"SPARC-T4", "processor30"=>"SPARC-T4", "processor31"=>"SPARC-T4", "processor32"=>"SPARC-T4", "processor33"=>"SPARC-T4", "processor34"=>"SPARC-T4", "processor35"=>"SPARC-T4", "processor36"=>"SPARC-T4", "processor37"=>"SPARC-T4", "processor38"=>"SPARC-T4", "processor39"=>"SPARC-T4", "processor4"=>"SPARC-T4", "processor40"=>"SPARC-T4", "processor41"=>"SPARC-T4", "processor42"=>"SPARC-T4", "processor43"=>"SPARC-T4", "processor44"=>"SPARC-T4", "processor45"=>"SPARC-T4", "processor46"=>"SPARC-T4", "processor47"=>"SPARC-T4", "processor48"=>"SPARC-T4", "processor49"=>"SPARC-T4", "processor5"=>"SPARC-T4", "processor50"=>"SPARC-T4", "processor51"=>"SPARC-T4", "processor52"=>"SPARC-T4", "processor53"=>"SPARC-T4", "processor54"=>"SPARC-T4", "processor55"=>"SPARC-T4", "processor56"=>"SPARC-T4", "processor57"=>"SPARC-T4", "processor58"=>"SPARC-T4", "processor59"=>"SPARC-T4", "processor6"=>"SPARC-T4", "processor60"=>"SPARC-T4", "processor61"=>"SPARC-T4", "processor62"=>"SPARC-T4", "processor63"=>"SPARC-T4", "processor7"=>"SPARC-T4", "processor8"=>"SPARC-T4", "processor9"=>"SPARC-T4", "processorcount"=>64, "processors"=>{"count"=>64, "isa"=>"sparc", "models"=>["SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4", "SPARC-T4"], "physicalcount"=>1, "speed"=>"2.85 GHz"}, "puppet_files_dir_present"=>false, "puppetversion"=>"4.4.2", "ruby"=>{"platform"=>"sparc-solaris2.11", "sitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "version"=>"2.1.8"}, "rubyplatform"=>"sparc-solaris2.11", "rubysitedir"=>"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", "rubyversion"=>"2.1.8", "solaris_zones"=>{"current"=>"cisparc", "zones"=>{"cisparc"=>{"brand"=>"solaris", "id"=>"38", "ip_type"=>"excl", "path"=>"/", "status"=>"running", "uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782"}}}, "ssh"=>{"dsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f", "sha256"=>"SSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607"}, "key"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA="}, "rsa"=>{"fingerprints"=>{"sha1"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3", "sha256"=>"SSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824"}, "key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw=="}}, "sshdsakey"=>"AAAAB3NzaC1kc3MAAACBAMVAhiKM1nrem5tlbgwagi6NKV1e6RIpLxXj+vovBAb/vWf6+in2lBrxLqljbxYWq1XTOJoXUTybb24gpnDwZC2v/5TytqJ35P4ptOH1fY2zthRnkgyYUMfF7nLslOgoy24A19uwmR3lhFpklhCUe1xkMHOXkToujrfym+nwpFZ5AAAAFQDRqOSYA1u47UtVMg4zXL0txwFHIwAAAIBNxcSYfeOSQrkFawbG0GQpSNs2Z/iqFDbJFz/Ha1xkitkpmBBNizRva5tqNR8uaK/VHoIdaK7Rn1qS/D2Sl3w4Ps4UhEN9qOOylQplUmqb4JAFtAFInDMIHz/69SYMyBJ9eXQHh8mOeLX8s2lQow+Z/iOVpAlGIB0PxrHClqSN5AAAAIEAqHqE/Ry0hL98YpXRvMw0kpMl439iXQjzfx3IgJzSScNpNx3G5QDDysSu8dzanOvqXxJ0ynwc1LxuXhuvq4hJ990snyYLOgNOOJ5v86G1TkXTq3Ny0gb+7efiwI7u4xIY6WrQeXt32hbRY0kF/MswmKjz3NSBK6jozSNwHlP6jeA=", "sshfp_dsa"=>"SSHFP 2 1 db349d276f0d3465ddf320d4f39d91349f1b576f\nSSHFP 2 2 b8e58d26d36f2ce088034a1ce3be70b03ef404671f0c6ed3256152af9c9ad607", "sshfp_rsa"=>"SSHFP 1 1 865be76b66792c0d98006a6ed5227f19f8241cf3\nSSHFP 1 2 c74d9f97237b06070909f30fbb68afbe0943450a8ea3d1b85fb16db53441a824", "sshrsakey"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA8bZpHkHvgZEBhn7qlupS61DjwXYOnTVFuaOaDI6eesXxU1yDJfEqO1eHp6YF6x5gmM/mDyfFU9hixMmH9yLRgi2/QUhoYa44z8NB3EBaHxFtLQLnoFTGq/VR5xZ+pyBcbwUswvDel3OfXTcepmT6lWLCBRLOfYTc6hzwRCfyrWgdVc3kruu9hh9pKIWFEyUUztHWuR7+akNH3nD+EcqsmuMowEzzssWC8msWnAX89geFPuhilAgz7Qcc1bJZUaWGgOzyaZKn3IVNNa3grOWzgKDE6gdLMefnk0dgndtIbB1E9iY1syosQCrBIiEfMMGEBjrDstcNKs+Ge8stRljjMw==", "staging_http_get"=>"curl", "swapfree"=>"4.00 GiB", "swapfree_mb"=>4095.9921875, "swapsize"=>"4.00 GiB", "swapsize_mb"=>4095.9921875, "system_uptime"=>{"days"=>2, "hours"=>62, "seconds"=>225780, "uptime"=>"2 days"}, "timezone"=>"PDT", "uptime"=>"2 days", "uptime_days"=>2, "uptime_hours"=>62, "uptime_seconds"=>225780, "virtual"=>"zone", "zfs_featurenumbers"=>"1,2,3,4,5,6", "zfs_version"=>"6", "zone_cisparc_brand"=>"solaris", "zone_cisparc_id"=>"38", "zone_cisparc_iptype"=>"excl", "zone_cisparc_name"=>"cisparc", "zone_cisparc_path"=>"/", "zone_cisparc_status"=>"running", "zone_cisparc_uuid"=>"9903e75b-f048-4e38-83b3-977cde7b3782", "zonename"=>"cisparc", "zones"=>1, "zpool_featurenumbers"=>"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35", "zpool_version"=>"35", "clientcert"=>"solaris-11_2-sparc-t4-64.puppet.example", "clientversion"=>"4.4.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'solaris-11.2-sparc-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/classes/role__windows_on_windows-10-64_spec.rb b/.onceover/spec/classes/role__windows_on_windows-10-64_spec.rb new file mode 100644 index 0000000..1ffff6f --- /dev/null +++ b/.onceover/spec/classes/role__windows_on_windows-10-64_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe "role::windows" do + + context "using fact set windows-10-64" do + node_facts = {"puppetversion"=>"6.0.2", "puppet_inventory_metadata"=>{"packages"=>{"collection_enabled"=>false, "last_collection_time"=>"0.0s"}}, "package_provider"=>"windows", "pe_concat_basedir"=>"C:/ProgramData/PuppetLabs/puppet/cache/pe_concat", "is_pe"=>false, "platform_symlink_writable"=>false, "puppet_files_dir_present"=>false, "puppet_vardir"=>"C:/ProgramData/PuppetLabs/puppet/cache", "puppet_environmentpath"=>"C:/ProgramData/PuppetLabs/code/environments", "puppet_server"=>"pe-puppet.localdomain", "service_provider"=>"windows", "staging_http_get"=>"curl", "common_appdata"=>"C:\\ProgramData", "architecture"=>"x64", "kernel"=>"windows", "virtual"=>"vmware", "is_virtual"=>true, "hardwaremodel"=>"x64", "operatingsystem"=>"windows", "os"=>{"name"=>"windows", "family"=>"windows", "release"=>{"major"=>"10", "full"=>"10"}}, "facterversion"=>"2.5.1", "fqdn"=>"VAGRANT-HB9G3RD", "hostname"=>"VAGRANT-HB9G3RD", "id"=>"vagrant-hb9g3rd\\vagrant", "interfaces"=>"Ethernet0_2", "ipaddress_ethernet0_2"=>"192.168.43.174", "ipaddress6_ethernet0_2"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "macaddress_ethernet0_2"=>"00:0C:29:A3:53:54", "netmask_ethernet0_2"=>"255.255.255.0", "mtu_ethernet0_2"=>0, "ipaddress"=>"192.168.43.174", "ipaddress6"=>"fd72:b3ab:b8dd:0:f563:fac2:928c:6aa", "kernelmajversion"=>"10.0", "kernelrelease"=>"10.0.17134", "kernelversion"=>"10.0.17134", "macaddress"=>"00:0C:29:A3:53:54", "manufacturer"=>"Phoenix Technologies LTD", "serialnumber"=>"VMware-56 4d 36 2e 2e a4 81 f9-0d 05 ae d0 e5 a3 53 54", "productname"=>"VMware Virtual Platform", "memorysize"=>"4.00 GB", "memoryfree"=>"2.30 GB", "memorysize_mb"=>"4095.49", "memoryfree_mb"=>"2360.00", "netmask"=>"255.255.255.0", "network_ethernet0_2"=>"192.168.43.0", "operatingsystemmajrelease"=>"10", "operatingsystemrelease"=>"10", "osfamily"=>"windows", "path"=>"C:\\tools\\ruby24\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files (x86)\\vim\\vim80;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Users\\vagrant\\AppData\\Local\\Microsoft\\WindowsApps;", "physicalprocessorcount"=>4, "processors"=>{"models"=>["Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz"], "count"=>4, "physicalcount"=>4}, "processor0"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor1"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor2"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processor3"=>"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "processorcount"=>4, "ps"=>"tasklist.exe", "rubyplatform"=>"x64-mingw32", "rubysitedir"=>"C:/tools/ruby24/lib/ruby/site_ruby/2.4.0", "rubyversion"=>"2.4.3", "system32"=>"C:\\Windows\\system32", "system_uptime"=>{"seconds"=>1113359, "hours"=>309, "days"=>12, "uptime"=>"12 days"}, "timezone"=>"GMT Standard Time", "uptime"=>"12 days", "uptime_days"=>12, "uptime_hours"=>309, "uptime_seconds"=>1113359, "clientcert"=>"vagrant-hb9g3rd.lan.asio", "clientversion"=>"6.0.2", "clientnoop"=>false} + let(:facts) { node_facts } + + + before :each do + # Curtrently there is some code within Puppet that will try to execute + # commands when compiling a catalog even though it shouldn't. One example is + # the groups attribute of the user resource on AIX. If we are running on + # Windows but pretending to be UNIX this will definitely fail so we need to + # mock it (or vice versa) + # Details: + # https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L191 + expected_null_file = Puppet::Util::Platform.windows? ? 'NUL' : '/dev/null' + unless File.exist? expected_null_file + allow(Puppet::Util::Execution).to receive(:execute).and_raise(Puppet::ExecutionFailure.new("Onceover caused this")) + end + end + + let(:pre_condition) { + pp = <<-'END' +$onceover_class = 'role::windows' +$onceover_node = 'windows-10-64' + +# Begin user-specified pre_condition + +# End user-specified pre_condition + + +END + } + + it { should compile } + end +end + diff --git a/.onceover/spec/factsets/README.md b/.onceover/spec/factsets/README.md new file mode 100644 index 0000000..dd72566 --- /dev/null +++ b/.onceover/spec/factsets/README.md @@ -0,0 +1,7 @@ +# Factsets + +This directory is where we put any custom factsets that we want to use. They can be generated by running `puppet facts` on the target system. + +**Hot tip:** If you already have factsets in here when you run `onceover init` they will be picked up and added to the config file Automatically + +More info: https://github.com/dylanratcliffe/onceover#factsets diff --git a/.onceover/spec/onceover.yaml b/.onceover/spec/onceover.yaml new file mode 100644 index 0000000..598b2fe --- /dev/null +++ b/.onceover/spec/onceover.yaml @@ -0,0 +1,61 @@ +# Classes to be tested +classes: + - role::metrics + - role::puppetserver + - role::windows + - role::node + - role::custom_windows + +# Nodes to tests classes on, this refers to a 'factset' or 'nodeset' +# depending on whether you are running 'spec' or 'acceptance' tests +nodes: + - AIX-7.1-powerpc + - SLES-12.1-64 + - Debian-6.0.10-32 + - CentOS-6.6-64 + - Ubuntu-12.04-32 + - Amazon-2018.03 + - Ubuntu-12.04-64 + - CentOS-6.6-32 + - Debian-6.0.10-64 + - AIX-6.1-powerpc + - Windows_Server-2012r2-64 + - Ubuntu-18.04-64 + - RHEL-7.4 + - Debian-7.8-32 + - windows-10-64 + - Windows_Server-2008r2-64 + - SLES-11.3-64 + - Debian-7.8-64 + - solaris-10_u9-sparc-64 + - solaris-11.2-sparc-64 + - Ubuntu-14.04-32 + - CentOS-5.11-64 + - CentOS-5.11-32 + - RHEL-6.7 + - CentOS-7.0-64 + - Ubuntu-14.04-64 + +# You can group classes here to save typing +class_groups: + +# You can group nodes here to save typing +# We have created a 'non_windows_nodes' group because we can't +# give you Windows vagrant boxes to test with because licensing, +# we can give you fact sets though so go crazy with spec testing! +node_groups: + windows_nodes: + - Windows_Server-2012r2-64 + - windows-10-64 + - Windows_Server-2008r2-64 + non_windows_nodes: + include: 'all_nodes' + exclude: 'windows_nodes' + +test_matrix: + - all_nodes: + classes: 'all_classes' + tests: 'spec' + - non_windows_nodes: + classes: 'all_classes' + tests: 'acceptance' \ No newline at end of file diff --git a/.onceover/spec/pre_conditions/README.md b/.onceover/spec/pre_conditions/README.md new file mode 100644 index 0000000..f0a81bf --- /dev/null +++ b/.onceover/spec/pre_conditions/README.md @@ -0,0 +1,24 @@ +# Pre Conditions + +This folder should contain any \*.pp files that you want to be included in every test. + +A common use of this is defining resources that may not exist in the catalog when you are running tests. For example, if we are using a resource that tries to restart the `pe-puppetserver` service, unless it is compiled on a Puppet Maser the `pe-puppetserver` service will not exist and the catalog will fail to compile. To get around this we can create a .pp file and define the resource like so: + +``` puppet +# We are not going to actually have this service anywhere on our servers but +# our code needs to refresh it. This is to trick puppet into doing nothing +service { 'pe-puppetserver': + ensure => 'running', + enable => false, + hasrestart => false, # Force Puppet to use start and stop to restart + start => 'echo "Start"', # This will always exit 0 + stop => 'echo "Stop"', # This will also always exit 0 + hasstatus => false, # Force puppet to use our command for status + status => 'echo "Status"', # This will always exit 0 and therefore Puppet will think the service is running + provider => 'base', +} +``` + +This will mean that the `pe-puppetserver` service is in the catalog for spec testing and will even allow you to try to restart it during acceptance tests without the service actually being present. + +More info: https://github.com/dylanratcliffe/onceover#using-workarounds diff --git a/.onceover/spec/spec_helper.rb b/.onceover/spec/spec_helper.rb new file mode 100644 index 0000000..14487f8 --- /dev/null +++ b/.onceover/spec/spec_helper.rb @@ -0,0 +1,31 @@ +RSpec.configure do |c| + c.mock_with :rspec +end + +require 'puppetlabs_spec_helper/module_spec_helper' +require 'rspec_junit_formatter' +require 'onceover/rspec/formatters' + +RSpec.configure do |c| + # Create onceover settings to be accessed by formatters + c.add_setting :onceover_tempdir + c.add_setting :onceover_root + c.add_setting :onceover_environmentpath + + c.onceover_tempdir = "/Users/christopher.lawrence/projects/control-repo/.onceover" + c.onceover_root = "/Users/christopher.lawrence/projects/control-repo" + c.onceover_environmentpath = "etc/puppetlabs/code/environments" + + # Also add JUnit output in case people want to use that + c.add_formatter('RSpecJUnitFormatter','/Users/christopher.lawrence/projects/control-repo/.onceover/spec.xml') + + c.parser = 'future' + c.formatter = 'OnceoverFormatter' + c.trusted_server_facts = true + c.environmentpath = '/Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments' + c.module_path = '/Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/site-modules:/Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/modules' + + c.hiera_config = '/Users/christopher.lawrence/projects/control-repo/.onceover/etc/puppetlabs/code/environments/production/hiera.yaml' + c.manifest = '' + ENV['STRICT_VARIABLES'] = 'no' +end diff --git a/.onceover/spec/spec_helper_acceptance.rb b/.onceover/spec/spec_helper_acceptance.rb new file mode 100644 index 0000000..a922f3f --- /dev/null +++ b/.onceover/spec/spec_helper_acceptance.rb @@ -0,0 +1 @@ +require 'onceover/beaker/spec_helper' diff --git a/site-modules/profile/Gemfile.lock b/site-modules/profile/Gemfile.lock new file mode 100644 index 0000000..15d0e63 --- /dev/null +++ b/site-modules/profile/Gemfile.lock @@ -0,0 +1,391 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.6) + activesupport (5.2.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + ansi (1.5.0) + ast (2.4.0) + aws-eventstream (1.0.3) + aws-partitions (1.232.0) + aws-sdk-core (3.72.1) + aws-eventstream (~> 1.0, >= 1.0.2) + aws-partitions (~> 1, >= 1.228.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1.0) + aws-sdk-ec2 (1.114.0) + aws-sdk-core (~> 3, >= 3.71.0) + aws-sigv4 (~> 1.1) + aws-sigv4 (1.1.0) + aws-eventstream (~> 1.0, >= 1.0.2) + bindata (2.4.4) + bolt (1.35.0) + CFPropertyList (~> 2.2) + addressable (~> 2.5) + aws-sdk-ec2 (~> 1) + concurrent-ruby (~> 1.0) + hiera-eyaml (~> 3) + logging (~> 2.2) + minitar (~> 0.6) + net-scp (~> 1.2) + net-ssh (>= 4.0) + orchestrator_client (~> 0.4) + puppet (>= 6.4.0, < 7) + puppet-resource_api (>= 1.8.1) + r10k (~> 3.1) + ruby_smb (~> 1.0) + terminal-table (~> 1.8) + winrm (~> 2.0) + winrm-fs (~> 1.3) + builder (3.2.3) + childprocess (0.7.1) + ffi (~> 1.0, >= 1.0.11) + codecov (0.1.16) + json + simplecov + url + coderay (1.1.2) + colored (1.2) + concurrent-ruby (1.1.5) + connection_pool (2.2.2) + cri (2.15.6) + deep_merge (1.2.1) + dependency_checker (0.2.0) + parallel + puppet_forge (~> 2.2) + rake (~> 12.3) + semantic_puppet (~> 1.0) + diff-lcs (1.3) + docile (1.3.2) + docker-api (1.34.2) + excon (>= 0.47.0) + multi_json + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + equatable (0.6.1) + erubis (2.7.0) + excon (0.68.0) + facter (2.5.6) + facterdb (0.8.2) + facter + jgrep + faraday (0.13.1) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.12.2) + faraday (>= 0.7.4, < 1.0) + fast_gettext (1.1.2) + ffi (1.9.25) + gettext (3.2.9) + locale (>= 2.0.5) + text (>= 1.3.0) + gettext-setup (0.31) + fast_gettext (~> 1.1.0) + gettext (>= 3.0.2) + locale + gssapi (1.3.0) + ffi (>= 1.0.1) + gyoku (1.3.1) + builder (>= 2.1.2) + hiera (3.6.0) + hiera-eyaml (3.0.0) + highline (~> 1.6.19) + optimist + highline (1.6.21) + hirb (0.7.3) + hitimes (1.3.0) + hocon (1.3.0) + http-accept (1.7.0) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.3) + i18n (1.7.0) + concurrent-ruby (~> 1.0) + jgrep (1.5.1) + jmespath (1.4.0) + json (2.1.0) + json-schema (2.8.0) + addressable (>= 2.4) + json_pure (2.1.0) + little-plugger (1.1.4) + locale (2.1.2) + log4r (1.1.10) + logging (2.2.2) + little-plugger (~> 1.1) + multi_json (~> 1.10) + metaclass (0.0.4) + metadata-json-lint (2.2.0) + json-schema (~> 2.8) + spdx-licenses (~> 1.0) + method_source (0.8.2) + mime-types (3.3) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.1009) + minitar (0.9) + minitest (5.13.0) + mocha (1.1.0) + metaclass (~> 0.0.1) + multi_json (1.14.1) + multipart-post (2.1.1) + necromancer (0.5.0) + net-http-persistent (3.1.0) + connection_pool (~> 2.2) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (5.2.0) + net-telnet (0.1.1) + netrc (0.11.0) + nori (2.6.0) + optimist (3.0.0) + orchestrator_client (0.4.3) + faraday + net-http-persistent + parallel (1.19.1) + parallel_tests (2.14.2) + parallel + parser (2.5.1.2) + ast (~> 2.4.0) + pastel (0.7.3) + equatable (~> 0.6) + tty-color (~> 0.5) + pathspec (0.2.1) + pdk (1.14.1) + bundler (>= 1.15.0, < 3.0.0) + childprocess (~> 0.7.1) + concurrent-ruby (~> 1.1.5) + cri (~> 2.10) + deep_merge (~> 1.1) + diff-lcs (= 1.3) + facter (~> 2.5.1) + ffi (~> 1.9.0) + gettext-setup (~> 0.24) + hitimes (= 1.3.0) + httpclient (~> 2.8.3) + json-schema (= 2.8.0) + json_pure (~> 2.1.0) + minitar (~> 0.6) + pathspec (~> 0.2.1) + tty-prompt (~> 0.13) + tty-spinner (~> 0.5) + tty-which (~> 0.3) + powerpack (0.1.2) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + public_suffix (4.0.1) + puppet (6.11.1) + concurrent-ruby (~> 1.0) + deep_merge (~> 1.0) + facter (> 2.0.1, < 4) + fast_gettext (~> 1.1) + hiera (>= 3.2.1, < 4) + httpclient (~> 2.8) + locale (~> 2.1) + multi_json (~> 1.10) + puppet-resource_api (~> 1.5) + semantic_puppet (~> 1.0) + puppet-blacksmith (5.0.0) + rest-client (~> 2.0) + puppet-lint (2.4.2) + puppet-module-posix-default-r2.5 (0.4.2) + puppet-module-posix-dev-r2.5 (0.4.2) + activesupport (>= 5.0.0, < 6.0.0) + codecov (~> 0.1.10) + dependency_checker (~> 0.2) + facterdb (~> 0.8.1) + gettext-setup (~> 0.26) + metadata-json-lint (>= 2.0.2, < 3.0.0) + mocha (>= 1.0.0, < 1.2.0) + parallel_tests (>= 2.14.1, < 2.14.3) + parser (~> 2.5.1.2) + pry (~> 0.10.4) + puppet-blacksmith (>= 3.4.0) + puppet-lint (>= 2.3.0, < 3.0.0) + puppet-resource_api (~> 1.6) + puppet-strings (~> 2.0) + puppet-syntax (>= 2.4.1, < 3.0.0) + puppet_litmus (>= 0.4.0, < 1.0.0) + puppet_pot_generator (~> 1.0) + puppetlabs_spec_helper (>= 2.9.0, < 3.0.0) + rainbow (~> 2.0) + rspec-puppet (>= 2.3.2, < 3.0.0) + rspec-puppet-facts (~> 1.9.5) + rspec_junit_formatter (~> 0.2) + rubocop (~> 0.49.0) + rubocop-i18n (~> 1.2.0) + rubocop-rspec (~> 1.16.0) + serverspec (~> 2.41) + simplecov (>= 0.14.1, < 1.0.0) + simplecov-console (~> 0.4.2) + specinfra (= 2.77.1) + puppet-resource_api (1.8.7) + hocon (>= 1.0) + puppet-strings (2.3.1) + rgen + yard (~> 0.9.5) + puppet-syntax (2.6.0) + rake + puppet_forge (2.3.0) + faraday (>= 0.9.0, < 0.14.0) + faraday_middleware (>= 0.9.0, < 0.13.0) + gettext-setup (~> 0.11) + minitar + semantic_puppet (~> 1.0) + puppet_litmus (0.12.0) + bolt (>= 1.13.1, < 2.0.0) + docker-api (>= 1.34, < 2.0.0) + pdk (>= 1.10.0, < 2.0.0) + tty-spinner (>= 0.5.0, < 1.0.0) + puppet_pot_generator (1.0.1) + puppet + puppetlabs_spec_helper (2.14.1) + mocha (~> 1.0) + pathspec (~> 0.2.1) + puppet-lint (~> 2.0) + puppet-syntax (~> 2.0) + rspec-puppet (~> 2.0) + r10k (3.3.3) + colored (= 1.2) + cri (= 2.15.6) + gettext-setup (~> 0.24) + log4r (= 1.1.10) + multi_json (~> 1.10) + puppet_forge (~> 2.3.0) + rainbow (2.2.2) + rake + rake (12.3.3) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + rgen (0.8.2) + rspec (3.9.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-core (3.9.0) + rspec-support (~> 3.9.0) + rspec-expectations (3.9.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-its (1.3.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.9.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-puppet (2.7.8) + rspec + rspec-puppet-facts (1.9.6) + facter + facterdb (>= 0.5.0) + json + puppet + rspec-support (3.9.0) + rspec_junit_formatter (0.4.1) + rspec-core (>= 2, < 4, != 2.12.0) + rubocop (0.49.1) + parallel (~> 1.10) + parser (>= 2.3.3.1, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + rubocop-i18n (1.2.0) + rubocop (~> 0.49.0) + rubocop-rspec (1.16.0) + rubocop (>= 0.49.0) + ruby-progressbar (1.10.1) + ruby_smb (1.1.0) + bindata + rubyntlm + windows_error + rubyntlm (0.6.2) + rubyzip (1.3.0) + semantic_puppet (1.0.2) + serverspec (2.41.5) + multi_json + rspec (~> 3.0) + rspec-its + specinfra (~> 2.72) + sfl (2.3) + simplecov (0.17.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-console (0.4.2) + ansi + hirb + simplecov + simplecov-html (0.10.2) + slop (3.6.0) + spdx-licenses (1.2.0) + specinfra (2.77.1) + net-scp + net-ssh (>= 2.7) + net-telnet (= 0.1.1) + sfl + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + text (1.3.1) + thread_safe (0.3.6) + tty-color (0.5.0) + tty-cursor (0.7.0) + tty-prompt (0.19.0) + necromancer (~> 0.5.0) + pastel (~> 0.7.0) + tty-reader (~> 0.6.0) + tty-reader (0.6.0) + tty-cursor (~> 0.7) + tty-screen (~> 0.7) + wisper (~> 2.0.0) + tty-screen (0.7.0) + tty-spinner (0.9.1) + tty-cursor (~> 0.7) + tty-which (0.4.1) + tzinfo (1.2.5) + thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.6) + unicode-display_width (1.6.0) + url (0.3.2) + windows_error (0.1.2) + winrm (2.3.2) + builder (>= 2.1.2) + erubis (~> 2.7) + gssapi (~> 1.2) + gyoku (~> 1.0) + httpclient (~> 2.2, >= 2.2.0.2) + logging (>= 1.6.1, < 3.0) + nori (~> 2.0) + rubyntlm (~> 0.6.0, >= 0.6.1) + winrm-fs (1.3.2) + erubis (~> 2.7) + logging (>= 1.6.1, < 3.0) + rubyzip (~> 1.1) + winrm (~> 2.0) + wisper (2.0.1) + yard (0.9.20) + +PLATFORMS + ruby + +DEPENDENCIES + fast_gettext + json (= 2.1.0) + puppet (= 6.11.1) + puppet-module-posix-default-r2.5 (~> 0.3) + puppet-module-posix-dev-r2.5 (~> 0.3) + puppet-module-win-default-r2.5 (~> 0.3) + puppet-module-win-dev-r2.5 (~> 0.3) + rb-readline (= 0.5.5) + +BUNDLED WITH + 1.17.3 diff --git a/site-modules/profile/bin/metadata-json-lint b/site-modules/profile/bin/metadata-json-lint new file mode 100755 index 0000000..b8deed2 --- /dev/null +++ b/site-modules/profile/bin/metadata-json-lint @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'metadata-json-lint' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("metadata-json-lint", "metadata-json-lint") diff --git a/site-modules/profile/bin/puppet b/site-modules/profile/bin/puppet new file mode 100755 index 0000000..f88843f --- /dev/null +++ b/site-modules/profile/bin/puppet @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'puppet' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("puppet", "puppet") diff --git a/site-modules/profile/bin/puppet-lint b/site-modules/profile/bin/puppet-lint new file mode 100755 index 0000000..ca4e467 --- /dev/null +++ b/site-modules/profile/bin/puppet-lint @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'puppet-lint' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("puppet-lint", "puppet-lint") diff --git a/site-modules/profile/bin/rubocop b/site-modules/profile/bin/rubocop new file mode 100755 index 0000000..d0c4882 --- /dev/null +++ b/site-modules/profile/bin/rubocop @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rubocop' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop", "rubocop") diff --git a/site-modules/profile/manifests/base.pp b/site-modules/profile/manifests/base.pp index da292a7..f5ab1be 100644 --- a/site-modules/profile/manifests/base.pp +++ b/site-modules/profile/manifests/base.pp @@ -1,12 +1,12 @@ class profile::base ( Boolean $firewall = false, Boolean $lvm = false, - Boolean $ntp = false, + Boolean $ntp = true, Boolean $puppet = false, Boolean $repos = false, Boolean $resolver = false, - Boolean $ssh = true, - Boolean $selinux = true, + Boolean $ssh = false, + Boolean $selinux = false, Boolean $motd = true, ) { if $motd { diff --git a/site-modules/profile/manifests/base/time.pp b/site-modules/profile/manifests/base/time.pp new file mode 100644 index 0000000..7170f86 --- /dev/null +++ b/site-modules/profile/manifests/base/time.pp @@ -0,0 +1,31 @@ +# == Class: profiles::bootstrap::time +# +# This class can be used install time components. +# +# === Examples +# +# @example when declaring the time class +# class { '::profiles::bootstrap::time': } +# +# === Parameters +# +# @param default_timezone Timezone for this node. +# @param ntp_servers List of ntp servers. +# @param restrict Restrict to this list. +# @param set_timezone Configure the timezone. +class profile::base::time ( + String $default_timezone = 'Europe/Amsterdam', + Array $ntp_servers = ['time.google.com'], + Array $restrict = [], + Boolean $set_timezone = false, +) { + class { '::ntp': + servers => $ntp_servers, + restrict => $restrict, + } + if $set_timezone { + class { '::timezone': + default_timezone => $default_timezone, + } + } +}