Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple configuration, all vm's with role == server should get user01 and all vm's with role == webserver should get apache installed.
Configuration LinuxConf
{
Import-DscResource -ModuleName nx
Node $AllNodes.Where{$_.Role -like "*server"}.NodeName
{
nxUser NewAccount
{
UserName = 'user01'
Ensure = 'Present'
FullName = 'A User'
Password = 'P@ssw0rd!'
HomeDirectory = '/home/user01'
}
}
Node $AllNodes.Where{$_.Role -eq "webserver"}.NodeName
{
nxPackage Apache
{
Name = 'apache2'
Ensure = 'Present'
PackageManager = 'Apt'
}
}
}
$MyNodes =
@{
AllNodes =
@(
@{
NodeName = 'ubuntu'
Role = 'server'
},
@{
NodeName = 'web-01'
Role = 'webserver'
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.