Here’s a quick guide on how to set up DSC on CentOS 7. This requires OMI and DSC for Linux. It’s a bit of a pain to track down the downloads for these, and the OMI one doesn’t play ball when using wget, so I’ve put them on Dropbox for ease of use:
I always use the Minimal installation of CentOS. I started with CentOS-7-x86_64-Minimal-1511.iso
- Install CentOS, configure an IP address
- Connect in via SSH, or the console, run the following commands:
- yum install wget -y
- cd /home
- wget http://bit.ly/omi1084
- wget http://bit.ly/dsc_linux_111
- tar -zxvf omi1084
- tar -zxvf dsc_linux_111
- rpm -ivh omi-1.0.8.ssl_100.x64.rpm
- systemctl start omid.service
- rpm -ivh dsc-1.1.1-70.ssl_100.x64.rpm
To test connectivity from a Windows machine, do the following:
$session = New-CimSession -Credential (Get-Credential) -Authentication Basic -ComputerName <name or IP here> -SessionOption (New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -UseSsl) Get-CimInstance -CimSession $session -ClassName OMI_Identify -Namespace root/omi
You’ll be prompted to enter credentials after that first line. Then, after running Get-CimInstance you should see an output as per below:
The CentOS machine is now ready to receive configs using DSC. I’ll be blogging more related stuff soon, but there’s a great write-up on the PowerShell Documentation pages that goes into more detail:
Get started with Desired State Configuration (DSC) for Linux