opensearch-project / ansible-playbook

🤖 A community repository for Ansible Playbook of OpenSearch Project.
https://opensearch.org/
Apache License 2.0
81 stars 97 forks source link

[BUG][Security Plugin Configuration] Unecessary user left on internal_users.yml #86

Open rodolfovillordo opened 2 years ago

rodolfovillordo commented 2 years ago

Describe the bug An unnecessary user logstash was left on the files/internal_users.yml making the execution fail when following the instruction from the README.md

To Reproduce

  1. Run this playbook as instructed on the README;
$ ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789" --become
  1. See the error:
TASK [linux/opensearch : Security Plugin configuration | Filter service keys from the list of users] ****************************************************************************************
fatal: [os1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {'_meta': {'type': 'internalusers', 'config_version': 2}, 'admin': {'hash': '{{ admin_password }}', 'reserved': True, 'backend_roles': ['admin'], 'description': 'admin user'}, 'kibanaserver': {'hash': '{{ kibanaserver_password }}', 'reserved': True, 'description': 'kibanaserver user'}, 'logstash': {'hash': '{{ logstash_password }}', 'reserved': True, 'description': 'logstash user'}}: 'logstash_password' is undefined\n\nThe error appears to be in '/Users/rodvill/code/git/github/rodolfovillordo/opensearch-playbook/roles/linux/opensearch/tasks/security.yml': line 259, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n    # passwords will be written next\n    - name: Security Plugin configuration | Filter service keys from the list of users\n      ^ here\n"}

PLAY RECAP **********************************************************************************************************************************************************************************
os1                        : ok=17   changed=4    unreachable=0    failed=1    skipped=27   rescued=0    ignored=0

Playbook Name Specify the Playbook which is affected?

Screenshots N/A

Host/Environment (please complete the following information):

Additional context The logstash user is not needed in the default opensearch deployment.