opensearch-project / ansible-playbook

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

[BUG][Security Plugin Configuration] local action requesting unnecessary privilege escalation #82

Closed rodolfovillordo closed 2 years ago

rodolfovillordo commented 2 years ago

Describe the bug local action requesting unnecessary privilege escalation.

To Reproduce Steps to reproduce the behavior:

  1. checkout the latest version from this repository
  2. Apply the fix for #80
  3. run the playbook as instructed on the README:
    $ ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789 logstash_password=Test@123" --become
  4. See the error:
    TASK [linux/opensearch : Security Plugin configuration | Check that the files/internal_users.yml exists] ************************************************************************************
    fatal: [aos -> localhost]: FAILED! => {"changed": false, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Expected behavior Finish the deployment without errors.l

Playbook Name Specify the Playbook which is affected? roles/linux/opensearch/tasks/security.ym

Screenshots N/A

Host/Environment (please complete the following information):

Additional context As the task does not need elevate privileges to be performed it's better to set it to become: false other then force privilege escalation for a simple local file existence check.