lorengordon / name-computer-formula

Salt formula to set the computer name of a system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:Apache License 2.0


Languages

Language:Jinja 72.4%Language:SaltStack 21.3%Language:Makefile 5.3%Language:Dockerfile 1.0%