Configure system timezone with Ansible collection
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
vars_files:
|
||||
- vars/vault.yml
|
||||
- vars/main.yml
|
||||
connection: local
|
||||
become: yes
|
||||
|
||||
@@ -11,6 +13,8 @@
|
||||
changed_when: False
|
||||
|
||||
tasks:
|
||||
- include_tasks: tasks/collections.yml
|
||||
- include_tasks: tasks/timezone.yml
|
||||
- include_tasks: tasks/users.yml
|
||||
- include_tasks: tasks/cron.yml
|
||||
- include_tasks: tasks/packages.yml
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Check whether community.general is installed
|
||||
ansible.builtin.command:
|
||||
cmd: ansible-galaxy collection list community.general
|
||||
register: collection_list
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Install community.general collection
|
||||
ansible.builtin.command:
|
||||
cmd: ansible-galaxy collection install community.general
|
||||
when: collection_list.rc != 0 or
|
||||
'community.general' not in collection_list.stdout
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Create .bashrc.d directory
|
||||
file:
|
||||
path: /home/robert/.bashrc.d
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: install cron job (ansible-pull)
|
||||
cron:
|
||||
user: root
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Install packages
|
||||
apt:
|
||||
name:
|
||||
@@ -8,4 +9,4 @@
|
||||
- fzf
|
||||
- tree
|
||||
- duf
|
||||
- sudo
|
||||
- sudo
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
- name: Set system time zone
|
||||
community.general.timezone:
|
||||
name: "{{ system_timezone }}"
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Check if robert user exists
|
||||
getent:
|
||||
database: passwd
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
system_timezone: America/Denver
|
||||
Reference in New Issue
Block a user