Closed Bug 1520855 Opened 7 years ago Closed 7 years ago

Ronin Windows write powershell script to create facts based off of env variables

Categories

(Infrastructure & Operations :: RelOps: Puppet, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: markco, Assigned: markco)

References

Details

No description provided.
Assignee: relops → mcornmesser
Blocks: 1464105

By default facter does not create facts based off of environment variables. The main reason this is useful is that will avoid hard coding to a drive letter or directory.

https://github.com/markcor/ronin-win-base/blob/master/site/shared/facts.d/win_env_fact.ps1

Source Code Form is subject to the terms of the Mozilla Public

License, v. 2.0. If a copy of the MPL was not distributed with this

file, You can obtain one at http://mozilla.org/MPL/2.0/.

Creates useful facts based off of system environment variables

$programdata = $env:programdata.replace("","\")
$programfiles = $env:ProgramW6432.replace("","\")
$programfilesx86 = "$env:ProgramFiles(x86)".replace("","\")

Environment variables

write-host "systemdrive=$env:systemdrive\"
write-host "programdata=$programdata\"
write-host "programfiles=$programfiles\"
write-host "programfilesx86=$programfilesx86\"

Facts built off of environment variables

write-host "roninprogramdata=$programdata\PuppetLabs\ronin"
write-host "roninsemaphoredir=$programdata\PuppetLabs\ronin\semaphore"
write-host "tempdir=$env:systemdrive\Windows\Temp"

Bug list

https://bugzilla.mozilla.org/show_bug.cgi?id=1520855

Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.