Add task to create a custom user

This commit is contained in:
Jose M 2020-06-25 11:39:02 +02:00
parent d1a08c1a3f
commit 9bedd8ad95
No known key found for this signature in database
GPG Key ID: 790179D6924E10FF

View File

@ -96,6 +96,26 @@
-h {{ hostvars[od_node_name]['ip'] }}
run_once: true
- name: Create custom user
uri:
url: "https://{{ inventory_hostname }}:9200/_cluster/health/"
method: PUT
user: "admin" # Default OpenDistro user is always "admin"
password: "{{ opendistro_admin_password }}"
body: |
{
"password": "{{ opendistro_admin_password }}",
"backend_roles": ["{{ opendistro_custom_user_role }}"],
}
}
body_format: json
validate_certs: no
status_code: 200,401
return_content: yes
timeout: 4
when:
- opendistro_custom_user != ""
tags:
- security
when: install.changed