almalinux.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ---
  2. # using as this as template.
  3. - name: set var for {{ onecloud_version }}
  4. set_fact:
  5. is_supported: false
  6. - debug: var=ansible_distribution_release
  7. - debug: var=supported_kylin_code
  8. - name: Assert {{ ansible_distribution }} {{ ansible_distribution_version }} conditions
  9. set_fact:
  10. is_supported: true
  11. when:
  12. - ansible_distribution == 'AlmaLinux'
  13. - "ansible_distribution_major_version in ('8', '9', '10')"
  14. - onecloud_version is defined
  15. - "ansible_architecture in ('x86_64', 'aarch64')"
  16. - debug: var=is_supported
  17. - name: Evaluate {{ ansible_distribution }} {{ ansible_distribution_version }} conditions
  18. fail:
  19. msg: "{{ ansible_distribution }} {{ ansible_distribution_version }} {{ ansible_distribution_release }} is not supported by {{ onecloud_version }}"
  20. when:
  21. - is_supported | default(true) | bool == false
  22. - name: Ensure kernel module br_netfilter is installed
  23. block:
  24. - modprobe:
  25. name: br_netfilter
  26. state: present
  27. become: true
  28. rescue:
  29. - fail:
  30. msg: "br_netfilter is not installed, please install by `yum install -y kernel-modules-extra` and reboot the system to take effect"