---
- name: Installation des paquets de base
  apt:
    state: present
    name:
    - apache2 
    - curl  
    - git 
    - gzip  
    - isc-dhcp-server 
    - mariadb-client 
    - mariadb-server 
    - net-tools 
    - openssh-server 
    - php
    - php-cli 
    - php-curl 
    - php-fpm 
    - php-gd 
    - php-intl 
    - php-json 
    - php-ldap 
    - php-mbstring 
    - php-mysql
    - tar 
    - unzip 
    - vsftpd 
    - wget 

- name: creation /root/tmp
  file:
    path: /root/tmp
    state: directory

- name: fichier config fogsettings
  copy:
    src: fogsettings
    dest: /root/tmp/

- name: Récupération archive d'installation Fog
  get_url:
    url: "{{ depl_url }}/{{ depl_fog }}"
    dest: "/root/tmp/"

- name: Décompression de l'archive
  ansible.builtin.unarchive:
    src: "/root/tmp/{{ depl_fog }}"
    dest: "/root/tmp/"

- name: Exécution du script d'installation Fog
  ansible.builtin.shell: sudo bash /root/tmp/fogproject-1.5.10/bin/installfog.sh --recreate-keys -f /root/tmp/fogsettings -y
  args:
    chdir: "/root/tmp/fogproject-1.5.10/"

