---
- name: configure repository mirrors
  command: "reflector --sort score -p https --country '{{ country }}' --save /etc/pacman.d/mirrorlist"

- name: upgrade system to latest state
  pacman:
    update_cache: yes
    upgrade: yes

- import_tasks: locales.yml

- name: configure hostname
  lineinfile:
    path: /etc/hostname
    line: "{{ hostname }}"
    create: yes

- name: set hostname in /etc/hosts file
  template:
    src: hosts.j2
    dest: /etc/hosts
    mode: 644

- name: install base packages
  pacman:
    name: "{{ base_packages }}"

- name: configure console font
  lineinfile:
    path: /etc/vconsole.conf
    line: "FONT=ter-122n"
    create: yes

- import_tasks: user.yml
- import_tasks: network.yml
- import_tasks: bootloader.yml

---
- import_tasks: locales.yml

- name: configure repository mirrors
  command: "reflector --sort score -p https --country '{{ country }}' --save /etc/pacman.d/mirrorlist"

- name: upgrade system to latest state
  pacman:
    update_cache: yes
    upgrade: yes

- name: configure hostname
  lineinfile:
    path: /etc/hostname
    line: "{{ hostname }}"
    create: yes

- name: set hostname in /etc/hosts file
  template:
    src: hosts.j2
    dest: /etc/hosts
    mode: 644

- name: install base packages
  pacman:
    name: "{{ base_packages }}"

- name: configure console font
  lineinfile:
    path: /etc/vconsole.conf
    line: "FONT=ter-122n"
    create: yes

- import_tasks: user.yml
- import_tasks: network.yml
- import_tasks: bootloader.yml

Configure locales first thing in chroot
Configure locales first thing in chroot
