From 6aefa90eaa17167769259a72c549b62f0b6d8f4c Mon Sep 17 00:00:00 2001
From: Adrien Waksberg <git@waks.be>
Date: Tue, 7 May 2024 14:18:18 +0200
Subject: [PATCH] test: use personal docker registry

---
 CHANGELOG.md                  |   1 +
 README.md                     | 108 +++++++++++++++++-----------------
 molecule/default/molecule.yml |   4 +-
 3 files changed, 56 insertions(+), 57 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e657cb0..d0ad863 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
 
diff --git a/README.md b/README.md
index cd6600b..b45b541 100644
--- a/README.md
+++ b/README.md
@@ -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
 
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
index 71a343e..e73cc9e 100644
--- a/molecule/default/molecule.yml
+++ b/molecule/default/molecule.yml
@@ -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 .