common: refactor

This commit is contained in:
2022-09-01 17:12:52 -05:00
parent 4b581b8a78
commit 42ba49c865
4 changed files with 19 additions and 17 deletions

View File

@ -1,6 +1,6 @@
---
- name: run apt-get update
apt:
update_cache: yes
cache_valid_time: 3600
ansible.builtin.apt:
update_cache: "{{ common_apt_update_cache | default(true) }}"
cache_valid_time: "{{ common_apt_cache_valid_time | default(3600) }}"
changed_when: false

View File

@ -24,12 +24,17 @@
- tasks
- name: set hostname
hostname:
name: "{{ hostname | default(inventory_hostname) }}"
ansible.builtin.hostname:
name: "{{ common_hostname | default(inventory_hostname) }}"
- name: configure system timezone
timezone:
name: "{{ timezone }}"
ansible.builtin.timezone:
name: "{{ common_timezone | default('Etc/UTC') }}"
notify: restart cron
- name: configure system locale
ansible.builtin.command:
cmd: "localectl set-locale {{ common_locale | default('C.UTF-8') }}"
when: ansible_facts.env.LANG != (common_locale | default('C.UTF-8'))
# vim:ft=yaml.ansible: