Skip to content

Commit b911bf1

Browse files
committed
Initial commit
0 parents  commit b911bf1

File tree

8 files changed

+111
-0
lines changed

8 files changed

+111
-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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
postgresql_client_version: "9.6"
3+
4+
postgresql_client_repo: "deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main"
5+
postgresql_client_repo_key: "https://www.postgresql.org/media/keys/ACCC4CF8.asc"
6+
7+
postgresql_client_apt_pin_priority: 550

meta/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
galaxy_info:
2+
author: Eugene Ignatov
3+
description: install postgresql-client package
4+
company: Cimon.io
5+
license: MIT
6+
7+
min_ansible_version: 2.0
8+
9+
platforms:
10+
- name: Ubuntu
11+
versions:
12+
- all
13+
- name: Debian
14+
versions:
15+
- all
16+
17+
galaxy_tags:
18+
- postgresql-client
19+
20+
dependencies: []

tasks/main.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
- name: "add postgresql gpg key"
3+
apt_key:
4+
url: "{{ postgresql_client_repo_key }}"
5+
state: present
6+
tags:
7+
- postgresql-client
8+
9+
- name: "add postgresql repository"
10+
apt_repository:
11+
repo: "{{ postgresql_client_repo }}"
12+
state: present
13+
tags:
14+
- postgresql-client
15+
16+
- name: "pin postgresql-client package"
17+
template:
18+
src: "etc/apt/preferences.d/pgsql.pref.j2"
19+
dest: "/etc/apt/preferences.d/pgsql.pref"
20+
owner: root
21+
tags:
22+
- postgresql-client
23+
24+
- name: "install postgresql-client"
25+
apt:
26+
name: "postgresql-client-{{ postgresql_client_version }}"
27+
state: present
28+
update_cache: yes
29+
cache_valid_time: "{{ apt_cache_valid_time }}"
30+
tags:
31+
- postgresql-client
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# {{ ansible_managed }}
2+
3+
Package: postgresql-client
4+
Pin: release o=apt.postgresql.org, version {{ postgresql_client_version }}*
5+
Pin-Priority: {{ postgresql_client_apt_pin_priority }}

tests/inventory

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
localhost
2+

tests/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
- hosts: localhost
3+
roles:
4+
- postgresql-client

vars/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
apt_cache_valid_time: 86400
3+
4+
ansible_become: yes

0 commit comments

Comments
 (0)