mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-17 02:13:06 -06:00
DCD-1123: Add role to install Postgres server.
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: linux_common
|
- role: linux_common
|
||||||
- role: aws_common
|
- role: aws_common
|
||||||
|
- role: postgres_install
|
||||||
|
|
||||||
# - role: aws_shared_fs_config
|
# - role: aws_shared_fs_config
|
||||||
# - role: product_common
|
# - role: product_common
|
||||||
|
|||||||
4
roles/postgres_install/defaults/main.yml
Normal file
4
roles/postgres_install/defaults/main.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
postgres_version: "9.6"
|
||||||
|
postgres_version_short: "96"
|
||||||
27
roles/postgres_install/tasks/amazon.yml
Normal file
27
roles/postgres_install/tasks/amazon.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Add the official Postgres repo
|
||||||
|
yum_repository:
|
||||||
|
name: "postgres"
|
||||||
|
description: "Official PostgreSQL {{ postgres_version }}"
|
||||||
|
baseurl: "https://download.postgresql.org/pub/repos/yum/{{ postgres_version }}/redhat/rhel-7-x86_64"
|
||||||
|
gpgcheck: false
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
- name: Install Postgres package
|
||||||
|
yum:
|
||||||
|
name:
|
||||||
|
- "postgresql{{ postgres_version_short }}"
|
||||||
|
- "postgresql{{ postgres_version_short }}-server"
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
|
- name: Initialise database
|
||||||
|
command:
|
||||||
|
cmd: "/usr/pgsql-{{ postgres_version }}/bin/postgresql{{ postgres_version_short }}-setup initdb"
|
||||||
|
creates: "/var/lib/pgsql/{{ postgres_version }}/data/"
|
||||||
|
|
||||||
|
- name: Start Postgres server
|
||||||
|
service:
|
||||||
|
name: "postgresql-{{ postgres_version }}.service"
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
4
roles/postgres_install/tasks/main.yml
Normal file
4
roles/postgres_install/tasks/main.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Install distro-specific prerequisites
|
||||||
|
include_tasks: "{{ ansible_distribution|lower }}.yml"
|
||||||
Reference in New Issue
Block a user