LoginSignup
1
1

More than 5 years have passed since last update.

[Linux][Ansible] localeの設定 (ja_JP.UTF-8) に設定

Last updated at Posted at 2017-06-02

Ansibleでlocaleを設定する方法

設定例

localeの設定例(Ubuntu)
    - name: install language-pack-ja
      apt: name={{ item }} update_cache=yes
      with_items:
        - language-pack-ja

    - name: create locale ja_JP.UTF-8
      locale_gen:
        name: ja_JP.UTF-8

    - name: change locale
      command: update-locale LANG=ja_JP.UTF-8

Ansibleの locale_gen は対象のlocaleが生成されていなければ生成する。
(Ubuntuの場合には language-pack-ja のインストールで生成されているのでいらないかもしれない)

TODO: 最後でcommandで実行しているのを冪等性のチェックでokにするには?

参考

locale_gen - Creates or removes locales. — Ansible Documentation
Debian/Ubuntuのデフォルトロケールを変更する - Qiita

1
1
1

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
1
1