Commit b05b0dc5f7e46c9bc38f48070d150f65d913c98f

Authored by psanchez
1 parent 4bad3ae3

gestion des roles

Ansible/execAnsible.sh
1 #!/bin/bash 1 #!/bin/bash
2 -while [ 1 ]  
3 -do  
4 -ansible-playbook playbooktest.yml  
5 -ansible-playbook taskPing.yml -i inventaire.ini --ask-pass  
6 -rm inventaire.ini  
7 -done  
8 \ No newline at end of file 2 \ No newline at end of file
  3 +trap exit SIGINT
  4 +#while [ 1 ]
  5 +#do
  6 +#ansible-playbook playbooktest.yml
  7 +#ansible-playbook taskPing.yml -i inventaire.ini --ask-pass
  8 +ansible-playbook my_task.yml -i inventaire.ini
  9 +#rm inventaire.ini
  10 +#done
9 \ No newline at end of file 11 \ No newline at end of file
Ansible/inventaire.ini 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +[Raspberry]
  2 +rasp1
  3 +rasp2
  4 +
  5 +[autretruc]
  6 +rasp1
0 \ No newline at end of file 7 \ No newline at end of file
Ansible/my_task.yml
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  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 +
0 \ No newline at end of file 10 \ No newline at end of file
Ansible/playbooktest.yml
1 --- 1 ---
2 -- name: Wait until the file /home/pifou/inventaire.ini 2 +- name: Wait until the file ./inventaire.ini
3 hosts: localhost 3 hosts: localhost
4 tasks: 4 tasks:
5 - wait_for: 5 - wait_for:
6 - path: /home/pifou/inventaire.ini  
7 \ No newline at end of file 6 \ No newline at end of file
  7 + path: ./inventaire.ini
8 \ No newline at end of file 8 \ No newline at end of file
Ansible/roles/arduino/tasks/main.yml 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +
  2 +
Ansible/roles/arduino_Setup/files/proxy.conf 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +Acquire::http::Proxy "http://proxy.polytech-lille.fr:3128/";
  2 +Acquire::https::Proxy "https://proxy.polytech-lille.fr:3128/";
Ansible/roles/arduino_Setup/tasks/main.yml 0 → 100644
@@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
  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'
  9 +
  10 +- name: "verif install python3"
  11 + apt:
  12 + name: python3
  13 + state: present
  14 +
  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
0 \ No newline at end of file 44 \ No newline at end of file