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.

71 lines
2.0 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. tags: always
  28. - set_fact:
  29. init_system: "{{ init_system_output.stdout }}"
  30. always_run: True
  31. tags: always
  32. - name: Update package management cache (APT)
  33. apt: update_cache=yes
  34. when: ansible_pkg_mgr == 'apt'
  35. - name: Update package management cache (YUM)
  36. yum: update_cache=yes name='*'
  37. when: ansible_pkg_mgr == 'yum'
  38. - name: Install python-apt for Debian distribs
  39. shell: apt-get install -y python-apt
  40. when: ansible_os_family == "Debian"
  41. changed_when: False
  42. - name: Install python-dnf for latest RedHat versions
  43. shell: dnf install -y python-dnf yum
  44. when: ansible_distribution == "Fedora" and
  45. ansible_distribution_major_version > 21
  46. changed_when: False
  47. - name: Install packages requirements
  48. action:
  49. module: "{{ ansible_pkg_mgr }}"
  50. name: "{{ item }}"
  51. state: latest
  52. with_items: "{{required_pkgs | union(common_required_pkgs)}}"
  53. # Todo : selinux configuration
  54. - name: Set selinux policy to permissive
  55. selinux: policy=targeted state=permissive
  56. when: ansible_os_family == "RedHat"
  57. changed_when: False
  58. - include: etchosts.yml
  59. - include: python-bootstrap.yml
  60. when: ansible_os_family not in [ "Debian", "RedHat" ]