LoginSignup
3
2

More than 5 years have passed since last update.

Ansible hostname

Posted at

hostname

ホスト名を管理する。
バージョン1.4で追加。

概要

システムのホスト名をセットする。
現在、Debian、 Ubuntu、 Fedora、 RedHat、 openSUSE、 Linaro、 ScientificLinux、 Arch、 CentOS、 AMIのOSで使用可能。「systemd」をinitのシステムで使うディストリビューションで使用可能。
このモジュールでは「/etc/hosts」を変更しないという点で注意が必要。
hostsを書き換える場合は、「template」や「replace」といったモジュールを使う必要がある。

前提条件

hostnameが必要。

オプション

引数 必須 デフォルト 備考
name yes ホスト名

使用例

- hostname: name=web01

Ansibleコアモジュール

このモジュールはコア・アンシブルチームによりメンテナンスされます。

3
2
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
3
2