From f6046f9b54c1f14d12a67fa66ca0c881b49e8ceb Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 7 Jul 2017 10:01:07 +0000 Subject: Move old Baserock format definitions into old/ directory --- .../openstack/usr/share/openstack/postgres.yml | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 old/install-files/openstack/usr/share/openstack/postgres.yml (limited to 'old/install-files/openstack/usr/share/openstack/postgres.yml') diff --git a/old/install-files/openstack/usr/share/openstack/postgres.yml b/old/install-files/openstack/usr/share/openstack/postgres.yml new file mode 100644 index 00000000..5ff9355e --- /dev/null +++ b/old/install-files/openstack/usr/share/openstack/postgres.yml @@ -0,0 +1,48 @@ +--- +- hosts: localhost + vars_files: + - "/etc/openstack/postgres.conf" + tasks: + + - name: Create postgres user + user: + name: postgres + comment: PostgreSQL Server + shell: /sbin/nologin + home: /var/lib/pgsql + + - name: Create the postgres directories + file: + path: "{{ item }}" + state: directory + owner: postgres + group: postgres + with_items: + - /var/run/postgresql + - /var/lib/pgsql/data + + - name: Initialise postgres database + command: pg_ctl -D /var/lib/pgsql/data initdb + args: + creates: /var/lib/pgsql/data/base + sudo: yes + sudo_user: postgres + + - name: Add the configuration needed for postgres for Openstack + template: + src: /usr/share/openstack/postgres/{{ item }} + dest: /var/lib/pgsql/data/{{ item }} + owner: postgres + group: postgres + mode: 0600 + with_items: + - postgresql.conf + - pg_hba.conf + + - name: Enable and start postgres services + service: + name: "{{ item }}" + enabled: yes + state: started + with_items: + - postgres-server -- cgit v1.2.1