From 2231d3324c7b8ebeb266ebc8f06c9a9d6b539382 Mon Sep 17 00:00:00 2001 From: zabeth18 Date: Wed, 11 Mar 2020 17:01:50 +0000 Subject: [PATCH] lancer script shell fonctionnel --- Ansible/playbooktest.yml | 9 ++++----- Ansible/roles/arduino/tasks/main.yml | 5 ++++- Ansible/roles/arduino_Setup/tasks/Install.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 Ansible/roles/arduino_Setup/tasks/Install.yml diff --git a/Ansible/playbooktest.yml b/Ansible/playbooktest.yml index 7a4ff43..f1c48ab 100644 --- a/Ansible/playbooktest.yml +++ b/Ansible/playbooktest.yml @@ -1,11 +1,10 @@ --- - name: Wait until the file ./inventaire.ini - hosts: localhost + hosts: all + remote_user: pi + become: yes tasks: - - unarchive: - src: http://serveur-etu.polytech-lille.fr/~grouille/PROJET/fichiersRPI/fichiersRPI.zip - dest: /home/pifou/capteur1/ - remote_src: yes + - shell: /home/pi/capteur3/lancer.sh diff --git a/Ansible/roles/arduino/tasks/main.yml b/Ansible/roles/arduino/tasks/main.yml index 19dceb5..2d19bea 100644 --- a/Ansible/roles/arduino/tasks/main.yml +++ b/Ansible/roles/arduino/tasks/main.yml @@ -3,4 +3,7 @@ get_url: url: http://serveur-etu.polytech-lille.fr/~grouille/PROJET/upload/binaire.c dest: /home/pi/capteur{{capteur}}/binaire.c - mode: '0644' \ No newline at end of file + mode: '0644' + +- name: "execution du script" + shell: /home/pi/capteur{{capteur}}/lancer.sh \ No newline at end of file diff --git a/Ansible/roles/arduino_Setup/tasks/Install.yml b/Ansible/roles/arduino_Setup/tasks/Install.yml new file mode 100644 index 0000000..f665150 --- /dev/null +++ b/Ansible/roles/arduino_Setup/tasks/Install.yml @@ -0,0 +1,45 @@ +--- +- 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: "verif install python3" + apt: + name: python3 + state: present + +- name: "verif install python3-pip" + apt: + name: python3-pip + 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 + \ No newline at end of file -- libgit2 0.21.2