Last active
November 18, 2020 13:00
-
-
Save madrobby/9628514 to your computer and use it in GitHub Desktop.
Ansible actions to install a PostgreSQL 9.3 database server on Ubuntu 12.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Add PostgreSQL repository | |
apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' state=present | |
sudo: yes | |
- name: Add PostgreSQL repository key | |
apt_key: url=https://www.postgresql.org/media/keys/ACCC4CF8.asc state=present | |
sudo: yes | |
- name: Update apt cache | |
apt: update_cache=yes | |
sudo: yes | |
# locale stuff forces installation to use UTF-8 | |
- name: Install PostgreSQL server | |
shell: > | |
LANG={{ locale }} LC_COLLATE={{ locale }} LC_CTYPE={{ locale }} | |
LC_MESSAGES={{ locale }} LC_MONETARY={{ locale }} | |
LC_NUMERIC={{ locale }} LC_TIME={{ locale }} | |
LC_ALL={{ locale }} | |
apt-get install -y postgresql-9.3 | |
sudo: yes | |
- name: Install PostgreSQL development library | |
apt: pkg=libpq-dev state=present | |
sudo: yes | |
- name: Restart postgresql server | |
service: name=postgresql state=started enabled=yes | |
sudo: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice, thanks...helped out a lot!