From 53b1fa7eaf16ed467b8156566c09bb03918b6a6b Mon Sep 17 00:00:00 2001 From: psanchez Date: Wed, 11 Mar 2020 14:56:32 +0000 Subject: [PATCH] installation correcte, copie des fichier ok --- Ansible/inventaire.ini | 6 +++--- Ansible/roles/arduino/tasks/main.yml | 16 +++------------- Ansible/roles/arduino_Setup/tasks/main.yml | 60 +++++++++--------------------------------------------------- 3 files changed, 15 insertions(+), 67 deletions(-) diff --git a/Ansible/inventaire.ini b/Ansible/inventaire.ini index 56c7d51..386777b 100644 --- a/Ansible/inventaire.ini +++ b/Ansible/inventaire.ini @@ -1,6 +1,6 @@ [Arduino_init] -172.26.145.112 -172.26.145.113 +172.26.145.112 capteur=1 +172.26.145.113 capteur=2 [Arduino] -rasp1 capteur1=1 +172.26.145.112 capteur=1 \ No newline at end of file diff --git a/Ansible/roles/arduino/tasks/main.yml b/Ansible/roles/arduino/tasks/main.yml index 2e2534d..19dceb5 100644 --- a/Ansible/roles/arduino/tasks/main.yml +++ b/Ansible/roles/arduino/tasks/main.yml @@ -1,16 +1,6 @@ --- -- name: "envoyer d'un fichier vers arduino cpt1" +- name: "envoyer du fichier binaire.c" get_url: url: http://serveur-etu.polytech-lille.fr/~grouille/PROJET/upload/binaire.c - dest: /home/pi/capteur1/binaire.c - mode: '0440' - when: capteur1 is undefined - -- name: "envoyer d'un fichier vers arduino cpt2" - copy: - src: ../files/proxy.conf - dest: /home/pi/capteur2/makefile - owner: root - group: root - mode: '0644' - when: capteur2 is undefined \ No newline at end of file + dest: /home/pi/capteur{{capteur}}/binaire.c + mode: '0644' \ No newline at end of file diff --git a/Ansible/roles/arduino_Setup/tasks/main.yml b/Ansible/roles/arduino_Setup/tasks/main.yml index ee335f0..fcdbadd 100644 --- a/Ansible/roles/arduino_Setup/tasks/main.yml +++ b/Ansible/roles/arduino_Setup/tasks/main.yml @@ -1,57 +1,15 @@ --- -- name: "Copy file for proxy setup" - copy: - src: ../files/proxy.conf - dest: /etc/apt/apt.conf.d/proxy.conf - owner: root - group: root - mode: '0644' +- name: "First Install" + include: Install.yml + when: capteur==1 -- name: "verif install python3" - apt: - name: python3 - state: present +- name: "Creation des dossiers pour le capteur" + file: + path: /home/pi/capteur{{capteur}} + state: directory -- name: "verif install python3-pip" - apt: - name: python3-pip - state: present - -- name: "verif install minicom" - apt: - name: minicom - state: present - -- name: "verif install wiringpi" - apt: - name: wiringpi - state: present - -- name: "verif install avrdude" - apt: - name: avrdude - state: present - -- name: "verif install lxml pkg" - pip: - executable: pip3 - name: lxml - -- name: "verif install requests pkg" - pip: - executable: pip3 - name: requests - -- name: "verif install pyserial pkg" - pip: - executable: pip3 - name: pyserial - - name: "Download and unzip files" unarchive: src: http://serveur-etu.polytech-lille.fr/~grouille/PROJET/fichiersRPI/fichiersRPI.zip - dest: /home/pi/ - remote_src: yes - -- name: "Lancement script setup" - shell: /home/pi/fichiersRPI/toto.sh + dest: /home/pi/capteur{{capteur}} + remote_src: yes \ No newline at end of file -- libgit2 0.21.2