Commit 16c88369 authored by viscapi's avatar viscapi
Browse files

Now using postgresql_version variable on CentOS 7

parent 2c0cb2f6
......@@ -13,7 +13,7 @@
when: ansible_facts['distribution'] == "Debian"
- name: Initialization of ICAT database on CentOS 7
command: /usr/pgsql-9.6/bin/initdb -D {{path_to_icat}}
command: /usr/pgsql-{{ postgresql_version }}/bin/initdb -D {{path_to_icat}}
become: true
become_user: postgres
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and stat_result_centos.stat.exists == False)
......
---
- name: Install PostgreSQL 9.6 packages for CentOS 7
- name: Print PostgreSQL version
debug:
msg: '{{ postgresql_version | replace(".", "") }}'
- name: Install PostgreSQL "{{ postgresql_version }}" packages for CentOS 7
yum:
conf_file: '/etc/yum.conf'
name:
- libselinux-python
- python-pip
- postgresql96
- postgresql96-server
- postgresql96-odbc
- 'postgresql{{ postgresql_version | replace(".", "") }}'
- 'postgresql{{ postgresql_version | replace(".", "") }}-server'
- 'postgresql{{ postgresql_version | replace(".", "") }}-odbc'
state: present
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
......
......@@ -2,7 +2,7 @@
- name: Set PGDATA environment variable on CentOS 7
lineinfile:
path: /usr/lib/systemd/system/postgresql-9.6.service
path: /usr/lib/systemd/system/postgresql-{{ postgresql_version }}.service
regexp: '^Environment=PGDATA='
line: 'Environment=PGDATA={{path_to_icat}}'
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
......@@ -16,7 +16,7 @@
- name: Start postgresql-9.6 service on CentOS 7
systemd:
name: postgresql-9.6
name: postgresql-{{ postgresql_version }}
state: started
daemon_reload: yes
enabled: yes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment