main.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ---
  2. # Fixes the DO380 class playbooks for logging operator and related artifacts to
  3. # use the original operator catalogs rather than the do380-catalog.
  4. #
  5. # 1. make sure /usr/local/lib/ansible is there, OR extract http://materials.example.com/ansible.tgz
  6. # (examples in labtool.do380.shlib)
  7. #
  8. # 2. perform the modifications needed for logging to deploy correctly:
  9. #
  10. # - change do380-catalog to redhat-operators
  11. # /usr/local/lib/ansible/lso/set_lso.yml
  12. # /usr/local/lib/ansible/logging/files/elasticsearch-operator.yml
  13. # /usr/local/lib/ansible/logging/files/logging-operator.yml
  14. #
  15. # - remove image attribute from eventrouter
  16. # /usr/local/lib/ansible/logging/set_logging.yml
  17. #
  18. - name: Check if Ansible labs are there.
  19. stat:
  20. path: /usr/local/lib/ansible
  21. register: ansible_dir
  22. - name: Unarchive Ansible files
  23. become: yes
  24. unarchive:
  25. src: http://materials.example.com/ansible.tgz
  26. dest: /usr/local/lib/
  27. owner: root
  28. group: root
  29. remote_src: true
  30. when: not ansible_dir.stat.exists
  31. - name: Replace all references to do380-catalog in any manifest.
  32. become: yes
  33. lineinfile:
  34. path: "{{ item }}"
  35. regexp: "(^\\s+source:) do380-catalog"
  36. backrefs: yes
  37. line: "\\1 redhat-operators"
  38. state: present
  39. loop:
  40. - /usr/local/lib/ansible/lso/set_lso.yml
  41. - /usr/local/lib/ansible/logging/files/elasticsearch-operator.yml
  42. - /usr/local/lib/ansible/logging/files/logging-operator.yml
  43. - name: Remove the IMAGE and parameters attributes from eventrouter spec.
  44. become: yes
  45. lineinfile:
  46. path: /usr/local/lib/ansible/logging/set_logging.yml
  47. regexp: "(parameters|IMAGE):"
  48. state: absent
  49. ...