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

Ansible deployment - Error while deploying the infrastructure #147

Open
junedl-nimblechapps opened this issue Nov 25, 2019 · 9 comments
Open
Labels
bug Something isn't working

Comments

@junedl-nimblechapps
Copy link

junedl-nimblechapps commented Nov 25, 2019

Here is my error message:

Screenshot 2019-11-25 at 4 20 16 PM

From error message it looks like some some state are change but Im deploying it first time using ansible-playbook deploy_infra.yml command

@vbaranov
Copy link
Collaborator

@junedl-nimblechapps in order to deploy infrastructure first time you should use ansible-playbook deploy_infra.yml. ansible-playbook deploy_software.yml is used to deploy updates on the application.

@junedl-nimblechapps
Copy link
Author

junedl-nimblechapps commented Nov 25, 2019

@vbaranov it was typo. Im using command to deploy infrastructure. Its stops at
ok: [xyz] => (item={'value': u'sudo systemctl restart explorer.service', 'key': u'heart_command'})

@vbaranov
Copy link
Collaborator

Just to make sure, that prerequisites are correct: which version of Terraform, Ansible and python on the machine where you make a deploy from?

Did the deployment create an EC2-server with the application? Can you check is /opt/app folder is not empty on that server? The application should live there

@junedl-nimblechapps
Copy link
Author

Terraform v0.12.15
ansible 2.9.1
Python 2.7.10

@junedl-nimblechapps
Copy link
Author

Well I installed the latest version of pyhton3.

python3 version is 3.8.0
os version is macOS 10.14

and set ansible_python_interpreter in my [mygroup].yml to python3 located on my device using which python command.

Path :
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3

Im still getting the above error message.

@vbaranov
Copy link
Collaborator

@junedl-nimblechapps

Could you try to get upstream from the master branch and repeat deployment?

If this doesn't help, try to clean deployment cache ansible-playbook clean.yml (ref https://docs.blockscout.com/for-developers/ansible-deployment/common-additional-tasks#cleaning-deployment-cache) and try deployment again

@junedl-nimblechapps
Copy link
Author

junedl-nimblechapps commented Nov 27, 2019

@vbaranov Still the same error.

However

  • s3 bucket to store terraform state is created
  • codedeploy application is created
  • DynemoDB table is also created to store terraform lock info
  • DNS is also created.
  • VPC are also present.
  • In RDS subnet are created.

But ....

  • not seeing any database in RDS as deployment is not successful
  • also Im not seeing any EC2 instance running

@vbaranov
Copy link
Collaborator

Check that your ansible is tied to python 3 like this:

viktor$ ansible --version
ansible 2.8.5
  config file = None
  configured module search path = ['/Users/viktor/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.8.5_1/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.4 (default, Oct 12 2019, 19:06:48) [Clang 11.0.0 (clang-1100.0.33.8)]

if no, I'd recommend reinstalling ansible.

And then you can try to destroy built infrastructure by following this guide https://docs.blockscout.com/for-developers/ansible-deployment/destroying-provisioned-infrastructure and start building from scratch again.

If this will not help, try to downgrade Terraform version. I successfully used v0.12.12 with the latest deployment in the past month:

viktor$ terraform --version
Terraform v0.12.12

@vbaranov vbaranov added the bug Something isn't working label Feb 5, 2020
@vbaranov
Copy link
Collaborator

vbaranov commented Feb 5, 2020

@junedl-nimblechapps take a look to this comment
#144 (comment).
Possibly, you have the same issue. The main suggestion is to try with Terraform 11.11 - 11.14. The script is not stable with Terraform 12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants