From eab96f89e4cf0e8d5de0e7f412c22eb8803af192 Mon Sep 17 00:00:00 2001 From: jland Date: Tue, 14 May 2019 13:33:21 -0400 Subject: [PATCH] Removing postgres created folder on cleanup and adding a registered variable example --- cleanup.yml | 12 ++++++++++++ main.yml | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/cleanup.yml b/cleanup.yml index c37588e..e910cda 100644 --- a/cleanup.yml +++ b/cleanup.yml @@ -34,4 +34,16 @@ file: path: /tmp/index.html state: absent + +- name: Cleanup Postgres Data + hosts: appdbs + gather_facts: true + become: true + tasks: + - name: Remove postgres data directory + file: + #Default location for RHEL + path: /var/lib/pgsql + state: absent + ... diff --git a/main.yml b/main.yml index 49e92b5..6a1760b 100644 --- a/main.yml +++ b/main.yml @@ -125,6 +125,12 @@ - name: tell user to finish setting up postgres debug: msg: "Either uncomment the postgres setup or manually login and initialize" + # Version File Created on initdb +# - name: Get Data File info +# stat: +# path: "/var/lib/pgsql/data/PG_VERSION" +# register: pg_version + # only run the next 2 tasks once! # - name: initilize postgres