add install task

This commit is contained in:
Robert Kaussow 2018-10-15 00:11:01 +02:00
parent 132582b201
commit 3cb7c49f6c
2 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,11 @@
---
- block:
- name: Install PostgreSQL
package:
name: "{{ item }}"
state: present
with_items:
- "{{ postgres_packagename }}"
- "{{ postgres_packagename }}-server"
become: True
become_user: root

View File

@ -11,7 +11,10 @@
gpgkey: "https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-{{ postgres_version }}"
- set_fact:
postgres_packagename: "postgresql{{ postgres_version | regex_replace('\\.') }}-server"
postgres_packagename: "postgresql{{ postgres_version | regex_replace('\\.') }}"
- debug:
msg: "Set PostgreSQL package name to '{{ postgres_packagename }}'"
become: True
become_user: root
when: postgres_repository_enabled