fix task order and add test data folder

This commit is contained in:
Robert Kaussow 2018-10-16 00:16:50 +02:00
parent 46362eabf3
commit e7267cf2b5
3 changed files with 12 additions and 12 deletions

View File

@ -20,5 +20,16 @@
dest: "/etc/systemd/system/{{ __postgres_daemon }}.service" dest: "/etc/systemd/system/{{ __postgres_daemon }}.service"
mode: 0644 mode: 0644
notify: __postgres_restart notify: __postgres_restart
- name: Check if database is initialized
stat:
path: "{{ postgresql_data_dir }}/PG_VERSION"
register: pgdata_dir_version
- name: Ensure database is initialized
command: "/usr/pgsql-{{ __postgres_version }}/bin/postgresql-{{ __postgres_version }}-setup initdb"
when: not pgdata_dir_version.stat.exists
become: true
become_user: "{{ postgres_user }}"
become: True become: True
become_user: root become_user: root

View File

@ -6,14 +6,3 @@
enabled: yes enabled: yes
become: True become: True
become_user: root become_user: root
- name: Check if database is initialized
stat:
path: "{{ postgresql_data_dir }}/PG_VERSION"
register: pgdata_dir_version
- name: Ensure database is initialized
command: "/usr/pgsql-{{ __postgres_version }}/bin/postgresql-{{ __postgres_version }}-setup initdb"
when: not pgdata_dir_version.stat.exists
become: true
become_user: "{{ postgres_user }}"

View File

@ -6,5 +6,5 @@ __postgres_service_file: "/usr/lib/systemd/system/{{ __postgres_daemon }}.servic
__postgres_packages: __postgres_packages:
- "{{ __postgres_packagename }}" - "{{ __postgres_packagename }}"
- "{{ __postgres_packagename }}-server" - "{{ __postgres_packagename }}-server"
__postgres_data_dir: "/var/lib/pgsql/{{ __postgres_version }}/data" __postgres_data_dir: "/var/lib/pgsql/{{ __postgres_version }}/test/data"
__postgres_config_path: "/var/lib/pgsql/data" __postgres_config_path: "/var/lib/pgsql/data"