PowerShell / PowerShell/PowerShell-RFC

RFC: Extract DSC from Existing Environments

未关闭
#146 5 条评论 15 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
PowerShell
星标
467
派生
140
平均合并
9 分钟
30 天内合并 PR
1

描述

--
RFC: RFC00xx
Author: Nik Charlebois

Reverse Engineering Existing Environment into DSC

Users have been complaining about the learning curve to get started with DSC and about the amount of work it takes for them to re-write their existing technology investment onto DSC for monitoring purposes. There have been various community projects to solve this issue by extracting DSC configurations out of existing environments, such as ReverseDSC, which had incredible success with clients wanting to adopt Configuration as Code practices within their organizations.

The purpose of this RFC is to propose that a fourth method that would retrieve all instances of a resource against an existing environment be included in DSC resources for them to be identified as HQRM.

Motivation

  • Reduce amount of work required to on-board existing environments onto DSC
  • Reduce learning curve to get started with DSC
  • Provide an automated path to migrate on-premises environments onto Azure
  • Allow users to easily document their environment’s configuration as code
  • Quickly compare configuration deltas between two environments

Specifications

There are three components to the requested solution:

  • Component 1 needs to iterate through all instances of the current resource and provide the Get-TargetResource function the key parameters for it to be able to retrieve all other parameters associated with this resource instance.
  • Component 2 needs to retrieve the Hash tables received back from the Get-TargetResource and convert them into a DSC string. This is already automated and handled by the existing ReverseDSC Core module https://github.com/microsoft/reversedsc
  • Component 3 needs to orchestrate the calls to the resources’ Component 1 and 2 and collect the results into a resulting file, which will be a DSC script that can be used to replicate the environment.

The vision is as follow:
Component 1 and 2 would be combined into a new fourth function required by every HQRM, call it Export-TargetResource. Component 3 would be a global utility module, contained within the DSC module, which would orchestrate all the calls to the module’s Export-TargetResource methods (see SharePointDSC.Reverse at https://github.com/microsoft/sharepointdsc.reverse for a reference)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 RFC 的 Specifications 部分开始,审查其中引用的 ReverseDSC Core 模块和 SharePointDSC.Reverse 项目。跟踪 Get-TargetResource 当前如何检索资源实例,以及拟议的 Export-TargetResource 将如何与全局实用工具模块协作。完成的标准是产出一份经过审查的设计,用于将现有环境提取为可复用的 DSC 脚本。

由索引模型根据 Issue 内容生成。

评估

技术栈
powershell
领域
cloud, devops, infrastructure
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。