---
  # --------------------------------------------------- 
  # configuration des packages necessaires pour Linux
  # ---------------------------------------------------
  - name: Installation des packages communs pour Linux
    yum: name={{ rpm_package }} state=installed
#    yum: name={{ item }} state=installed
#    tags: linux_packages
#    with_items:
    vars:
      rpm_package:
        - bind-utils
        - chrony
        - ethtool
        - lvm2
        - nc
        - ncurses
        - net-tools
        - nfs-utils
        - nscd
        - readline
        - sysstat
        - system-storage-manager
        - tree
        - unzip
        - vim
        - wget
        - xauth
        - xdpyinfo
        - xfsprogs
    tags: rpm_packages

  # --------------------------------------------------- 
  # configuration Linux : Mode panic
  # ---------------------------------------------------
  - name: Configuratio du mode panic sur perte du /
    shell: free_form="tune2fs -e panic `df -P / |tail -1 | awk '{print $1}'`"
    tags: mode_panic

  - name: Configuratio du mode panic sur bug du kernel
    sysctl: name=kernel.panic_on_oops value=1 state=present reload=yes ignoreerrors=yes
    tags: mode_panic
 
  # --------------------------------------------------- 
  # configuration Linux : Selinux
  # ---------------------------------------------------
  - name: Disactiver Selinux (de façon permanente)
    selinux: state=disabled
    register: selinux
    tags: selinux
  
  - name: Disactiver Selinux (runtime)
    shell: setenforce 0
    ignore_errors: true
    tags: selinux
 
  # --------------------------------------------------- 
  # configuration Linux : les services
  # ---------------------------------------------------
  - name: arrêter et désactiver les services inutils
    service: name={{ item }}  state=stopped  enabled=no
    tags: linuxservices
    ignore_errors: true
    with_items:
      - bluetooth
      - cups
      - gpm
      - hidd
      - hplip
      - isdn
      - sendmail
      - smartd
      - avahi-daemon
      - rhnsd
      - firstboot
      - ip6tables
      - iptables
      - firewalld

  # --------------------------------------------------- 
  # configuration du démarrage en mode 3 par défaut
  # ---------------------------------------------------
  - name: configuration du démarrage en mode 3 par défaut
    command: systemctl set-default multi-user.target
    tags: init3

