Skip to content

Salt formula to set the computer name of a system

License

Notifications You must be signed in to change notification settings

plus3it/name-computer-formula

Folders and files

NameName
Last commit message
Last commit date
Aug 19, 2024
Mar 20, 2024
Aug 1, 2024
Sep 25, 2023
May 4, 2017
Sep 25, 2023
Sep 25, 2023
Aug 12, 2024
May 2, 2016
Sep 25, 2023
May 6, 2017
Mar 18, 2024

Repository files navigation

license Travis Build Status AppVeyor Build Status

name-computer-formula

Cross-platform salt formula to set the computer name of a system.

Available States

name-computer

Set the computer name on Windows, or the hostname on Linux.

Configuration

There are two configuration options:

  • computername
  • pattern

The computername, is read from a salt grain, name-computer:computername, or a pillar key, name-computer:lookup:computername.

The pattern is read only from pillar, name-computer:lookup:pattern. The value is a perl-compatible regular expression (PCRE). The computername is tested against the pattern. The default pattern is .*, which matches any value.

The logic flow is as follows:

  1. If the computername grain has a value that matches the pattern, use the grain value.
  2. Otherwise, if the computername pillar has a value that matches the pattern, use the pillar value.
  3. If neither of those conditions are met, do nothing.

About

Salt formula to set the computer name of a system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published