Guest User

Untitled

a guest
Apr 10th, 2019
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. ---
  2. # Deploy rails app from localhost to remote servers
  3.  
  4. - name: Set up AWS infrastructure
  5. hosts: localhost
  6. connection: local
  7. roles:
  8. - setup_aws
  9.  
  10. - name: Package app
  11. hosts: localhost
  12. vars:
  13. root_dir: ..
  14. roles:
  15. - package_app
  16.  
  17. - name: Install ruby & nginx
  18. hosts: web
  19. gather_facts: yes
  20. roles:
  21. - install_ruby
  22. - role: install_nginx
  23. become: yes
  24.  
  25. - name: Boot application
  26. hosts: web
  27. serial: 1
  28. gather_facts: yes
  29. roles:
  30. - role: webserver
  31. environment:
  32. RAILS_HOST: "{{ RAILS_HOST }}"
  33. SECRET_KEY_BASE: "{{ SECRET_KEY_BASE }}"
  34. DB_NAME: "{{ DB_NAME }}"
  35. DB_USERNAME: "{{ DB_USERNAME }}"
  36. DB_PASSWORD: "{{ DB_PASSWORD }}"
  37. DB_HOST: "{{ hostvars.localhost.rds.instance.endpoint }}"
  38.  
  39. - name: Setup load balancing
  40. hosts: localhost
  41. roles:
  42. - role: setup_elb
Add Comment
Please, Sign In to add comment