Commit 8fb6b9d187b75779da145013cd0e85ed810eb850

Authored by psanchez
1 parent c16f439b

modification des taches + test telechargement des fichiers pour envoi

Ansible/MainTask.yml 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +---
  2 +- name: "Setup des Raspberry pi pour capteur Arduino"
  3 + hosts: Arduino_init
  4 + remote_user: pi
  5 + become: yes
  6 + roles:
  7 + - role: arduino_Setup
  8 +
  9 +- name: "Setup des Raspberry pi pour capteur Nucleo"
  10 + hosts: Nucleo_init
  11 + remote_user: pi
  12 + become: yes
  13 + roles:
  14 + - role: nucleo_Setup
  15 +
  16 +- name: "Déploiement de code pour Arduino"
  17 + hosts: Arduino
  18 + remote_user: pi
  19 + become: yes
  20 + roles:
  21 + - role: arduino
  22 +
  23 +- name: "Déploiement de code pour Nucleo"
  24 + hosts: Nucleo
  25 + remote_user: pi
  26 + become: yes
  27 + roles:
  28 + - role: nucleo
0 29 \ No newline at end of file
... ...
Ansible/inventaire.ini
1   -[Raspberry]
2   -rasp1 capteur1=1
  1 +[Arduino_init]
  2 +rasp1
3 3 rasp2
4 4  
5   -[autretruc]
6   -rasp1
7 5 \ No newline at end of file
  6 +[Arduino]
  7 +rasp1 capteur1=1
8 8 \ No newline at end of file
... ...
Ansible/my_task.yml deleted
... ... @@ -1,9 +0,0 @@
1   ----
2   -- name: "Deploiement de code sur Raspberry"
3   - hosts: Raspberry
4   - remote_user: pi
5   - become: yes
6   - roles:
7   - - role: arduino_Setup
8   -
9   -
10 0 \ No newline at end of file
Ansible/roles/arduino/tasks/main.yml
  1 +---
  2 +- name: "envoyer d'un fichier vers arduino cpt1"
  3 + get_url:
  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
1 8  
2   -
  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
3 17 \ No newline at end of file
... ...
Ansible/roles/arduino_Setup/tasks/main.yml
1 1 ---
2   -- name: Copy file for proxy setup
  2 +- name: "Copy file for proxy setup"
3 3 copy:
4 4 src: ../files/proxy.conf
5 5 dest: /etc/apt/apt.conf.d/proxy.conf
6 6 owner: root
7 7 group: root
8 8 mode: '0644'
9   - when: capteur1 is undefined
10 9  
11 10 - name: "verif install python3"
12 11 apt:
... ...
Ansible/taskPing.yml
1 1 ---
2 2 - name: Ping
3   - hosts: all
  3 + hosts: localhost
4 4 remote_user: pi
5 5 tasks:
6   - - ping:
7 6 \ No newline at end of file
  7 + - ping:
  8 +
  9 +- name: "envoyer d'un fichier vers arduino cpt1"
  10 + hosts: localhost
  11 + tasks:
  12 + - file:
  13 + path: /home/pifou/Documents/test
  14 + state: directory
  15 + mode: 0755
  16 + group: pifou
  17 + owner: pifou
  18 + - get_url:
  19 + url: http://serveur-etu.polytech-lille.fr/~grouille/PROJET/upload/binaire.c
  20 + dest: /home/pifou/Documents/test/binaire.c
  21 + mode: '0440'
8 22 \ No newline at end of file
... ...