0
1

More than 1 year has passed since last update.

Azure AutomationでDSCを構成する

Last updated at Posted at 2022-03-31

Azure Automation State Configuration(DSC)を利用すると、DSCサーバを用意することなくプルサーバ機能を用意することができます。

手順

  1. Automationアカウントのデプロイ
  2. VMのデプロイ
  3. DSC構成ファイルのインポート
  4. DSC構成のコンパイル
  5. 管理対象ノードの追加
  6. 結果の確認

Automationアカウントのデプロイ

任意のパラメータでAutomationアカウントを作成します。
image.png
image.png

VMのデプロイ

DSC機能で構成する対象VMを作成しておきます。OSはWindows Serverを選択しておいた方が設定が楽です。

DSCの追加

[構成]⇒[追加]からDSC構成用のファイルをインポート
image.png
image.png

ここでインポートするファイルは下記のような宣言型のスクリプトです。

Configuration SampleConfig {     
    Node "WebServer" {
        WindowsFeature IIS {
            Name = "Web-Server"
            Ensure = "Present"
        }
        WindowsFeature IISTools {
            Name = "Web-Mgmt-Tools"
            Ensure = "Present"
        }
        WindowsFeature xTelnet {
            Name = "Telnet-Client"
            Ensure = "Absent"
        }
    }
 
    Node "DNSServer" {
        WindowsFeature DNS {
            Name = "DNS"
            Ensure = "Present"
        }
        WindowsFeature DNSTools {
            Name = "RSAT-DNS-Server"
            Ensure = "Present"
        }
        WindowsFeature xTelnet {
            Name = "Telnet-Client"
            Ensure = "Absent"
        }
    }
}

DSC構成のコンパイル

image.png
設定したConfigを元にプルサーバ上に展開する構成をコンパイルします。これにより各ノードがDSC構成を利用できるようになります。

ノードの追加

[ノード]⇒[追加]から管理対象VMを追加します。
image.png

DSCが割り当てられていることの確認

時間がたつとDSC構成が反映されます。各ノードにレポートが追加されます。
image.png

NSGにて自宅環境のIPからのHTTPを許可するルールを追加してVMのパブリックIPにアクセスすると、確かに動いていることを確認できました。
image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1