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

Now using postgresql_version variable on CentOS 7

parent 2c0cb2f6
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
when: ansible_facts['distribution'] == "Debian" when: ansible_facts['distribution'] == "Debian"
- name: Initialization of ICAT database on CentOS 7 - 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: true
become_user: postgres become_user: postgres
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and stat_result_centos.stat.exists == False) 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: yum:
conf_file: '/etc/yum.conf' conf_file: '/etc/yum.conf'
name: name:
- libselinux-python - libselinux-python
- python-pip - python-pip
- postgresql96 - 'postgresql{{ postgresql_version | replace(".", "") }}'
- postgresql96-server - 'postgresql{{ postgresql_version | replace(".", "") }}-server'
- postgresql96-odbc - 'postgresql{{ postgresql_version | replace(".", "") }}-odbc'
state: present state: present
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7") when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- name: Set PGDATA environment variable on CentOS 7 - name: Set PGDATA environment variable on CentOS 7
lineinfile: lineinfile:
path: /usr/lib/systemd/system/postgresql-9.6.service path: /usr/lib/systemd/system/postgresql-{{ postgresql_version }}.service
regexp: '^Environment=PGDATA=' regexp: '^Environment=PGDATA='
line: 'Environment=PGDATA={{path_to_icat}}' line: 'Environment=PGDATA={{path_to_icat}}'
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7") when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
- name: Start postgresql-9.6 service on CentOS 7 - name: Start postgresql-9.6 service on CentOS 7
systemd: systemd:
name: postgresql-9.6 name: postgresql-{{ postgresql_version }}
state: started state: started
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes
......
Supports Markdown
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