Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- ## epagosDeploy/tasks/applyEars.yaml
- - include_vars: common.yaml
- - include_vars: ears.yaml
- - name: Downloading ears on app
- maven_artifact:
- artifact_id: "{{ item.artifact }}"
- group_id: "{{ item.group }}"
- extension: ear
- version: "{{ earVersion }}"
- timeout: 60
- dest: "{{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear"
- repository_url: "{{ urlNexus }}"
- validate_certs: no
- with_items:
- - "{{ commonEars }}"
- - "{{ appEars }}"
- when: inventory_hostname in groups['apps']
- - name: Deploy ears on app
- shell: /opt/jboss/bin/jboss-cli.sh -c --controller={{ ansible_mgmt.ipv4.address }}:9999 --command="deploy {{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear --force"
- with_items:
- - "{{ commonEars }}"
- - "{{ appEars }}"
- when: inventory_hostname in groups['apps']
- - name: Downloading ears on dmz
- maven_artifact:
- artifact_id: "{{ item.artifact }}"
- group_id: "{{ item.group }}"
- extension: ear
- version: "{{ earVersion }}"
- timeout: 60
- dest: "{{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear"
- repository_url: "{{ urlNexus }}"
- validate_certs: no
- with_items:
- - "{{ commonEars }}"
- - "{{ dmzEars }}"
- when: inventory_hostname in groups['dmzs']
- - name: Deploy ears on dmz
- shell: /opt/jboss/bin/jboss-cli.sh -c --controller={{ ansible_mgmt.ipv4.address }}:9999 --command="deploy {{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear --force"
- with_items:
- - "{{ commonEars }}"
- - "{{ dmzEars }}"
- when:
- - inventory_hostname in groups['dmzs']
- - "'dmz02' not in ansible_hostname"
- - name: Downloading ears on backoffice
- maven_artifact:
- artifact_id: "{{ item.artifact }}"
- group_id: "{{ item.group }}"
- extension: ear
- version: "{{ earVersion }}"
- timeout: 60
- dest: "{{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear"
- repository_url: "{{ urlNexus }}"
- validate_certs: no
- with_items:
- - "{{ commonEars }}"
- - "{{ backofficeEars }}"
- when:
- - inventory_hostname in groups['backoffices']
- - "'backoffice02' not in ansible_hostname"
- - name: Deploy ears on backoffice
- shell: /opt/jboss/bin/jboss-cli.sh -c --controller={{ ansible_mgmt.ipv4.address }}:9999 --command="deploy {{ remotePathDownload }}/deploy-{{ dateToday }}/ears/{{ item.artifact }}.ear --force"
- with_items:
- - "{{ commonEars }}"
- - "{{ backofficeEars }}"
- when:
- - inventory_hostname in groups['backoffices']
- - "'backoffice02' not in ansible_hostname"
- - name: Restart JBoss
- systemd:
- name: jboss
- state: restarted
- when: inventory_hostname in groups['dmzs'] or inventory_hostname in groups['backoffices'] or inventory_hostname in groups['apps']
- ## eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement