Created
December 31, 2016 15:20
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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