Commit 53b1fa7eaf16ed467b8156566c09bb03918b6a6b

Authored by psanchez
1 parent 07b74fa0

installation correcte, copie des fichier ok

Ansible/inventaire.ini
1 1 [Arduino_init]
2   -172.26.145.112
3   -172.26.145.113
  2 +172.26.145.112 capteur=1
  3 +172.26.145.113 capteur=2
4 4  
5 5 [Arduino]
6   -rasp1 capteur1=1
  6 +172.26.145.112 capteur=1
7 7 \ No newline at end of file
... ...
Ansible/roles/arduino/tasks/main.yml
1 1 ---
2   -- name: "envoyer d'un fichier vers arduino cpt1"
  2 +- name: "envoyer du fichier binaire.c"
3 3 get_url:
4 4 url: http://serveur-etu.polytech-lille.fr/~grouille/PROJET/upload/binaire.c
5   - dest: /home/pi/capteur1/binaire.c
6   - mode: '0440'
7   - when: capteur1 is undefined
8   -
9   -- name: "envoyer d'un fichier vers arduino cpt2"
10   - copy:
11   - src: ../files/proxy.conf
12   - dest: /home/pi/capteur2/makefile
13   - owner: root
14   - group: root
15   - mode: '0644'
16   - when: capteur2 is undefined
17 5 \ No newline at end of file
  6 + dest: /home/pi/capteur{{capteur}}/binaire.c
  7 + mode: '0644'
18 8 \ No newline at end of file
... ...
Ansible/roles/arduino_Setup/tasks/main.yml
1 1 ---
2   -- name: "Copy file for proxy setup"
3   - copy:
4   - src: ../files/proxy.conf
5   - dest: /etc/apt/apt.conf.d/proxy.conf
6   - owner: root
7   - group: root
8   - mode: '0644'
  2 +- name: "First Install"
  3 + include: Install.yml
  4 + when: capteur==1
9 5  
10   -- name: "verif install python3"
11   - apt:
12   - name: python3
13   - state: present
  6 +- name: "Creation des dossiers pour le capteur"
  7 + file:
  8 + path: /home/pi/capteur{{capteur}}
  9 + state: directory
14 10  
15   -- name: "verif install python3-pip"
16   - apt:
17   - name: python3-pip
18   - state: present
19   -
20   -- name: "verif install minicom"
21   - apt:
22   - name: minicom
23   - state: present
24   -
25   -- name: "verif install wiringpi"
26   - apt:
27   - name: wiringpi
28   - state: present
29   -
30   -- name: "verif install avrdude"
31   - apt:
32   - name: avrdude
33   - state: present
34   -
35   -- name: "verif install lxml pkg"
36   - pip:
37   - executable: pip3
38   - name: lxml
39   -
40   -- name: "verif install requests pkg"
41   - pip:
42   - executable: pip3
43   - name: requests
44   -
45   -- name: "verif install pyserial pkg"
46   - pip:
47   - executable: pip3
48   - name: pyserial
49   -
50 11 - name: "Download and unzip files"
51 12 unarchive:
52 13 src: http://serveur-etu.polytech-lille.fr/~grouille/PROJET/fichiersRPI/fichiersRPI.zip
53   - dest: /home/pi/
54   - remote_src: yes
55   -
56   -- name: "Lancement script setup"
57   - shell: /home/pi/fichiersRPI/toto.sh
  14 + dest: /home/pi/capteur{{capteur}}
  15 + remote_src: yes
58 16 \ No newline at end of file
... ...