Просмотр исходного кода

Stop Postgres before finding files to move over

pull/74/head
Slavi Pantaleev 7 лет назад
Родитель
Сommit
b80d44afaa
1 измененных файлов: 9 добавлений и 7 удалений
  1. +9
    -7
      roles/matrix-postgres/tasks/migrate_postgres_data_directory.yml

+ 9
- 7
roles/matrix-postgres/tasks/migrate_postgres_data_directory.yml Просмотреть файл

@@ -23,6 +23,15 @@
We'll stop Postgres and relocate the files there for you.
when: "result_pg_old_data_dir_stat.stat.exists"

# We should stop Postgres first, before building a list of files,
# as to ignore any `postmaster.pid` files, etc.
- name: Ensure matrix-postgres is stopped
service:
name: matrix-postgres
state: stopped
daemon_reload: yes
when: "result_pg_old_data_dir_stat.stat.exists"

- name: Find files and directories in old Postgres data path
find:
paths: "{{ matrix_postgres_base_path }}"
@@ -40,13 +49,6 @@
group: "{{ matrix_user_username }}"
when: "result_pg_old_data_dir_stat.stat.exists"

- name: Ensure matrix-postgres is stopped
service:
name: matrix-postgres
state: stopped
daemon_reload: yes
when: "result_pg_old_data_dir_stat.stat.exists"

- block:
- name: Relocate Postgres data files from old directory to new
command: "mv {{ item.path }} {{ matrix_postgres_data_path }}/{{ item.path|basename }}"


Загрузка…
Отмена
Сохранить