Closed patsevanton closed 2 years ago
@patsevanton There is one more local_action
which we missed.
https://github.com/opensearch-project/ansible-playbook/blob/main/roles/linux/opensearch/tasks/security.yml#L151
Please add become: false
for that task too. Otherwise we will face the below error,
TASK [linux/opensearch : Security Plugin configuration | Cleanup local temporary directory] **********************************************************************
fatal: [os1 -> 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}
Additionally please add how to run the playbook using non-root in README.
For running with non-root user (which have sudo privileges), we need to to below changes In hosts file, change the user details
os1 ansible_host=10.0.0.1 ansible_user=ec2-user ip=10.0.0.1
and run the playbook using --become
ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789" --become
Please add this details in README (Don't forget to sign the commit :)- ) @patsevanton
@peterzhuamazon I tested with both users using single-node
cluster type, root
user and non-root ec2-user
user with sudo privileges after fixing the issue here and it works fine.
Please test it with multi-node
after that fix, then this PR is good to merge.
Added become: false
to Cleanup local temporary directory
Added ansible_user
as user
Added --become
for run playbook
Cannot test multi-node
because https://github.com/opensearch-project/ansible-playbook/issues/49
@saravanan30erd could you approve? Thanks.
@saravanan30erd could you approve? Thanks.
Will do. I need to test it with multi-node
setup.
@saravanan30erd could you approve? Thanks.
Will do. I need to test it with
multi-node
setup.
Hi @saravanan30erd let me know the status of this. Thanks.
@peterzhuamazon I tested for multiple node setup with non-root user (ec2-user in EC2), it works fine. Already tested with root user and with non-root user for single-node setup here
We can merge this now.
@saravanan30erd
You can approve now as you are maintainer 😄
I created new commit: Add examples hosts for centos and ubuntu
Thanks @patsevanton for the patience your PR is merged now.
Signed-off-by: Anton Patsev patsev.anton@gmail.com
Description
Become: false for operation /tmp/opensearch-nodecerts
Issues Resolved
Fix https://github.com/opensearch-project/ansible-playbook/issues/45
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.