server_tokens off nginx jfryman puppet implementation server_tokens off nginx jfryman puppet implementation nginx nginx

server_tokens off nginx jfryman puppet implementation


If you intend to write Puppet DSL code then I urge you to read up on the language so that you understand what you are writing. Puppetlabs provides pretty good documentation, including a language reference, which would be a good place to start.

It would also be a good idea to read the docs for the module you are trying to use. Here, however, although the module has fairly lengthy docs, they seem to miss going into much detail, so it's not unreasonable that you should turn to the manifest files themselves for information. Inasmuch as you have done so, however, you should at least read the introductory comments in those. If you had done so, you surely would have seen this at the end of the short introductory comment to class nginx::config:

# Sample Usage:## This class file is not called directly

Since you are trying to use that class directly, I conclude that you did not, in fact, read its documentary comment. It appears that the class you actually want to declare is named simply nginx.

Puppet is right, of course, that your code is syntactically wrong. The fragment you posted is closer to the form of a resource declaration than to the form of a class declaration, but it is not a valid example of either one.

The module documentation provides a couple of examples of declaring class nginx, but here I suggest that you focus instead on its discussion of how to bind data to that class's parameters via Hiera. That's the best way to set a non-default value for its server_tokens parameter or any other.

Although it would probably work for you to declare class nginx as demonstrated in the docs, using the demonstrated style of class declaration is poor form, and it would have the potential to cause you trouble later. Read up on "include-like" and "resource-like" class declarations in the linked section of the language reference, and use an include-like declaration instead, maybe

include 'nginx'

.