PowerShell 希望状态配置 - 适用于 Linux
Copyright (c) Microsoft Corporation ver. 1.1.1
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The latest release packages for PowerShell DSC for Linux can be downloaded here: Releases
DSC has shifted to a cross-platform implementation that is developed in the PSDesiredStateConfiguration repo. Unless you have specific needs that require version 1, please navigate to the new location to view the current work on version 3.
For more information, please see the doumentation for Desired State Configuration.
This repo has been archived and will no longer accept new issues or pull requests.
Three solutions were originally released from this repo:
The codebase in this repo has been updated with fixes based on customer incidents reported for Microsoft Monitoring Agent. Therefore, the Microsoft Monitoring Agent already utilizes the latest release. Unfortunately, it has not been possible to publish new releases for either standalone installations or DSC extension. If you encounter challenges with either scenario and would like to evaluate if the latest code will resolve your issue, the best option is to download the latest release, then distribute it using custom tools (such as Azure Custom Script Extension). This is not intended to expand upon the supported OS coverage.
Please note that per the documentation for DSC Linux Extension, the extensions for DSC Linux and Monitoring cannot be used together on the same machine.
The following Linux operating system versions are supported by DSC for Linux.
The following table describes the required package dependencies for DSC for Linux.
Required package | Description | Minimum version
----------------------- | ------------------------------------- | -------------------
glibc | GNU C Library | 2.4 - 31.30
python | Python | 2.4 - 3.4
omi | Open Management Infrastructure | 1.0.8-4
openssl | OpenSSL Libraries | 0.9.8e or 1.0
python-ctypes | Python CTypes library | Must match Python version
libcurl | cURL http client library | 7.15.1
OMI Packages can be found at OMI.
OMI and DSC packages are available in RPM and Debian packages, for x86 and x64 architectures, and for systems with OpenSSL version 0.9.8 and version 1.0.x. To install DSC, select determine the packages that are correct for your operating system, and install them.
Examples Red Hat Enterprise Linux, CentOS, or Oracle Linux 7:
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 dsc-1.1.1-294.ssl_100.x64.rpmUbuntu 14.04 LTS, 16.04 LTS, or Debian GNU/Linux 8, x64:
wget https://github.com/Microsoft/omi/releases/download/v1.1.0-0/omi-1.1.0.ssl_100.x64.deb
wget https://github.com/Microsoft/PowerShell-DSC-for-Linux/releases/download/v1.1.1-294/dsc-1.1.1-294.ssl_100.x64.deb
sudo dpkg -i omi-1.1.0.ssl_100.x64.deb dsc-1.1.1-294.ssl_100.x64.debFor more information, review the latest release notes and product documentation.
Prerequisites
or
A Linux computer with:
Install the Linux Resource Provider MOF module:
install-module nxImport-DscResource -Module nx inside a DSC Configuration block.Remotely managing a Linux system with DSC
Start-DscConfiguration -CimSession:$myCimSession -Path:"C:\path_to_compiled_mof_directory\" -Wait -VerboseGet-DscConfiguration -CimSession:$myCimSessionTest-DscConfiguration -CimSession:$myCimSession-CimSession parameter, see: http://technet.microsoft.com/en-us/library/jj590760.aspxLocally managing a Linux system with DSC
g++python-develpam-developenssl-develomi-1.0.8 in a directory parallel to the LCM and Providers directory. The directory tree should look something like: ./configure
./LCM
./license.txt
./omi-1.0.8
./omi-1.0.8/agent
./omi-1.0.8/base
...Building
/opt/omi-1.0.8cd omi-1.0.8 && ./configuremakecd omi-1.0.8 && sudo ./output/installsudo make regRunning OMI
omiserver with environment variable OMI_HOME set to OMI's installed directoryOMI_HOME= $OMI_HOME/bin/omiserver/opt/omi-1.0.8. Thus, for default installations, part 4Ai above becomes:
OMI_HOME=/opt/omi-1.0.8 $OMI_HOME/bin/omiserverNote: In order to run following reboots, it is recommended to configure OMI as a System-V, Upstart, or SystemD daemon
DSC and OMI can also be built together entirely from source in a self-contained directory. This is useful primarily for developers.
# Clone DSC source
git clone https://github.com/Microsoft/PowerShell-DSC-for-Linux.git
cd PowerShell-DSC-for-Linux
# Place the OMI source where DSC expects it
# Alternatively clone from Git and symlink to omi/Unix
wget https://collaboration.opengroup.org/omi/documents/33715/omi-1.0.8.tar.gz
tar xf omi-1.0.8.tar.gz
# Build OMI in developer mode
cd omi-1.0.8
./configure --dev
make -j
cd ..
# Build DSC in developer mode
./configure --no-rpm --no-dpkg --local
make -j
make reg
# Start the OMI server
./omi-1.0.8/output/bin/omiserverNote: For more information on Azure Automation’s DSC features, reference the documentation.
Linux computers can be onboarded to Azure Automation DSC, as long as they have outbound access to the internet, via a few simple steps:
Make sure version 1.1 or later of the DSC Linux agent is installed on the machines you want to onboard to Azure Automation DSC.
To configure Azure Automation as a DSC Pull Server from the Linux computer:
sudo /opt/microsoft/dsc/Scripts/Register.py
sudo /opt/microsoft/dsc/Scripts/python3/Register.py
Additional configuration options:
To configure Azure Automation as a DSC Pull Server with a metaconfiguration MOF:
暂无开放 Issues,或尚未同步最近议题。