ansible-collections / community.elastic

http://galaxy.ansible.com/community/elastic
GNU General Public License v3.0
25 stars 10 forks source link
ansible-collection database elastic elasticsearch nosql

community.elastic

CI Build & Publish Collection

This Ansible collection provides modules to work with Elasticsearch instances and clusters.

Installing the official release

ansible-galaxy collection install community.elastic

Installing the latest development version

Both Elasticsearch server version 7 and 8 are supported. But the version of elasticesearch Python library must be aligned with Elasticsearch server.

pip install elasticsearch==7.*  # To connect to Elasticsearch 7.x
pip install elasticsearch==8.*  # To connect to Elasticsearch 8.x
ansible-galaxy collection install https://github.com/ansible-collections/community.elastic/releases/download/latest/community-elastic-latest.tar.gz

Collection Contents

These modules are tested on Debian and RHEL based distributions.

Modules

Running the integration tests

The ansible-test tool requires a specific directory hierarchy to function correctly so please follow carefully. Many of these test make use of docker-compose to launch Elastic Clusters. These tests should be run in a isolated Linux environment.

mkdir -p git/ansible_collections/community
cd git/ansible_collections/community
git clone  https://github.com/ansible-collections/community.elastic.git ./elastic
git clone  https://github.com/ansible-collections/community.general.git ./general
virtualenv venv
source venv/bin/activate
cd elastic
pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check

Please note that most of these integration tests are intended to run directly in GitHUb Actions and running them locally may make changes to the executing computer. You can use the docker flag to avoid that but many of these tests won't work in those conditions.

ansible-test integration -v --color yes --python 3.6 elastic_user
ansible-test integration -v --color yes --python 3.6 elastic_cluster_health
ansible-test integration -v --color yes --python 3.6