Installing DSC on Linux

Installing DSC on Windows is as simple as using Windows Update or installing the MSU for your architecture and OS. Installing DSC on Linux requires more work and effort and will vary with the Linux distro you choose. In this book, we will pick CentOS 7 as our target platform; if you choose another distro, you might have to change a few commands with regard to package installation.

Our first step is to install the dependencies required in order to compile and install OMI and DSC on our Linux server. We can do this using yum, the RPM package manager. This will take some time, as yum initializes the repositories and downloads the packages before it installs them onto your server:

sudo yum -y groupinstall 'Development Tools'
sudo yum -y install pam-devel openssl-devel python python-devel libcurl-devel wget
The name of the preceding packages will vary with your Linux distro. If you use something other than CentOS, then you will have to search for the correctly named package using tools from that distro.

The next step is to download and install the RPM packages for OMI and DSC:

wget https://github.com/Microsoft/omi/releases/download/v1.1.0-0/omi-1.1.0.ssl_100.x64.rpm
wget https://github.com/Microsoft/PowerShell-DSC-for-Linux/releases/download/v1.1.1-294/dsc-1.1.1-294.ssl_100.x64.rpm

sudo rpm -Uvh omi-1.1.0.ssl_100.x64.rpm
sudo rpm -Uvh dsc-1.1.1-294.ssl_100.x64.rpm

The RPM packages will install and set up the OMI server for you with the default configuration set. It will also install the built-in set of DSC resources that work on Linux systems:

  • nxGroupResource
  • nxFileResource
  • nxUserResource
  • nxArchiveResource
  • nxServiceResource
  • nxScriptResource
  • nxFileLineResource
  • nxPackageResource
  • nxSshAuthorizedKeysResource
  • nxEnvironmentResource

You'll notice that these mirror the built-in DSC resources in the WMF installation almost exactly. This is entirely on purpose, and it allows you to manage your Linux systems with some extra code needed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset