You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.7 KiB

  1. ---
  2. - include: gitinfos.yml
  3. when: run_gitinfos
  4. - name: gather os specific variables
  5. include_vars: "{{ item }}"
  6. with_first_found:
  7. - files:
  8. - "{{ ansible_distribution|lower }}-{{ ansible_distribution_version|lower|replace('/', '_') }}.yml"
  9. - "{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yml"
  10. - "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml"
  11. - "{{ ansible_distribution|lower }}.yml"
  12. - "{{ ansible_os_family|lower }}.yml"
  13. - defaults.yml
  14. paths:
  15. - ../vars
  16. - name: "Identify init system"
  17. shell: >
  18. $(pgrep systemd > /dev/null && systemctl status network.target > /dev/null);
  19. if [ $? -eq 0 ] ; then
  20. echo systemd;
  21. else
  22. echo sysvinit;
  23. fi
  24. always_run: True
  25. register: init_system_output
  26. changed_when: False
  27. - set_fact:
  28. init_system: "{{ init_system_output.stdout }}"
  29. - name: Install python-apt for Debian distribs
  30. shell: apt-get install -y python-apt
  31. when: ansible_os_family == "Debian"
  32. changed_when: False
  33. - name: Install python-dnf for latest RedHat versions
  34. shell: dnf install -y python-dnf yum
  35. when: ansible_distribution == "Fedora" and
  36. ansible_distribution_major_version > 21
  37. changed_when: False
  38. - name: Install packages requirements
  39. action:
  40. module: "{{ ansible_pkg_mgr }}"
  41. name: "{{ item }}"
  42. state: latest
  43. with_items: "{{required_pkgs | union(common_required_pkgs)}}"
  44. # Todo : selinux configuration
  45. - name: Set selinux policy to permissive
  46. selinux: policy=targeted state=permissive
  47. when: ansible_os_family == "RedHat"
  48. changed_when: False
  49. - include: etchosts.yml
  50. - include: python-bootstrap.yml
  51. when: ansible_os_family not in [ "Debian", "RedHat" ]