开源软件名称(OpenSource Name):microsoft/PowerShell-DSC-for-Linux开源软件地址(OpenSource Url):https://github.com/microsoft/PowerShell-DSC-for-Linux开源编程语言(OpenSource Language):C 56.9%开源软件介绍(OpenSource Introduction):PowerShell Desired State Configuration for LinuxCopyright (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. Getting StartedLatest ReleaseThe latest release packages for PowerShell DSC for Linux can be downloaded here: Releases Current status and roadmap for Linux DSCThis repo is the home for the source code and development of Desired State Configuration for Linux. There are three solutions where releases from this repo are expected to be consumed:
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 future roadmap for this solution is to move to Azure Policy Guest Configuration when it is capable of deploying configurations. Currently, Guest Configuration is only able to audit server configurations. Many more details including timing and migration will be available later in calendar year 2020. Supported Linux operating systemsThe following Linux operating system versions are supported by DSC for Linux.
RequirementsThe following table describes the required package dependencies for DSC for Linux.
OMI Packages can be found at OMI. Installing DSC PackagesOMI 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.rpm Ubuntu 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.deb For more information, review the latest release notes and product documentation. To author DSC MOF configuration for Linux on a Windows computer:Prerequisites
or
Building the Desired State Configuration (DSC) Local Configuration Manager and Linux Resource ProvidersPrerequisites
Building and installing the Local Configuration Manager and Linux Resource Providers
Building and using DSC and OMI from sourceDSC 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/omiserver Use Azure Automation as a DSC Pull ServerNote: For more information on Azure Automation’s DSC features, reference the documentation. 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:
For python2
For python3
Additional configuration options:
To configure Azure Automation as a DSC Pull Server with a metaconfiguration MOF:
For python2
For python3
Importing resource modules to Azure AutomationThe supplied resource modules with this release (nxNetworking, nxComputerManagement) can be imported to Azure Automation for distribution with DSC configurations. To import to Azure Automation, rename the .zip files to remove the _X.Y version string from the file name. Such as: nxNetworking.zip and nxComputerManagement.zip. Performing DSC Operations from the Linux ComputerDSC for Linux includes scripts to work with configuration from the local Linux computer. These scripts are located in GetDscConfiguration.py
Returns the current configuration applied to the computer. Similar to the Windows PowerShell cmdlet Get-DscConfiguration cmdlet.
GetDscLocalConfigurationManager.py
Returns the current meta-configuration applied to the computer. Similar to the Windows PowerShell cmdlet Get-DSCLocalConfigurationManager
PerformRequiredConfigurationChecks.py
Immediately checks the configuration in accordance with the MetaConfiguration settings and applies the configuration if an update is available. Useful for immediately applying configuration changes on the pull server.
RestoreConfiguration.py
Applies the previous configuration known to DSC, a rollback. SetDscLocalConfigurationManager.py
Applies a Meta Configuration MOF file to the computer. Similar to the Windows PowerShell cmdlet: Set-DSCLocalConfigurationManager. Requires the path to the Meta Configuration MOF to apply.
StartDscConfiguration.py
Applies a configuration MOF file to the computer. Similar to the Windows PowerShell cmdlet: StartDscConfiguration. Requires the path to the configuration MOF to apply.
You can also supply the force parameter to forcibly remove any current pending configuration before applying the new configuration.
TestDscConfiguration.py
Tests the current system configuration for compliance desired state. Similar to the Windows PowerShell cmdlet: Test-DscConfiguration. InstallModule.py
Installs a custom DSC resource module. Requires the path to a .zip file containing the module shared object library and schema MOF files.
RemoveModule.py
Removes a custom DSC resource module. Requires the name of the module to remove.
Using PowerShell Desired State Configuration for Linux with a Pull ServerUsing HTTPS with the Pull ServerThough unencrypted HTTP is supported for communication with the Pull server, HTTPS (SSL/TLS) is recommended. When using HTTPS, the DSC Local Configuration Manager requires that the SSL certificate of the Pull server is verifiable (signed by a trusted authority, has a common name that matches the URL, etc.). You can modify these HTTPS requirements as needed, by modifying the file /etc/opt/omi/dsc/dsc.conf. The supported properties defined in this file are:
For more information on configuring cipher support, see: http://curl.haxx.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html Using an HTTP(s) Proxy Server with DSCDSC for Linux supports the use of an HTTP or HTTPS proxy server when communicating with a Pull Server. To configure a proxy server, edit the file
Example
PowerShell Desired State Configuration for Linux Log FilesThe following log files are generated for DSC for Linux messages.
Code of ConductThis project has adopted the [Microsoft Open Source Code of Conduct] (https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ] (https://opensource.microsoft.com/codeofconduct/faq/) or contact opencode@microsoft.com with any additional questions or comments. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论