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.

59 lines
1.3 KiB

6 years ago
6 years ago
6 years ago
  1. ---
  2. # Todo : selinux configuration
  3. - name: Confirm selinux deployed
  4. stat:
  5. path: /etc/selinux/config
  6. when: ansible_os_family == "RedHat"
  7. register: slc
  8. - name: Set selinux policy
  9. selinux:
  10. policy: targeted
  11. state: "{{ preinstall_selinux_state }}"
  12. when:
  13. - ansible_os_family == "RedHat"
  14. - slc.stat.exists == True
  15. changed_when: False
  16. tags:
  17. - bootstrap-os
  18. - name: Disable IPv6 DNS lookup
  19. lineinfile:
  20. dest: /etc/gai.conf
  21. line: "precedence ::ffff:0:0/96 100"
  22. state: present
  23. backup: yes
  24. when:
  25. - disable_ipv6_dns
  26. - not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  27. tags:
  28. - bootstrap-os
  29. - name: Stat sysctl file configuration
  30. stat:
  31. path: "{{sysctl_file_path}}"
  32. register: sysctl_file_stat
  33. tags:
  34. - bootstrap-os
  35. - name: Change sysctl file path to link source if linked
  36. set_fact:
  37. sysctl_file_path: "{{sysctl_file_stat.stat.lnk_source}}"
  38. when:
  39. - sysctl_file_stat.stat.islnk is defined
  40. - sysctl_file_stat.stat.islnk
  41. tags:
  42. - bootstrap-os
  43. - name: Make sure sysctl file path folder exists
  44. file:
  45. name: "{{ sysctl_file_path | dirname }}"
  46. state: directory
  47. - name: Enable ip forwarding
  48. sysctl:
  49. sysctl_file: "{{sysctl_file_path}}"
  50. name: net.ipv4.ip_forward
  51. value: 1
  52. state: present
  53. reload: yes