Skip to content

Commit c23bff7

Browse files
author
Roderik van der Veer
committed
first commit
0 parents  commit c23bff7

File tree

6 files changed

+89
-0
lines changed

6 files changed

+89
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Role Name
2+
=========
3+
4+
A brief description of the role goes here.
5+
6+
Requirements
7+
------------
8+
9+
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
10+
11+
Role Variables
12+
--------------
13+
14+
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
15+
16+
Dependencies
17+
------------
18+
19+
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
20+
21+
Example Playbook
22+
----------------
23+
24+
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
25+
26+
- hosts: servers
27+
roles:
28+
- { role: username.rolename, x: 42 }
29+
30+
License
31+
-------
32+
33+
BSD
34+
35+
Author Information
36+
------------------
37+
38+
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# defaults file for ansible-role-postgresql

handlers/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# handlers file for ansible-role-postgresql

meta/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
galaxy_info:
3+
author: Roderik van der Veer
4+
description: Ansible role to setup postgresql
5+
license: MIT
6+
min_ansible_version: 1.2
7+
platforms:
8+
- name: Darwin
9+
versions:
10+
- all
11+
categories:
12+
- system
13+
dependencies:
14+
- homebrew

tasks/main.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# tasks file for ansible-role-postgresql
3+
4+
- name: increase shared memory allocation size
5+
sysctl: name=kern.sysv.shmall value=131072000 state=present
6+
7+
- name: increase shared memory max
8+
sysctl: name=kern.sysv.shmmax value=524288000 state=present
9+
10+
- name: install postgresql
11+
homebrew: name=postgresql state=latest
12+
13+
- name: blow away default image's data directory
14+
file: path=/usr/local/var/postgres state=absent
15+
16+
- name: create the database
17+
shell: /usr/local/bin/initdb -U postgres --encoding=utf8 --locale=en_US /usr/local/var/postgres
18+
19+
- name: install launchagents
20+
file: src=/usr/local/opt/postgresql/homebrew.mxcl.percona-server.plist path=~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist state=link force=yes
21+
22+
- name: check if postgresql is loaded
23+
shell: launchctl list
24+
changed_when: False
25+
register: postgresql_loaded_result
26+
27+
- name: launch mysql
28+
shell: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
29+
when: "'homebrew.mxcl.postgresql' not in postgresql_loaded_result.stdout"
30+
31+
- pause: seconds=5

vars/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# vars file for ansible-role-postgresql

0 commit comments

Comments
 (0)