pre-flight.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. - name: Pre-flight checks only.
  3. hosts: workstation.lab.example.com
  4. gather_subset: min
  5. become: no
  6. roles:
  7. - role: pull-tools
  8. tags:
  9. - prep
  10. - tools
  11. - role: pull-images
  12. tags:
  13. - prep
  14. - images
  15. - role: pull-files
  16. tags:
  17. - prep
  18. - files
  19. - role: check-env
  20. tags: check
  21. - role: fix-operators
  22. tags: fix
  23. # TODO: convert to role?
  24. tasks:
  25. - name: get current eap version
  26. set_fact:
  27. eap_version: "{{ lookup('file', '/opt/eap/version.txt') }}"
  28. - name: patch eap server
  29. become: yes
  30. command: /opt/eap/bin/jboss-cli.sh --command="patch apply {{ ansible_facts['user_dir'] }}/Downloads/jboss-eap-{{ eap_z }}-patch.zip"
  31. when:
  32. - eap_z not in eap_version
  33. register: patched
  34. - name: remove patch when done
  35. file:
  36. path: "{{ ansible_facts['user_dir'] }}/Downloads/jboss-eap-{{ eap_z }}-patch.zip"
  37. state: absent
  38. when:
  39. - patched is defined
  40. - patched.changed
  41. ...