Skip to content

Node environment is not determined #161

Description

@JonasRied

Problem description

The expression [x={ $File.Directory.BaseName } =] does not determine node environment.

Verbose logs

null

How to reproduce

# source/AllNodes/Stage/server1.yml
NodeName: '[x={ $Node.Name }=]'
Environment: '[x={ $File.Directory.BaseName } =]'
Role: Webserver
Description: '[x= "$($Node.Role) in $($Node.Environment)" =]'
Location: DataCenter

Expected behavior

ParentFolderName of node yml file is set as node environment.

Current behavior

Describing Node Definition Files
 Context Testing for conflicts / duplicate data
   [+] Should not have duplicate node names 10ms (2ms|8ms)
  [+] 'server1.dev.de' has valid yaml 24ms (21ms|3ms)
  [!] 'server1.dev.de' is in the right environment is skipped, because Environment for 'server1.dev.de' is either not set or like '[x=*' 32ms (29ms|3ms)
  [+] Location of 'server1.dev.de' is 'DataCenter' and does exist 8ms (6ms|1ms)
  [!] Environment of 'server1.dev.de' is '[x={ $File.Directory.BaseName } =]' and does exist is skipped, because Environment for 'server1.dev.de' is either not set or like '[x=*' 5ms (4ms|1ms)
  [+] Role of 'server1.dev.de' is 'Webserver' and does exist 15ms (7ms|8ms)
  [!] Baseline of 'server1.dev.de' is '' and does exist is skipped, because Baseline for 'server1.dev.de' is not set 5ms (4ms|1ms) 

Suggested solution

null

Operating system the target node is running

OsName               : Microsoft Windows 10 Enterprise        
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.19041.3693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.3693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module version used

null

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions