Skip to content

Instantly share code, notes, and snippets.

@jeffpatton1971
Created December 31, 2016 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffpatton1971/77ecc6434cc14398f35b3b784e7e01bb to your computer and use it in GitHub Desktop.
Save jeffpatton1971/77ecc6434cc14398f35b3b784e7e01bb to your computer and use it in GitHub Desktop.
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