Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. --- ## epagosDeploy/tasks/applyEars.yaml
  2.  
  3. - include_vars: common.yaml
  4. - include_vars: ears.yaml
  5.  
  6. - name: Downloading ears on app
  7. maven_artifact:
  8. artifact_id: "{{ item.artifact }}"
  9. group_id: "{{ item.group }}"
  10. extension: ear
  11. version: "{{ earVersion }}"
  12. timeout: 60
  13. dest: "{{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear"
  14. repository_url: "{{ urlNexus }}"
  15. validate_certs: no
  16. with_items:
  17. - "{{ commonEars }}"
  18. - "{{ appEars }}"
  19. when: inventory_hostname in groups['apps']
  20.  
  21. - name: Deploy ears on app
  22. shell: /opt/jboss/bin/jboss-cli.sh -c --controller={{ ansible_mgmt.ipv4.address }}:9999 --command="deploy {{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear --force"
  23. with_items:
  24. - "{{ commonEars }}"
  25. - "{{ appEars }}"
  26. when: inventory_hostname in groups['apps']
  27.  
  28. - name: Downloading ears on dmz
  29. maven_artifact:
  30. artifact_id: "{{ item.artifact }}"
  31. group_id: "{{ item.group }}"
  32. extension: ear
  33. version: "{{ earVersion }}"
  34. timeout: 60
  35. dest: "{{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear"
  36. repository_url: "{{ urlNexus }}"
  37. validate_certs: no
  38. with_items:
  39. - "{{ commonEars }}"
  40. - "{{ dmzEars }}"
  41. when: inventory_hostname in groups['dmzs']
  42.  
  43. - name: Deploy ears on dmz
  44. shell: /opt/jboss/bin/jboss-cli.sh -c --controller={{ ansible_mgmt.ipv4.address }}:9999 --command="deploy {{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear --force"
  45. with_items:
  46. - "{{ commonEars }}"
  47. - "{{ dmzEars }}"
  48. when:
  49. - inventory_hostname in groups['dmzs']
  50. - "'dmz02' not in ansible_hostname"
  51. - name: Downloading ears on backoffice
  52. maven_artifact:
  53. artifact_id: "{{ item.artifact }}"
  54. group_id: "{{ item.group }}"
  55. extension: ear
  56. version: "{{ earVersion }}"
  57. timeout: 60
  58. dest: "{{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear"
  59. repository_url: "{{ urlNexus }}"
  60. validate_certs: no
  61. with_items:
  62. - "{{ commonEars }}"
  63. - "{{ backofficeEars }}"
  64. when:
  65. - inventory_hostname in groups['backoffices']
  66. - "'backoffice02' not in ansible_hostname"
  67.  
  68.  
  69. - name: Deploy ears on backoffice
  70. shell: /opt/jboss/bin/jboss-cli.sh -c --controller={{ ansible_mgmt.ipv4.address }}:9999 --command="deploy {{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear --force"
  71. with_items:
  72. - "{{ commonEars }}"
  73. - "{{ backofficeEars }}"
  74. when:
  75. - inventory_hostname in groups['backoffices']
  76. - "'backoffice02' not in ansible_hostname"
  77.  
  78. - name: Restart JBoss
  79. systemd:
  80. name: jboss
  81. state: restarted
  82. when: inventory_hostname in groups['dmzs'] or inventory_hostname in groups['backoffices'] or inventory_hostname in groups['apps']
  83.  
  84.  
  85. ## eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement