Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Server support in metadata.json #42

Closed
rnelson0 opened this issue Nov 4, 2016 · 6 comments
Closed

Windows Server support in metadata.json #42

rnelson0 opened this issue Nov 4, 2016 · 6 comments

Comments

@rnelson0
Copy link
Sponsor Member

rnelson0 commented Nov 4, 2016

It appears that the proper way to support Windows variants in metadata.json, looking at a few puppetlabs examples, is with a string Server <version>[ <release>], e.g. Server 2012 R2. However, this does not result in the OS being added to the on_supported_os hash. Instead, the string 2012 R2 needs to be used.

Which is correct, and is there a way to normalize that so either string would pick up the windows-2012-r2 collections in facterdb?

@rnelson0
Copy link
Sponsor Member Author

rnelson0 commented Nov 4, 2016

It's possible this may need filed against facterdb, just let me know and I can create one there.

natemccurdy added a commit to puppetlabs-toy-chest/puppetlabs-pe_bulk_agent_install that referenced this issue Feb 27, 2017
rspec-puppet-facts currently doesn't quite work when testing against
Windows servers:
voxpupuli/rspec-puppet-facts#42

Because of that, we now specifically set the os['family'] fact and test
on that. Prior to this, the spec test wasn't running against an example
Windows server at all.
@timhughes
Copy link

For the next person - the only windows facts supported at the moment are

        {
            "operatingsystem": "windows",   
            "operatingsystemrelease": [     
                "2012 r2",     
                "7"            
            ]
        },

See voxpupuli/facterdb#17

@DavidS
Copy link
Contributor

DavidS commented Jul 31, 2017

voxpupuli/facterdb#46 added a lot more supported windows platforms, and was released already.

@rnelson0 does that clear up your problem?

@rnelson0
Copy link
Sponsor Member Author

rnelson0 commented Aug 1, 2017

@DavidS Unfortunately, no. The issue is either normalizing the release string, e.g. "2012 R2" and "Server 2012 R2", or fixing any puppetlabs modules that reference the wrong string. For example, here's an rspec test that says

  on_supported_os.each do |os, facts|
    next unless facts[:kernel] == 'windows'

With the string 2012 R2 all is well:

$ grep 2012 metadata.json
        "2012 R2"

$ be rspec spec/classes/profile/base__windows_spec.rb
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.

profile::base::windows
  on windows-2012 R2-x64
    with defaults for all parameters
      should contain Class[profile::base::windows]
      should contain Class[puppet_agent]
  on windows-2012-x64
    with defaults for all parameters
      should contain Class[profile::base::windows]
      should contain Class[puppet_agent]

Finished in 1.26 seconds (files took 3.29 seconds to load)
4 examples, 0 failures

With Server 2012 R2, not so much:

$ grep 2012 metadata.json
        "Server 2012 R2"

$ be rspec spec/classes/profile/base__windows_spec.rb
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
No examples found.

Finished in 0.00045 seconds (files took 3.2 seconds to load)
0 examples, 0 failures

It's pretty clear that the Server portion should not be present right now, but since it's used in Puppet modules, even stdlib, it's confusing.

I guess I'm also looking for a ruling because it would be nice to updated metadata-json-lint to throw warning/errors on it, which is something the Forge could then use to help authors ensure their Compatibility flags are correct - but only if Server isn't normalized.

@DavidS
Copy link
Contributor

DavidS commented Aug 1, 2017

SPEC_FACTS_STRICT=yes should give you the errors. See bottom of https://github.com/mcanevet/rspec-puppet-facts#running-your-tests

IMHO the metadata.json values should match the fact values.

@rnelson0
Copy link
Sponsor Member Author

rnelson0 commented Aug 1, 2017

OK, if there's no normalization then I'll open a modules ticket against stdlib and try and an issue on metadata-json-lint to notify about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants