タイムゾーン変更用のplaybook。
マニュアルは、https://docs.ansible.com/ansible/latest/modules/win_timezone_module.html
setTimeZone.yml
---
- hosts:
- windows # インベントリファイルで指定した名前
tasks:
- name: set time zone(Tokyo)
win_timezone:
timezone: Tokyo Standard Time
timezoneは必須。どんなタイムゾーンが使えるかは、
https://msdn.microsoft.com/en-us/library/ms912391.aspx
でわかる。
以下コマンドで実行。
ansible-playbook -i ./ansible/hosts ./ansible/setTimeZone.yml
コマンド実行結果
PLAY [windows] ************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************
ok: [ホスト名]
TASK [set time zone(Tokyo)] ***********************************************************************************************************
changed: [ホスト名]
PLAY RECAP ****************************************************************************************************************************
ホスト名 : ok=2 changed=1 unreachable=0 failed=0