2016.09.10 System Center User Group Japan 第15回勉強会のセッション資料です。サンプルコードは GitHub で公開します。
PowerShell DSC の概要(おさらい)と PowerShell DSC for Linux の利用方法、さらに Azure Automation DSC を使用した Aure VM の構成についてお話しました。PowerShell Core for Linux についても簡単にまとめています。
1. PowerShell DSC と Linux
System Center User Group Japan #15 (2016.09.10)
Kazuki Takai
2. 自己紹介
高井 一輝 (Takai Kazuki)
某ISP勤務
クラウドサービスの開発、設計、設備維持
Windows Server / System Center / Linux / etc…
System Center User Group Japan (SCUGJ)
Twitter : @zhuky7 / Facebook : kazuki.takai
Blog : http://operationslab.wordpress.com/
2
3. Agenda
PowerShell DSC おさらい
PowerShell DSC を使用した Linux の構成
Azure Automation DSC を使用した Linux の構成
おまけ
PowerShell on Linux
3
17. PowerShell DSC for Linux
PowerShell DSC を使用して Linux の構成を管理・実行できる
Windows と同様の仕組みで管理できる
OS 上で動作する構成管理の仕組みであるため、ファブリックにあまり依存せず動く
Azure でも、AWS でも、オンプレミスの物理でも、VM でも
PowerShell DSC for Linux のパッケージには、大きく以下の二つが含まれる
Linux 用 DSC Agent (LCM)
Linux 用 DSC Resource (nx* DSC リソース)
17
18. PowerShell DSC for Linux の要件
サポート OS
RHEL および CentOS、Oracle Linux、Debian、Ubuntu、SuSE など
詳細な対応バージョンは MSDN 参照
必要なソフトウェア
glibc, python, python-ctypes, openssl, lincurl
omiserver
(PowerShell DSC for Linux / Linux 用 DSC)
18
19. DSC for Linux のインストール
glibc, python, python-ctypes, openssl, lincurl をインストールする
ディストリビューションが提供するパッケージをインストール
Ubuntu 16.04 LTS の場合は、デフォルトでほぼインストールされている
(Python が新しすぎるかも…)
OMI Server のパッケージを GitHub からダウンロードしてインストール
https://github.com/Microsoft/omi
PowerShell DSC for Linux のパッケージを GitHub からダウンロードしてインストール
https://github.com/Microsoft/PowerShell-DSC-for-Linux
Microsoft ダウンロードセンターからダウンロードできるものは古いので使用しない
(2016.09.10 現在)
19
33. PowerShell on Linux
PowerShell が Linux 上で動く
Linux だけでなく、macOS でも Windows でも
PowerShell for every system!
GitHub 上で公開
https://github.com/PowerShell/PowerShell
インストール方法なども、上記 URL に記載されている
お試し程度であれば、有志が公開しているコンテナーイメージを使用する方法もある
33
34. 厳密には…
PowerShell Core が動く(Core Edition)
Desktop Edition
Full .NET Framework 依存
Windows クライアントおよび Windows Server のみ(Nano Server は除く)
Core Edition
.NET Core 依存
Desktop Edition のサブセット的な位置付け
Windows(Nano 含む)、Linux、macOS で動作
Edition の判別は $PSVersionTable.PSEdition
34
37. まとめ
PowerShell DSC for Linux を使用することで、Windows と同様の手法で Linux
の構成管理が可能
Azure Automation DSC を使用することで、DSC Pull サーバを手元に用意しな
くてもクラウド上で一元的な管理が可能
構成管理ツールは DSC だけではないので、利用環境に適したツールを使うべき
37
38. 参考資料
Windows PowerShell Desired State Configuration の概要
https://msdn.microsoft.com/ja-jp/powershell/dsc/overview
Open Management Infrastructure
https://github.com/Microsoft/omi
PowerShell Desired State Configuration for Linux
https://github.com/Microsoft/PowerShell-DSC-for-Linux
PowerShell DSC for Linux version 1.1 is Now Available! And New Linux Resources!
https://blogs.msdn.microsoft.com/powershell/2015/09/29/powershell-dsc-for-linux-version-1-
1-is-now-available-and-new-linux-resources/
Azure Automation DSC の概要
https://azure.microsoft.com/ja-jp/documentation/articles/automation-dsc-overview/
38