- name: Enable EPEL Repository on CentOS 7 yum: name: epel-release state: latest when: - ansible_os_family == "RedHat" - name: install mariadb-server yum: name: - postgresql-server - python-setuptools - python-psycopg2 state: present update_cache: yes when: - ansible_os_family == "RedHat" - name: Install postgresql apt: name: - postgresql-server - python-setuptools - python-psycopg2 when: - ansible_os_family == "Debian" - name: service: name: postgresql state: started enabled: yes - name: firewalld: port: 5432/tcp permanent: true state: enabled immediate: yes