|
350 | 350 | msg: logstash user password must be at least 6 characters long.
|
351 | 351 | when: logstash_user_password | length < 6
|
352 | 352 |
|
353 |
| -- name: Set password hash salt as a fact |
354 |
| - ansible.builtin.set_fact: |
355 |
| - logstash_password_hash_salt: "{{ lookup('password', '/dev/null', chars=['ascii_lowercase', 'digits'], length=logstash_password_hash_salt_length, seed=logstash_password_hash_salt_seed) }}" |
356 |
| - when: logstash_password_hash | bool and inventory_hostname == elasticstack_ca |
357 |
| - |
358 | 353 | - name: Fetch Elastic password # noqa: risky-shell-pipe
|
359 | 354 | ansible.builtin.shell: >
|
360 | 355 | if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
|
|
368 | 363 | - configuration
|
369 | 364 | - logstash_configuration
|
370 | 365 |
|
371 |
| -- name: Set elasticsearch security-api base url for elasticsearch > 7 |
372 |
| - ansible.builtin.set_fact: |
373 |
| - security_api_base_url: "https://{{ hostvars[elasticstack_ca].ansible_default_ipv4.address }}:{{ elasticstack_elasticsearch_http_port }}/_security/" |
374 |
| - when: elasticstack_release | int > 7 |
375 |
| - |
376 |
| -- name: Set elasticsearch security-api base url for elasticsearch < 8 |
377 |
| - ansible.builtin.set_fact: |
378 |
| - security_api_base_url: "https://{{ hostvars[elasticstack_ca].ansible_default_ipv4.address }}:{{ elasticstack_elasticsearch_http_port }}/_xpack/security/" |
379 |
| - when: elasticstack_release | int < 8 |
380 |
| - |
381 | 366 | - name: Create logstash role {{ logstash_role_name }}
|
382 | 367 | netways.elasticstack.elasticsearch_role:
|
383 | 368 | name: "{{ logstash_role_name }}"
|
|
386 | 371 | - names: "{{ logstash_role_indicies_names }}"
|
387 | 372 | privileges: "{{ logstash_role_indicies_privileges }}"
|
388 | 373 | state: present
|
389 |
| - host: https://localhost:9200 |
| 374 | + host: "https://{{ hostvars[elasticstack_ca].ansible_default_ipv4.address }}:{{ elasticstack_elasticsearch_http_port }}" |
390 | 375 | auth_user: elastic
|
391 | 376 | auth_pass: "{{ logstash_elasticstack_password.stdout }}"
|
392 | 377 | verify_certs: false
|
|
402 | 387 | - "{{ logstash_role_name }}"
|
403 | 388 | enabled: true
|
404 | 389 | state: present
|
405 |
| - host: https://localhost:9200 |
| 390 | + host: "https://{{ hostvars[elasticstack_ca].ansible_default_ipv4.address }}:{{ elasticstack_elasticsearch_http_port }}" |
406 | 391 | auth_user: elastic
|
407 | 392 | auth_pass: "{{ logstash_elasticstack_password.stdout }}"
|
408 | 393 | verify_certs: false
|
0 commit comments