Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote-exec provisioner error #8

Open
Shoulderboy opened this issue Sep 16, 2022 · 8 comments
Open

Remote-exec provisioner error #8

Shoulderboy opened this issue Sep 16, 2022 · 8 comments

Comments

@Shoulderboy
Copy link

I'm trying to deplpy CloudLabs with terraform in my Azure subscription.
But i keep failing on "remote-exec provisioner error" (see picture)
I can connect to all the VMs created
i would appreciate any help on this issue.

ScreenshotTerra1

similar error when running the tmp/script from the hackbox.
ScreenshotTerra2

@chvancooten
Copy link
Owner

Hey! Thanks for this report, it looks like Elastic introduced a breaking change by starting to ask for confirmations when running this command:

ansible.builtin.script: set-password-elastic.sh {{ elastic_password }}
, triggering this script: https://github.com/chvancooten/CloudLabsAD/blob/507c4a4a86226460f3f6ab52b36ba6c3dfecd04c/Ansible/roles/elastic_server/files/set-password-elastic.sh

Root cause seems to be this command: https://www.elastic.co/guide/en/elasticsearch/reference/master/reset-password.html, which luckily does have a --batch flag.

Could you try modifying the command in the set-password-elastic.sh file to say /usr/share/elasticsearch/bin/elasticsearch-reset-password -b -u elastic instead, and try again? Let me know if it works or submit a PR and I will integrate it!

(Sorry, would do that myself, but I'm quite busy ATM :) )

@Shoulderboy
Copy link
Author

I applied and tested the change, unfortunately it did not work. The issue still remains the same.

image

@chvancooten
Copy link
Owner

Hey, thanks for applying the fix! Looks like this is a new problem as indicated by the error message. It seems like the IP address for Elastic is not properly propagated from Terraform to Ansible this time - this could be because you tried running Ansible separately. This is possible, but in that case you would need to fill the Template files with the IP addresses from your terraform output manually. Alternatively you can re-run the provisioning from start to finish to re-populate the Ansible files for deployment. Let me know if that works!

@Shoulderboy
Copy link
Author

I tried applying IP addresses manually but got the same error as the first post. i tried running what i assume is the provisioning (ansible-playbook -v cloudlabs.yml) but it ended up with the same issue :/

@chvancooten
Copy link
Owner

Could you please provide a bit more information on how you provided the IP address to Ansible? Since the error you get now must be related to faulty config, and not the original issue :)

@chvancooten
Copy link
Owner

Original issue has been addressed in 9fbe65d, keeping this open for support on the config issue

@Shoulderboy
Copy link
Author

Hey, I decided to restart the whole process. these are the errors i have encountered. hopefully this will give some kind of insight.

First error

image

My fix Added username:

image

Second error:

image

My fix:
Replace all {{ ip address }} to ip.

image

Third error:

image

This is where I'm stuck :(

sorry for a long post, if we ever meet i'll buy you a beer. :)

@chvancooten
Copy link
Owner

Hi @Shoulderboy, thanks for the more detailed information! I think I see what the error is now. The below line:

https://github.com/chvancooten/CloudLabsAD/blob/main/Terraform/08-ansible.tf#L45

references the wrong template (linux.tmpl where it should be elastic.tmpl), looks like a copy-paste error when a fix was made to change the templating system. Could you make this change and see if that fixes your issues and propagates the variables correctly? No other changes should be necessary!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants