--- - name: Create a Docker network for Elasticsearch docker_network: name: elk_network state: present - name: Pull Elasticsearch Docker image docker_image: name: docker.elastic.co/elasticsearch/elasticsearch-wolfi:{{ elk_version }} source: pull - name: Create Elasticsearch configuration file directory on host file: path: /etc/elasticsearch state: directory mode: '0755' # - name: Create Elasticsearch configuration file # template: # src: elasticsearch.yml.j2 # dest: /etc/elasticsearch/elasticsearch.yml - name: Start Elasticsearch container docker_container: name: elasticsearch image: docker.elastic.co/elasticsearch/elasticsearch-wolfi:{{ elk_version }} state: started restart: yes restart_policy: unless-stopped published_ports: - "9200:9200" volumes: - /etc/elasticsearch/esdata:/usr/share/elasticsearch/data networks: - name: elk_network ipv4_address: 172.19.0.2 env: node.name: elasticsearch cluster.name: retailor-elk discovery.type: single-node bootstrap.memory_lock: "true" # limits elasticsearch to 2 GB of RAM ES_JAVA_OPTS: "-Xms1g -Xmx2g" # disables SSL & xpack security xpack.security.http.ssl.enabled: "false"