test: use personal docker registry

This commit is contained in:
Adrien Waksberg 2024-05-07 14:18:18 +02:00
parent 5c17df22bf
commit 6aefa90eaa
3 changed files with 56 additions and 57 deletions

View file

@ -24,6 +24,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
- major default version is 8
- replace kitchen to molecule
- replace apt_key to get_url
- test: use personal docker registry
### Fixed

108
README.md
View file

@ -1,81 +1,81 @@
# Ansible role: Elasticsearch
[![Version](https://img.shields.io/badge/latest_version-1.1.0-green.svg)](https://git.yaegashi.fr/nishiki/ansible-role-elasticsearch/releases)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/ansible-role-elasticsearch/src/branch/master/LICENSE)
[![Version](https://img.shields.io/badge/latest_version-1.1.0-green.svg)](https://code.waks.be/nishiki/ansible-role-elasticsearch/releases)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://code.waks.be/nishiki/ansible-role-elasticsearch/src/branch/main/LICENSE)
Install and configure Elasticsearch
## Requirements
* Ansible >= 2.9
* Debian
* Bookworm
- Ansible >= 2.9
- Debian
- Bookworm
## Role variables
* `elasticsearch_major_version` - set the major version (default: `7`)
* `elasticsearch_master` - set if the node is master (default: `true`)
* `elasticsearch_heap_size` - set the heap size (default: `1g`)
* `elasticsearch_api_user` - set the admin user (default: `elastic`)
* `elasticsearch_api_password` - set the password for api
* `elasticsearch_config` - hash with the configuration (see [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html))
- `elasticsearch_major_version` - set the major version (default: `7`)
- `elasticsearch_master` - set if the node is master (default: `true`)
- `elasticsearch_heap_size` - set the heap size (default: `1g`)
- `elasticsearch_api_user` - set the admin user (default: `elastic`)
- `elasticsearch_api_password` - set the password for api
- `elasticsearch_config` - hash with the configuration (see [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html))
```yaml
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
```
* `elasticsearch_ssl_key`: - string contain ssl private key if `xpack.security.transport.ssl.key` is defined in elasticsearch_config
* `elasticsearch_ssl_certificate`: - string contain ssl certificate if `xpack.security.transport.certificate.key` is defined in elasticsearch_config
* `elasticsearch_roles` - hash with the roles to managed
- `elasticsearch_ssl_key`: - string contain ssl private key if `xpack.security.transport.ssl.key` is defined in elasticsearch_config
- `elasticsearch_ssl_certificate`: - string contain ssl certificate if `xpack.security.transport.certificate.key` is defined in elasticsearch_config
- `elasticsearch_roles` - hash with the roles to managed
```yaml
myrole:
cluster:
- all
indices:
- names: ["logstash*"]
privileges:
- create
- write
myrole:
cluster:
- all
indices:
- names: ["logstash*"]
privileges:
- create
- write
```
* `elasticsearch_users` - hash with the users to managed
- `elasticsearch_users` - hash with the users to managed
```yaml
toto:
password: supers3cret
roles:
- viewer
kibana_system:
password: supertest2
toto:
password: supers3cret
roles:
- viewer
kibana_system:
password: supertest2
```
* `elasticsearch_index_templates` - hash with the index templates configuration
- `elasticsearch_index_templates` - hash with the index templates configuration
```yaml
logstash:
index_patterns:
- 'logstash-*'
settings:
index:
number_of_replicas: 3
mappings:
metric:
type: short
date:
type: date
format: YYYY-MM-dd
logstash:
index_patterns:
- "logstash-*"
settings:
index:
number_of_replicas: 3
mappings:
metric:
type: short
date:
type: date
format: YYYY-MM-dd
```
* `elasticsearch_ilm_policies` - hash with the ilm policies configuration
- `elasticsearch_ilm_policies` - hash with the ilm policies configuration
```yaml
autoclean:
delete:
min_age: 30d
actions:
delete: {}
autoclean:
delete:
min_age: 30d
actions:
delete: {}
```
## How to use
@ -90,10 +90,10 @@ Install and configure Elasticsearch
### Test with molecule and docker
* install [docker](https://docs.docker.com/engine/installation/)
* install `python3` and `python3-pip`
* install molecule and dependencies `pip3 install molecule 'molecule[docker]' ansible-lint testinfra yamllint`
* run `molecule test`
- install [docker](https://docs.docker.com/engine/installation/)
- install `python3` and `python3-pip`
- install molecule and dependencies `pip3 install molecule 'molecule[docker]' ansible-lint testinfra yamllint`
- run `molecule test`
## License

View file

@ -3,7 +3,7 @@ driver:
name: docker
platforms:
- name: debian12
image: nishiki/debian12:molecule
image: code.waks.be/nishiki/molecule:debian12
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
@ -11,8 +11,6 @@ platforms:
command: /bin/systemd
capabilities:
- SYS_ADMIN
published_ports:
- 127.0.0.1:5601:5601
lint: |
set -e
yamllint .