Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

DevOpsnipp.com © 2020

medium.png

timezone.yml

Ansible set timezone on Ubuntu host

0

Votes

- name: Group by Distribution
  hosts: all
  tasks:
    - group_by: key=${ansible_distribution}

- name: Set Time Zone
  hosts: Ubuntu
  gather_facts: False
  tasks:
    - name: Set timezone variables
      copy: content='America/Los_Angeles'
            dest=/etc/timezone
            owner=root
            group=root
            mode=0644
            backup=yes
      notify:
        - update timezone
  handlers:
    - name: update timezone
      command: dpkg-reconfigure --frontend noninteractive tzdata

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote