1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Update main.yml

This commit is contained in:
A Holt 2018-10-31 03:22:27 -04:00 committed by GitHub
parent cbd7c5c03f
commit 4d9d184f36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@
tags: tags:
- download - download
- name: Create postgresql-iiab systemd service - name: Install /etc/systemd/system/postgresql-iiab.service from template
template: template:
src: postgresql-iiab.service src: postgresql-iiab.service
dest: /etc/systemd/system/postgresql-iiab.service dest: /etc/systemd/system/postgresql-iiab.service
@ -29,7 +29,7 @@
group: root group: root
mode: 0644 mode: 0644
- name: Create postgres data directory - name: Create PostgreSQL data dir /library/pgsql-iiab, owned by postgres:postgres
file: file:
path: /library/pgsql-iiab path: /library/pgsql-iiab
owner: postgres owner: postgres
@ -37,17 +37,17 @@
mode: 0700 mode: 0700
state: directory state: directory
- name: Make sure that the en_US locale is enabled (debuntu) - name: Make sure locale {{ postgresql_locale }} is enabled (debuntu) # en_US.UTF-8
lineinfile: lineinfile:
dest: /etc/locale.gen dest: /etc/locale.gen
line: "{{ postgresql_locale }} UTF-8" line: "{{ postgresql_locale }} UTF-8"
when: is_debuntu when: is_debuntu
- name: Generate the selected locales (debuntu) - name: Generate locales (debuntu)
command: /usr/sbin/locale-gen command: /usr/sbin/locale-gen
when: is_debuntu when: is_debuntu
- name: Initialize the postgres db (debuntu) - name: Initialize the PostgreSQL db, creating /library/pgsql-iiab/pg_hba.conf (debuntu)
#command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab" #command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab"
command: /usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab command: /usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab
args: args:
@ -56,7 +56,7 @@
become_user: postgres become_user: postgres
when: is_debuntu when: is_debuntu
- name: Initialize the postgres db (OS's other than debuntu) - name: Initialize the PostgreSQL db, creating /library/pgsql-iiab/pg_hba.conf (OS's other than debuntu)
#command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab" #command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab"
command: /usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab command: /usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab
args: args:
@ -65,7 +65,7 @@
become_user: postgres become_user: postgres
when: not is_debuntu when: not is_debuntu
- name: Configure PostgreSQL - name: Install /library/pgsql-iiab/postgresql.conf owned by postgres:postgres, from template
template: template:
backup: yes backup: yes
src: postgresql.conf.j2 src: postgresql.conf.j2
@ -74,34 +74,35 @@
group: postgres group: postgres
mode: 0640 mode: 0640
- name: Stop postgresql service (debuntu) # Probably Not Nec! Given stanza below does the same.
- name: 'Stop postgresql service: /etc/init.d/postgresql stop (debuntu)'
command: "/etc/init.d/postgresql stop" command: "/etc/init.d/postgresql stop"
ignore_errors: True ignore_errors: True
when: postgresql_install and is_debuntu when: postgresql_install and is_debuntu
- name: Stop and disable stock postgresql service - name: Disable stock postgresql service
service: systemd:
name: postgresql name: postgresql
state: stopped state: stopped
enabled: no enabled: no
- name: Start and enable postgresql-iiab service - name: Start & enable postgresql-iiab systemd service, if postgresql_enabled
service: systemd:
name: postgresql-iiab name: postgresql-iiab
state: started state: started
enabled: yes enabled: yes
when: postgresql_enabled when: postgresql_enabled
- name: Stop and disable postgresql-iiab service if not postgresql_enabled - name: Disable postgresql-iiab service, if not postgresql_enabled
service: systemd:
name: postgresql-iiab name: postgresql-iiab
state: stopped state: stopped
enabled: no enabled: no
when: not postgresql_enabled when: not postgresql_enabled
- name: Add 'postgresql' to list of services at {{ iiab_ini_file }} - name: Add 'postgresql' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: postgresql section: postgresql
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"