Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e18534e3 authored by autodistries's avatar autodistries
Browse files

change hostname to ssx-sx, prevent reinstalling packages if they are already...

change hostname to ssx-sx, prevent reinstalling packages if they are already installed, add relative paths
parent d67d80fb
No related branches found
No related tags found
1 merge request!1Refactoring, new features
......@@ -11,13 +11,13 @@
command: sudo raspi-config nonint do_serial 2
- name: gpsd installation
command: sudo apt install gpsd -y
command: type -q gpsd || sudo apt install gpsd -y
- name: gpsd-clients installation
command: sudo apt install gpsd-clients -y
command: type -q gpsd || sudo apt install gpsd-clients -y
- name: pps-tools installation
command: sudo apt install pps-tools -y
command: type -q gpsd || sudo apt install pps-tools -y
- name: systemctl enable gpsd
command: sudo systemctl enable gpsd.socket
......@@ -39,7 +39,7 @@
- name: Copy a new config gpsd device functionality
copy:
src: /etc/default/gpsd
src: ../files/gpsd
dest: /etc/default/gpsd
- name: Reconfigure gpsd
......
......@@ -3,7 +3,7 @@
vars:
remote_src_file: "/home/tribe/mitik-sens-mod/capture-*.pcap"
dest_file: "~/Documents/Administratif/Emploi.travail/Inria Saclay TRiBE/Stage 2024/mitik-mgmt-main/results/"
dest_file: "../results/"
cap_file: capture-*
tasks:
......@@ -18,6 +18,6 @@
- name: Copy files
fetch:
src: "{{ item.path }}"
dest: "~/Documents/Administratif/Emploi.travail/Inria Saclay TRiBE/Stage 2024/mitik-mgmt-main/results/{{ ansible_date_time.date }}/{{ group_names[1] }}/{{ inventory_hostname }}/"
dest: "../results/{{ ansible_date_time.date }}/{{ group_names[1] }}/{{ inventory_hostname }}/"
flat: yes
with_items: "{{ files_to_copy.files }}"
- hosts: all
tasks:
- name: set system hostname
command: sudo hostnamectl set-hostname {{ inventory_hostname }}
command: sudo hostnamectl set-hostname {{ group_names[1] | default(group_names[0]) }}-{{ inventory_hostname }}
[ss1]
s1 ansible_host=192.168.1.184
s2 ansible_host=192.168.1.231
s3 ansible_host=192.168.1.239
......@@ -7,14 +8,13 @@ s4 ansible_host=192.168.1.248
s5 ansible_host=192.168.1.246
s6 ansible_host=192.168.1.244
[test]
rp4 ansible_host=192.168.1.248
[sniffers:children]
ss1
ss2
[all:vars]
ansible_connection=ssh
ansible_ssh_user=tribe
ansible_python_interpreter=/usr/bin/python3
# /etc/ansible/broadcast.yml
---
- name: Echoed stuff
hosts: ss1
vars_prompt:
# - name: _file
# prompt: Enter the folder name to save traces in the sniffer
# private: no
# This will always be the mitik-sens-mod folder
# - name: _location
# prompt: Enter the location of the experiments
# private: no
# I don't know what this parameter is (was) for
# - name: _hour
# prompt: Enter an hour to start the experiment
# default: 17
# private: no
#
# - name: _minute
# prompt: Enter minutes to start the experiment
# private: no
- name: _interfaces_csv
prompt: Please specify the interface(s) separated by commas (e.g. wlan0,wlan7). For default just press enter
default: 'wlan5,wlan6'
private: no
- name: _channels_csv
prompt: Please specify the starting channels (integer between 1-11 separated by commas, default=system). For default just press enter
default: "1,8"
private: no
- hosts: ss2
tasks:
- set_fact:
_interfaces: "{{ _interfaces_csv.split(',') }}"
_channels: "{{ _channels_csv.split(',') }}"
delegate_to: 127.0.0.1
run_once: True
- name: Double-check input variables
assert:
that: "{{ _interfaces|length }} == {{ _channels|length }}"
delegate_to: 127.0.0.1
run_once: True
- debug:
msg: "{{ item }}"
loop: "{{_interfaces}}"
delegate_to: 127.0.0.1
run_once: True
- debug:
msg: "{{ item }}"
loop: "{{_channels}}"
delegate_to: 127.0.0.1
run_once: True
- shell: "echo {{ item }} {{_channels[lp_idx]}} !! | sudo tee /dev/tty1 "
loop: "{{_interfaces}}"
loop_control:
index_var: lp_idx
- name: set system hostname
command: echo {{ group_names[1] | default(group_names[0]) }}-{{ inventory_hostname }}
register: outt
- debug:
msg: "{{outt.stdout}}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment