diff --git a/Ansible/execAnsible.sh b/Ansible/execAnsible.sh index 69e1203..d5f3fe9 100755 --- a/Ansible/execAnsible.sh +++ b/Ansible/execAnsible.sh @@ -1,7 +1,9 @@ #!/bin/bash -while [ 1 ] -do -ansible-playbook playbooktest.yml -ansible-playbook taskPing.yml -i inventaire.ini --ask-pass -rm inventaire.ini -done \ No newline at end of file +trap exit SIGINT +#while [ 1 ] +#do +#ansible-playbook playbooktest.yml +#ansible-playbook taskPing.yml -i inventaire.ini --ask-pass +ansible-playbook my_task.yml -i inventaire.ini +#rm inventaire.ini +#done \ No newline at end of file diff --git a/Ansible/inventaire.ini b/Ansible/inventaire.ini new file mode 100644 index 0000000..a29b964 --- /dev/null +++ b/Ansible/inventaire.ini @@ -0,0 +1,6 @@ +[Raspberry] +rasp1 +rasp2 + +[autretruc] +rasp1 \ No newline at end of file diff --git a/Ansible/my_task.yml b/Ansible/my_task.yml index e69de29..70d470e 100644 --- a/Ansible/my_task.yml +++ b/Ansible/my_task.yml @@ -0,0 +1,9 @@ +--- +- name: "Deploiement de code sur Raspberry" + hosts: Raspberry + remote_user: pi + become: yes + roles: + - role: arduino_Setup + + \ No newline at end of file diff --git a/Ansible/playbooktest.yml b/Ansible/playbooktest.yml index 2c98aec..7846f28 100644 --- a/Ansible/playbooktest.yml +++ b/Ansible/playbooktest.yml @@ -1,6 +1,6 @@ --- -- name: Wait until the file /home/pifou/inventaire.ini +- name: Wait until the file ./inventaire.ini hosts: localhost tasks: - wait_for: - path: /home/pifou/inventaire.ini \ No newline at end of file + path: ./inventaire.ini \ No newline at end of file diff --git a/Ansible/roles/arduino/tasks/main.yml b/Ansible/roles/arduino/tasks/main.yml new file mode 100644 index 0000000..139597f --- /dev/null +++ b/Ansible/roles/arduino/tasks/main.yml @@ -0,0 +1,2 @@ + + diff --git a/Ansible/roles/arduino_Setup/files/proxy.conf b/Ansible/roles/arduino_Setup/files/proxy.conf new file mode 100644 index 0000000..f118531 --- /dev/null +++ b/Ansible/roles/arduino_Setup/files/proxy.conf @@ -0,0 +1,2 @@ +Acquire::http::Proxy "http://proxy.polytech-lille.fr:3128/"; +Acquire::https::Proxy "https://proxy.polytech-lille.fr:3128/"; diff --git a/Ansible/roles/arduino_Setup/tasks/main.yml b/Ansible/roles/arduino_Setup/tasks/main.yml new file mode 100644 index 0000000..0ba4a5a --- /dev/null +++ b/Ansible/roles/arduino_Setup/tasks/main.yml @@ -0,0 +1,43 @@ +--- +- 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 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 \ No newline at end of file -- libgit2 0.21.2