Add new simple role for ElasticSearch

parent 3dfc72dd
......@@ -137,3 +137,17 @@ molecule-role-php-fpm:
only:
changes:
- roles/php-fpm/**/*
molecule-role-elasticsearch:
stage: tests
tags:
- docker
variables:
DOCKER_HOST: "tcp://docker:2375"
PY_COLORS: 1
script:
- cd roles/elasticsearch/
- molecule test
only:
changes:
- roles/elasticsearch/**/*
extends: default
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
line-length: disable
# NOTE(retr0h): Templates no longer fail this lint rule.
# Uncomment if running old Molecule templates.
# truthy: disable
Package: elasticsearch
Pin-Priority: 999
Pin: release o=elastic,a=stable,l=. stable,c=main
---
- name: Start ElasticSearch
service:
name: elasticsearch
state: started
---
galaxy_info:
role_name: elasticsearch
description: Install and configure ElasticSearch for the Services FACiLes infrastructure
author: Romain Dessort
company: FACiL
platforms:
- name: Debian
versions:
- stretch
min_ansible_version: 2.7
license: GPLv3
dependencies: []
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: molecule-elasticsearch
image: geerlingguy/docker-debian9-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
lint:
name: ansible-lint
options:
skip-tags: molecule-converge-notest
log: true
scenario:
name: default
---
- name: Converge
hosts: all
roles:
- role: elasticsearch
---
- name: Prepare
hosts: all
tasks:
- name: Install dependencies
apt:
name:
- gnupg
- apt-transport-https
---
- name: Fetch ElasticSearch's GPG public key
apt_key:
url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"
tags: elasticsearch
- name: Add ElasticSearch repository
apt_repository:
filename: elasticsearch
repo: "deb https://artifacts.elastic.co/packages/6.x/apt stable main"
update_cache: true
tags: elasticsearch
- name: Pin elasticsearch package
copy:
src: elasticsearch.pref
dest: /etc/apt/preferences.d/
mode: "0644"
tags: elasticsearch
- name: Install openjdk first (openjdk needs to be installed before ElasticSearch)
apt:
name: openjdk-8-jre-headless
tags: elasticsearch
- name: Install ElasticSearch
apt:
name: elasticsearch
notify: Start ElasticSearch
tags: elasticsearch
- name: Enable elasticsearch.service on boot
systemd:
name: elasticsearch
enabled: true
tags: elasticsearch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment