Hell Chef Community,
Had a question for you and maybe you can help me to find the answer. I have finally started to use chef and I am trying to automate everything as much as possible. Currently, a task is to automate the installation of Exchange Server with dsc module xExchange.
Technology
- Exchange
- DSC - dsc_resource
- Chef
Everything works with DSC but now I am trying to translate it into chef. One of the things that needs to be done is to have secure the mof file in DSC so it can detect the correct account with the correct permissions.
Example Script:
Configuration InstallExchange
{
param
(
[PSCredential] $ShellCreds
)
Node $allnodes.Nodename
{
xExchInstall InstallExchange
{
Path = "C:\Exch\Setup.exe"
Arguments = "/mode:Install /role:Mailbox /Iacceptexchangeserverlicenseterms"
Credential = $ShellCreds
}
}
}
$ConfigData=@{
AllNodes = @(
@{
NodeName = "*"
#Replace thumbprint with yours or use precreated cert
CertificateFile = "$env:temp\XXXXXX.cer"
Thumbprint = "XXXXXXXXXXXXXXXXXXX"
}
@{
NodeName = "localhost"
}
);
}
Question:
- Is there a way we can secure the mof files in Chef with the thumbprint of a certificate that is needed in the ConfigData? https://docs.microsoft.com/en-us/powershell/dsc/securemof
- Or is there any other way this can be pass through to DSC that way it works?
It seems this is one of the requirements for the install of exchange. Let me know or if there is any other better way to do it. Appreciate the help and thank you!