-
Notifications
You must be signed in to change notification settings - Fork 31
Platform Module
Steven Borrelli edited this page Aug 26, 2016
·
6 revisions
##Platform Module
###Overview The platform module exposes facts about the underlying operating system (OS version, type, build information) to other nodes in the graph.
###Usage Platform data is available as a variable to functions and templates:
{{ platform.OS }}
{{ platform.Version }}
{{ platform.Name }}
###Available data
-
platform.Name
: Operating System Name:{ Alpine Linux v3.4, Mac OS X, CentOS Linux 7 (Core) }
-
platform.OS
: sourced from golangruntime.GOOS
.{ linux, darwin, windows...}
-
platform.Version
: OS Version -
platform.Build
: build ID if available -
platform.LinuxDistribution
: Linux distribution{ alpine, centos, coreos, debian, ubuntu, ... }
-
platform.Like
: similar Linux platforms (for examplecentos
is likerhel, fedora
)
###Examples:
App file:
param "filename" {
default = "platform.txt"
}
file.content "platformData" {
destination = "{{ platform.OS }}-{{ param `filename` }}"
content = "Detected {{ platform.Name }} ({{ platform.OS }}) {{ platform.Version}} {{ platform.LinuxDistribution}}"
}
output:
Detected Mac OS X (darwin) 10.11.6