From 204b6725f8951cb38c2c6684fb4a8098e576cef7 Mon Sep 17 00:00:00 2001 From: Martin Rys Date: Sun, 4 Dec 2022 17:01:50 +0100 Subject: [PATCH] Add support for installing packages on Arch Linux --- tasks/main.yml | 7 +++++-- tasks/setup-Archlinux.yml | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 tasks/setup-Archlinux.yml diff --git a/tasks/main.yml b/tasks/main.yml index 308f38e..ef53122 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,12 +3,15 @@ - include_tasks: variables.yml # Setup/install tasks. -- include_tasks: setup-RedHat.yml - when: ansible_os_family == 'RedHat' +- include_tasks: setup-Archlinux.yml + when: ansible_os_family == 'Archlinux' - include_tasks: setup-Debian.yml when: ansible_os_family == 'Debian' +- include_tasks: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + - include_tasks: initialize.yml - include_tasks: configure.yml diff --git a/tasks/setup-Archlinux.yml b/tasks/setup-Archlinux.yml new file mode 100644 index 0000000..6b8fe6e --- /dev/null +++ b/tasks/setup-Archlinux.yml @@ -0,0 +1,21 @@ +--- +- name: Ensure PostgreSQL Python libraries are installed. + pacman: + name: "{{ postgresql_python_library }}" + state: present + +- name: Ensure PostgreSQL packages are installed. + pacman: + name: "{{ postgresql_packages }}" + state: present + +- name: Ensure all configured locales are present. + locale_gen: "name={{ item }} state=present" + with_items: "{{ postgresql_locales }}" + register: locale_gen_result + +- name: Force-restart PostgreSQL after new locales are generated. + systemd: + name: "{{ postgresql_daemon }}" + state: restarted + when: locale_gen_result.changed