Skip to content

Commit

Permalink
ansible-ckan-role (#10): ansible/playbooks/postgresql.yml added
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Apr 19, 2020
1 parent 954cf42 commit 6521838
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 75 deletions.
4 changes: 4 additions & 0 deletions ansible/inventories/etica.dev/hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ all:
# Ubuntu 18.04, you can explicitly force the pip package and pip executable:
pip_package: "python3-pip"
pip_executable: "pip3"

# @see https://github.com/geerlingguy/ansible-role-postgresql
# We're using python 3 on the host, but the default is python-psycopg2
postgresql_python_library: python3-psycopg2
1 change: 1 addition & 0 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
- import_playbook: playbooks/traefik.yml
- import_playbook: playbooks/docker-setup-host.yml
- import_playbook: playbooks/docker-full-stack-start.yml
- import_playbook: playbooks/postgresql.yml
11 changes: 11 additions & 0 deletions ansible/playbooks/ckan-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# FILE: playbooks/ckan-setup.yml
# LICENSE: Public Domain
# DESCRIPTION: Install CKAN on the host
#
# REQUIES: roles/ckan (already on this project)
# ansible-playbook -i inventories/etica.dev playbooks/ckan-setup.yml

- hosts: all
roles:
- ckan
12 changes: 12 additions & 0 deletions ansible/playbooks/postgresql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# FILE: playbooks/postgresql.yml
# LICENSE: Public Domain
# DESCRIPTION: Install postgresql on the host.
# It's used by CKAN. You can skip this playbook
# SEE: https://github.com/geerlingguy/ansible-role-postgresql

# ansible-playbook -i inventories/etica.dev playbooks/postgresql.yml

- hosts: all
roles:
- geerlingguy.postgresql
6 changes: 5 additions & 1 deletion ansible/playbooks/roles/ckan/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
---
# defaults file for ckan
# defaults file for ckan

# This is how the package was created https://github.com/ckan/ckan-packaging/blob/master/package.yml
ckan_package: "python-ckan_2.8-bionic_amd64.deb"
ckan_package_url: "http://packaging.ckan.org/{{ ckan_package }}"
44 changes: 8 additions & 36 deletions ansible/playbooks/roles/ckan/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,15 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker

# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
author: "Emerson Rocha <rocha(at)ieee.org>"
description: CKAN for Ubuntu 18.04
company: Etica.AI
license: Unlicense

min_ansible_version: 2.9

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: Ubuntu
versions:
- bionic

galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
Expand Down
7 changes: 7 additions & 0 deletions ansible/playbooks/roles/ckan/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# FILE: playbooks/roles/ckan/tasks/install.yml
# LICENSE: Public Domain

- name: "CKAN | Install {{ ckan_package_url }}"
apt:
deb: "{{ ckan_package_url }}"
27 changes: 26 additions & 1 deletion ansible/playbooks/roles/ckan/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
---
# tasks file for ckan
# FILE: playbooks/roles/ckan/tasks/main.yml
# LICENSE: Public Domain
# SEE: https://docs.ckan.org/en/2.8/maintaining/installing/install-from-package.html
# SEE: https://docs.ckan.org/en/2.8/maintaining/installing/install-from-source.html

- name: Ubuntu?
fail:
msg: "This role as designed to only Ubuntu 18.04. Please look for other alternatives"
when: ansible_distribution != 'Ubuntu'

# # SEE http://packaging.ckan.org/
# - name: "ping all"
# ping:
# data: pong

# - name: "Check if {{ traefik_install_base }}traefik exists"
# stat:
# path: "{{ traefik_install_base }}traefik"
# register: stat_result

# - debug: var=stat_result

- name: "install.yml"
include: install.yml
# when:
# - "(not stat_result.stat.exists) or (traefik_force_reinstall|bool)"
41 changes: 4 additions & 37 deletions ansible/playbooks/roles/traefik/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker

# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
author: "Emerson Rocha <rocha(at)ieee.org>"
description: Traefik
company: Etica.AI
license: Unlicense

min_ansible_version: 2.9

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99

galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
Expand Down
4 changes: 4 additions & 0 deletions ansible/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
# https://github.com/geerlingguy/ansible-role-pip
- src: geerlingguy.pip
# Tested with v1.3.0, 2018-11-10

# https://github.com/geerlingguy/ansible-role-postgresql
- src: geerlingguy.postgresql
# Tested with v2.2.0, 2020-03-20

0 comments on commit 6521838

Please sign in to comment.