From 076e0609432af4d5a0a20758d9d5ce6817d4b745 Mon Sep 17 00:00:00 2001 From: Blallo Date: Tue, 23 Feb 2021 18:56:01 +0100 Subject: [PATCH] Init --- tasks/main.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ templates/locale.gen.j2 | 3 +++ vars/main.yaml | 14 ++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 tasks/main.yaml create mode 100644 templates/locale.gen.j2 create mode 100644 vars/main.yaml diff --git a/tasks/main.yaml b/tasks/main.yaml new file mode 100644 index 0000000..b1a72f2 --- /dev/null +++ b/tasks/main.yaml @@ -0,0 +1,40 @@ +--- +- name: Upgrade distro + apt: update_cache=yes upgrade=yes cache_valid_time=1800 + tags: never + +- name: Show current host's hostname (from inventory) + debug: var=inventory_hostname + +- name: Set hostname + hostname: + name: "{{ inventory_hostname }}" + +- name: Install base pkgs + apt: + name: "{{ base_pkgs }}" + state: present + +- name: Set Europe/Rome timezone + timezone: + name: Europe/Rome + +- name: Ensure fd link exists + file: + src: /usr/bin/fdfind + dest: /usr/local/bin/fd + state: link + +- name: Ensure locale.get is populated with the wanted locales + template: + src: locale.gen.j2 + dest: /etc/locale.gen + mode: 0644 + owner: root + group: root + +- name: Build locales + locale_gen: + name: "{{ item.name }}" + state: present + loop: "{{ base_locales }}" diff --git a/templates/locale.gen.j2 b/templates/locale.gen.j2 new file mode 100644 index 0000000..0634029 --- /dev/null +++ b/templates/locale.gen.j2 @@ -0,0 +1,3 @@ +{% for locale in base_locales %} +{{ locale.name }} {{ locale.type }} +{% endfor %} diff --git a/vars/main.yaml b/vars/main.yaml new file mode 100644 index 0000000..e36fbda --- /dev/null +++ b/vars/main.yaml @@ -0,0 +1,14 @@ +--- +base_pkgs: + - zsh + - curl + - htop + - tmux + - vim + - git + - ripgrep + - fd-find + - mosh + - locales +base_locales: + - {name: "en_US.UTF-8", type: "UTF-8"}