---
- name: installation des paquets
  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: fichier config fogsettings
  copy:
    src: fogsettings
    dest: "/tmp"

- name: recuperation de l archive d'installation fog
  get_url:
    url: "{{ depl_url }}/{{ depl_fog }}"
    dest: "/tmp/"

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

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


#- name: exécution du script d'installation de fog
#  ansible.builtin.shell: sudo bash  /tmp/fogproject-1.5.10/bin/installfog.sh --recreate-keys -f /tmp/fogsettings
#  args:
#    chdir: /tmp/fogproject-1.5.10
#
