Coder Social home page Coder Social logo

microsoft / dsc-data-driven-deployment Goto Github PK

View Code? Open in Web Editor NEW
51.0 38.0 13.0 76.98 MB

This is a Proof of Concept Project on how a database solution can be utilized to manage DSC configurations. Metadata for the configuration is stored in JSON within the database so that it can be easily retrieved and deployed. Credentials are also stored securely in the database. The project consists of a database schema and a PowerShell module which has a series of functions.

Home Page: https://github.com/microsoft/DSC-data-driven-deployment

License: Other

PowerShell 96.24% HTML 3.07% C# 0.25% TSQL 0.44%

dsc-data-driven-deployment's Introduction

Build status

DSC-data-driven-deployment

Proof-of-concept project illustrating an approach to persisting configuration which allows one to manage and apply DSC configurations in a push driven environment. Metadata such as parameters and defaults for the configuration are stored as JSON within a database so that it can be programmatically retrieved and deployed. Credentials are also stored securely in the database. A queuing mechanism exposed as a cmdlet and backed by a table is provided as a means to push configurations on demand.

Why?

Provide a central repository to store configurations and credentials, to allow efficient Enterprise provisioning and auditing of configurations.

##Prerequisites

  • SQL Server to hold central database repository.
  • Windows Server to act as central deployment server.

##Installation

  • Log on to SQL Server
  • Clone repository with git clone https://github.com/Microsoft/DSC-data-driven-deployment
    • If Clone location is other than C:\DSC-data-driven-deployment\Modules\ConfigurationHelper.psm1 then update DSCExecutionTask.ps1 and InputDSCConfigurationMetadata.ps1 to reflect the location.
  • Open PowerShell Prompt as admin
  • Install-module xSQLServer
  • Edit DSCDataDrivenSQLConfiguration.ps1 replace variable values for your environment
  • Run DSCDataDrivenSQLConfiguration.ps1
  • Open SSMS connect to server.
    • Right click Databases and select Deploy-Data-tier Application
    • Select dacpac from build directory
    • Click Next and Finish
  • Log on to Deployment Server
    • Copy Project locally to Deployment Server. Same drive letter as SQL or modifications will need to be made.
    • Open PowerShell Prompt as admin
    • Install-module xSQLServer
    • Install-module xFailoverCluster
  • Open InputDSCConfigurationMetadata.ps1 and modify parmaters at top to meet your environment.
  • Execute InputDSCConfigurationMetaData.ps1
  • Modify DSCSQLMetaBuild.ps1 to match your needs
  • Create scheduled task to call script
  • At this point you can use the Examples commented out in InputDSCConfigurationMetadata.ps1 to Enqueue a new build request.

##Assumptions

  • SMB (Port 445) is open between deployment server and servers to receive configuration.
    • xcopy of DSC module is leveraged to move DSC module to remote node
  • Configurations provided are using AllowPlainTextPassword for demonstration purposes only.
    • Configurations should be updated to leverage certificates so passwords are not stored plain text.
    • Steps to complete this are detailed here
  • SQL Server bits location provided must have a folder in it called Source with the installation bits of SQL Server
  • Windows Bits location provided must have the full path to the sxs folder of Windows Server you are applying .NET

##Updates

  • New Utility added LabInaBox
  • LabInaBox updated with new simplified approach. Functions provided which take JSON file with required paramaters.

Contribute

There are many ways to contribute.

  • Submit bugs and help us verify fixes as they are checked in.
  • Review code changes.
  • Contribute bug fixes and features.

For code contributions, you will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you grant us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under the appropriate copyright.

Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement Microsoft Contribution License Agreement.pdf, sign, scan, and email it back to [email protected]. Be sure to include your GitHub user name along with the agreement. Once we have received the signed CLA, we'll review the request.

##Code of Conduct This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

This project is licensed under the MIT License.

dsc-data-driven-deployment's People

Contributors

aultt avatar kenkilty avatar microsoft-github-policy-service[bot] avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dsc-data-driven-deployment's Issues

xScheduleTask

Currently resource is being used for Scheduling the queue watcher for the DSC configuration database. Start time is only parameter to schedule the resource to start. Needs to be on server start instead.

Consolidate config deserialization logic

Stop-LabinaBox, Start-LabinaBox, Remove-LabinaBox, CheckPoint-LabinaBox, Remove-LabinaBoxSnapshot, New-LabinaBox, Update-LabinaBox all have the same first two or so lines of code to deserialize your configuration from JSON into a PSCustomObject. Create a private (non exported) function or cmdlet for this to reduce code duplication across these functions.

[Enhancement]Request for CORE builds

I as a user would like the ability to 'build' desktops/servers using a CORE build. The reason I am asking, it will help familiarize individuals that have never used CORE before a place to play. Thanks

LabInABox.psm1 fixed resource names

LabInABox.psm1 has explicit string literals to resources whose name may change. Example: en_sql_server_2016_enterprise_x64_dvd_8701793.iso and PowerShell_6.0.0.14-alpha.14-win10-x64.msi. For these sort of strings it may be worth marking the versions in the configuration in the likely event the names change when new versions are released. I would leave the more static resource names e.g. DSCResources.zip alone and out of the configuration. Include only those resource strings likely to change such as the two above.

Add-ServerConfigtoQueue refactor to remove code duplication

Add-ServerConfigtoQueue should be reworked with a while loop that attempts the initial push instead of duplicate attempt logic living in the catch block. The catch block should only report a failed attempt. Increment a retry count value in the finally block.

ISOs not listed in GUI

When initially starting LIAB, I click on 'FILE', then 'OPEN' and choose the 'Default_Private_Config.json' located under: C:\Program Files\LabInaBox\LabConfig

From there, the drop downs are blank.
screen_shot_4
screen_shot_5

Add-LabVMtoDomain Refactor

Add-LabVMtoDomain is a bit fragile as written. I would advise changing this to use well known source/dest locations with Get-ChildItem | Copy-Item โ€ฆ declarative copies instead of explicit copies. As written items are copied one by one using explicit paths and names.

xScheduleTask #2

Resource currently doesn't have the ability to run with the highest privilege which is required for the PowerShell task to function correctly. Make changes to resource or utilize a script task.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.