Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 57329a60 authored by ACHIR Nadjib's avatar ACHIR Nadjib
Browse files

Merge branch 'main' into 'main'

Refactoring, new features

See merge request !1
parents 2f0d7cb5 f4e3eee4
No related branches found
No related tags found
1 merge request!1Refactoring, new features
Showing
with 990 additions and 436 deletions
*.kate-swp
{
// Place your mitik-guide workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"TODO": {
"scope": "markdown",
"prefix": "TODO",
"body": [
"{- TODO: $1 -} $0"
],
"description": "A todo highlited in red with diff"
}
}
\ No newline at end of file
{
"ansible.python.interpreterPath": "/bin/python"
}
\ No newline at end of file
......@@ -27,19 +27,22 @@ Therefore, there is a need to integrate all the current developments into one un
# **MITIK management tool**
This repository contains files and firmware that is used to manage practical experiments of MITIK project in La Rochelle.
Basically this tool enables the management of sniffers through a "sniffer manager".
MITIK-MGMT is a management tool made to set-up sniffers, synchronize experiments and extract the results.
## **Sniffer manager**
The sniffer manager comprises several functions:
See [DOCUMENTATION.md](./docs/DOCUMENTATION.md) for installation, setup and usage instructions.\
See [PLAYBOOKS.md](./docs/PLAYBOOKS.md) for information about the available playbooks.
* Provide a tool that enables the configuration of multiple sniffers through organized instructions.
The sniffer manager comprises several functions:
* Centralized management of multiple sniffers (time synchronization, raw data capture, data transfer, data processing, among others).
* Configuration of parameters and execution of code source of the MITIK project [1], [2].
* One-step, one-time configuration of passwordless ssh access.
* One-step configuration of multiple sniffers on all leverls: networking, software, gps...
* Configuration of parameters and execution of code source of the MITIK-SENS project [1], [2].
* Integration of functional blocks [4] developed for data capture / data anonymization/sanitization (Phase 1 - Per-technology sniffing engine) [1], handling of collected data (Phase 2 - Trace handling engine) [3], [5], [6], and analysis of human mobility (Phase 3 - Trace production engine), based on data collected from contacts of mobile devices detected by sniffers.
......@@ -72,14 +75,17 @@ Instructions are defined in Ansible's playbooks used to prepare all instructions
- [x] Integrate code sources from [1], [5]
- [x] Make available pcap files to start next steps (Phase 2 - Trace handling engine)
## Test and Deploy
## Future plans
- [ ] Positioning using GPS (coordinates lat, lon)
- [ ] gzip compression
- [ ] Data transfer to manager PC / Mitik server
- [x] Time synchronization
- [x] Interfaces configuration
- [x] Sync and positioning using GPS (coordinates lat, lon)
- [x] Timeout function in Scapy-sniffer
- [x] gzip compression
- [x] Data transfer to manager PC / Mitik server
## **Installation**
See [DOCUMENTATION.md](./docs/DOCUMENTATION.md) for installation, setup and usage instructions.\
See [PLAYBOOKS.md](./docs/PLAYBOOKS.md) for information about the available playbooks.
***
......@@ -92,10 +98,6 @@ Figure 3 shows the flowchart for configuring the per-technology sniffing engine.
</figure>
</center>
## **Installation**
Check the [installation guide](https://gitlab.inria.fr/fmorlano/mitik_management/-/blob/main/docs/Installation%20manual.md)
## **References**
[1] Fernando Dias de Mello Silva, Abhishek Kumar Mishra, Aline Carneiro Viana, Nadjib Achir, Anne Fladenmuller, and Luís Henrique M. K. Costa. Performance analysis of a privacy-preserving frame sniffer on a raspberry pi. In 6th Cyber Security in Networking Conference (CSNet), pages 1–7, October 2022.
......
# **Sniffers' configuration**
Ansible[^1] involves a common set of concepts and tools for system automation. An inventory to define the hosts and groups of hosts participants that will be operated by the playbooks. Once the inventory has been defined, a set of playbooks have been programmed to perform tasks on the sniffers. The execution of the playbooks depends on the modules available in the Ansible platform. Finally, the system global interpreter is based on Python.
[^1]: https://www.ansible.com/
The proposed topology is shown in Figure 1. One goal of using Ansible-based automation is to configure all sniffers simultaneously to guarantee that all nodes receive the same configuration, in addition to facilitating the manipulation of each device to be configured.
<center>
<figure>
<img src="https://gitlab.inria.fr/fmorlano/mitik_management/-/raw/main/Figures/mitik_topology.png" width="70%" height="70%" alt="mitik_topology"/>
<figcaption>Figure 1. Topology of Mitik project.</figcaption>
</figure>
</center>
The sniffers' deployment require two roles to be developed. The first environment has been created to perform the installation and configuration tasks required on the hardware and the O.S.; the second environment executes the tasks necessary to start the sniffer according to the required parameters, in addition to synchronizing the data with the sniffer manager (Mitik laptop) and the Mitik server. Figure 3 shows the scenario to be automated by the Ansible management tool.
<center>
<figure>
<img src="https://gitlab.inria.fr/fmorlano/mitik_management/-/raw/main/Figures/ansible_implementation.png" width="70%" height="70%" alt="ansible_implementation"/>
<figcaption>Figure 3. Automating super-sniffers deployment.</figcaption>
</figure>
</center>
## **Role 1. Hardware and software requirements**
A modified version of Raspian has been provided by [1], as part of the experiments evaluating the performance of low-level libraries to capture network traffic in the sniffer. However, it is necessary to carry out additional configurations in the sniffer to add new functionalities on it.
## **Sniffer manager**
A sniffer manager is defined in a Mitik laptop (Macbook Pro). All the instructions executed in the sniffers are defined in the sniffer manager. To establish communication with the sniffers, an inventory with specific parameters is defined.Each sniffer is assigned a static IP. Besides that, sniffers are organized in groups (super-sniffers). _inventory_ shows the definition for each sniffer. Four groups (super-sniffers) are defined (ss1 to ss4), and each one contains five sniffers (sniffer#-ss#).
In addition to the inventory, the sniffer manager sends all the instructions and configurations contained in the playbooks to be executed in each sniffer.
### **Authentication**
SSH key-based is used as authentication method between the sniffer manager and the sniffers. It is indispensable for the secure exchange information and data between the entities (sniffer manager and sniffers), besides of the execution of specific functions that requires SSH authentication. To enable the SSH Key-based authentication setup between the sniffer manager and the sniffers, _playbook_SSH_Keygen_ generates the public key of each sniffer, and also copy their SSH public keys to the sniffer manager.
### **Sniffer Identification**
Since each sniffer uses the O.S. from [1], _playbook_hostname_ and _playbook_hosts_ to redefine the hostname and local DNS of each sniffer based on the _inventory_ file and the static IP defined there.
### **GPS Synchronization**
Each step described in [README](https://gitlab.inria.fr/fmorlano/mitik_management/-/blob/main/docs/Installation%20manual.md) is executed in _playboork_GPS_sync_.
### **Wireless Interfaces**
To avoid randomness in the network interface names, the **Predictable network interface names** is disabled, and new udev rules are defined for assigning static interface names for each USB port.
```
#
# +---------------+
# | wlan1 | wlan3 |
# +-------+-------+
# | wlan2 | wlan4 |
# +---------------+ (RPI USB ports distribution)
#
# | wlan0 | (onboard wifi)
#
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="sdio", ATTR{address}=="<MAC address onboard antenna>", KERNELS=="brcmfmac", NAME="wlan0"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", KERNELS=="1-1.3", NAME="wlan1"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", KERNELS=="1-1.4", NAME="wlan2"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", KERNELS=="1-1.1", NAME="wlan3"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", KERNELS=="1-1.2", NAME="wlan4"
```
It is also defined a wireless network to connect each sniffer to the remote server through wlan0. These parameters are defined in _playbook_NIC_config_. It is worth noting that all wireless interfaces used to sniff must be connected in the same USB port for all sniffers.
## **Role 2. Sniffer parameters**
Unlike the single execution tasks of role 1, the tasks of role 2 can be executed multiple times, as long as they correspond to execution variables of the sniffer script. It is necessary to enter the online parameters to run the sniffer described in [1]. Host variables are defined in _playbook_scapy-sniffer_. Also, a timeout to stop sniffer execution has been added. By last, a job scheduling utility has been added to ensure that network time protocol set by Chrony is up to date for all sniffers.
To start the sniffers, following parameters must be defined:
- Hour to start the experiment,
- Minutes to start the experiment,
- Runtime duration in seconds,
- Wireless interface (by default, wlan1),
- Packet capture filter (by default, probe-req, probe-resp, beacon),
- Channel (by default, system),
- Hash funtion (by default, MD5),
- Hash pattern (by default, 15),
- Folder destination.
The capture filename structure produced by sniffers will have the next format: packet_capture_{sniffer_i-super-sniffer_id}-ts-{timestamp}-ch{channel}-gps{lat/lon}.pcap
On the other hand, each single capture file from the sniffers is sent via SSH connection to the Mitik laptop or Mitik server to be analyzed in the **Trace handling engine** and the **Trace production engine**. The _playbook_data_transfer_ contains the instructions to send the data to the Mitik laptop or Mitik server.
# ------------------ **TODO** --------------------
Tasks:
- [x] UPLOAD FUNCTIONAL PLAYBOOKS OF THE FIRST TESTBED
- [x] SPECIFY FEATURES OF EACH PLAYBOOK
- [x] ORGANIZE FEATURES IN PLAYBOOKS BY TASK TYPE
- [ ] CREATE MAIN.YML TO EXECUTE ALL THE PLAYBOOKS
## **References**
[1] Fernando Dias de Mello Silva, Abhishek Kumar Mishra, Aline Carneiro Viana, Nadjib Achir, Anne Fladenmuller, and Lu ́ıs Henrique M. K. Costa. Performance analysis of a privacy-preserving frame sniffer on a raspberry pi. In 6th Cyber Security in Networking Conference (CSNet), pages 1–7, October 2022.
- hosts: sniffers
user: gta
become: yes
become_user: root
tasks:
- name: Timezone config
command: sudo timedatectl set-timezone Europe/Paris
- name: Raspi-config serial_hw
command: sudo raspi-config nonint do_serial 2
- name: gpsd installation
command: sudo apt install gpsd -y
- name: gpsd-clients installation
command: sudo apt install gpsd-clients -y
- name: pps-tools installation
command: sudo apt install pps-tools -y
- name: systemctl enable gpsd
command: sudo systemctl enable gpsd.socket
- name: Copy a new config gpsd device functionality
blockinfile: |
dest=/boot/config.txt
content="dtoverlay=pps-gpio,gpiopin=18
enable_uart=1
init_uart_baud=9600"
- name: Copy a new pps GPIO device in modules
blockinfile: |
dest=/etc/modules
content="pps-gpio"
- name: gpsd port pointer
command: sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock
- name: Copy a new config gpsd device functionality
copy:
src: /etc/default/gpsd
dest: /etc/default/gpsd
- name: Reconfigure gpsd
command: sudo dpkg-reconfigure gpsd
- name: Remove IPv6 bind
copy:
src: /home/pi/ansible/gpsd.socket
dest: /lib/systemd/system/gpsd.socket
- name: ntp uninstall
command: sudo apt remove ntp -y
- name: chrony installation
command: sudo apt install chrony -y
- name: chrony config file GPS time synchronization
copy:
src: /etc/chrony/chrony.conf
dest: /etc/chrony/chrony.conf
- name: systemctl enable chrony
command: sudo systemctl restart chrony
- hosts: sniffers
user: gta
become: yes
become_user: root
tasks:
- name: Switch off predictable mechanism stuff
command: ls -nfs /dev/null /etc/systemd/network/99-default.link
- name: Copy new rules to identify interfaces based on USB positions
copy:
src: /etc/udev/rules.d/72-wlan-geo-dependent.rules
dest: /etc/udev/rules.d/72-wlan-geo-dependent.rules
- name: Exchange Keys between servers
hosts: sniffers
tasks:
- name: SSH KeyGen command
tags: run
shell: >
ssh-keygen -q -b 2048 -t rsa -N "" -C "creating SSH" -f ~/.ssh/id_rsa
creates="~/.ssh/id_rsa"
- name: Fetch the keyfile from the node to master
tags: run
fetch:
src: "~/.ssh/id_rsa.pub"
dest: "buffer/{{ansible_hostname}}-id_rsa.pub"
flat: yes
- name: Copy the key add to authorized_keys using Ansible module
tags: runcd
authorized_key:
user: gta
state: present
key: "{{ lookup('file','buffer/{{item}}-id_rsa.pub')}}"
when: "item != ansible_hostname"
with_items:
- "{{ groups['sniffers'] }}"
- hosts: sniffers
user: gta
#become: yes
#become_user: root
vars:
src_file: "/home/gta/sniffers/scapy-sniffer/capture-*.pcap"
dest_file: "/Users/fmolano/ansible/files/"
cap_file: capture-*
tasks:
- name: find files to copy
find:
paths: "/home/gta/sniffers/scapy-sniffer/"
recurse: no
patterns: "*.pcap"
register: files_to_copy
- name: Copy files
fetch:
src: "{{ item.path }}"
dest: /Users/fmolano/ansible/files/{{ ansible_hostname }}_{{ ansible_date_time.date }}/
flat: yes
with_items: "{{ files_to_copy.files }}"
\ No newline at end of file
- hosts: all
tasks:
- name: set system hostname
command: sudo hostnamectl set-hostname {{ inventory_hostname }}
- name: host file update - Local DNS setup across all the servers
hosts: sniffers
gather_facts: yes
tasks:
- name: Update the /etc/hosts file with node name
tags: etchostsupdate
become: yes
become_user: root
lineinfile:
dest: "/etc/hosts"
regexp: ".*\t{{ hostvars[item]['ansible_hostname']}}\t{{ hostvars[item]['ansible_hostname']}}"
line: "{{ hostvars[item]['ansible_default_ipv4']['address'] }}\t{{ hostvars[item]['ansible_hostname']}}\t{{ hostvars[item]['ansible_hostname']}}"
state: present
register: etchostsupdate
when:
ansible_hostname != "item" or ansible_hostname == "item"
with_items: "{{groups['sniffers']}}"
- hosts: sniffers
user: gta
#become: yes
#become_user: root
vars_prompt:
- name: _file
prompt: Enter the folder name to save traces in the sniffer
private: no
- name: _location
prompt: Enter the location of the experiments
private: no
- name: _hour
prompt: Enter an hour to start the experiment
private: no
- name: _minute
prompt: Enter minutes to start the experiment
private: no
- name: _timeout
prompt: Please specify the runtime duration in sec
private: no
- name: _interface
prompt: Please specify the interface (e.g. wlan0). For default just press enter
default: 'wlan1'
private: no
- name: _filter
prompt: Please choose the filter to apply to packet capture. For default just press enter
default: 'type mgt and (subtype probe-req or subtype probe-resp or subtype beacon)'
private: no
- name: _channel
prompt: Please specify the channel (integer between 1-11, default=system). For default just press enter
default: 1
private: no
- name: _hash_function
prompt: Please specify the hash function (None, MD5, SHA256). For default just press enter
default: 'MD5'
private: no
- name: _hash_pattern
prompt: Please specify the bitmask for hashing of MAC1, MAC2, MAC3 and SSID (integer between 0-15, default=15). For default just press enter
default: 15
private: no
tasks:
- name: Create Folder
file:
path: "{{ _file }}"
owner: gta
group: gta
#mode: 0755
state: directory
- name: start scapy-sniffer
cron:
name: "ansible_scapy-sniffer {{ _hour }} {{ _minute }} {{ _channel }}"
minute: "{{ _minute }}"
hour: "{{ _hour }}"
job: "sudo python3 /home/gta/sniffers/scapy-sniffer/sniffer_GPS.py -F {{ _file }} -L {{ _location }} -i {{ _interface }} -c {{ _channel }} -f {{ _filter }} -e {{ _hash_function}} -p {{ _hash_pattern }} -t {{ _timeout }}"
\ No newline at end of file
[defaults]
# (boolean) By default, Ansible will issue a warning when received from a task action (module or action plugin).
# These warnings can be silenced by adjusting this setting to False.
;action_warnings=True
# (list) Accept a list of cowsay templates that are 'safe' to use, set to an empty list if you want to enable all installed templates.
;cowsay_enabled_stencils=bud-frogs, bunny, cheese, daemon, default, dragon, elephant-in-snake, elephant, eyes, hellokitty, kitty, luke-koala, meow, milk, moofasa, moose, ren, sheep, small, stegosaurus, stimpy, supermilker, three-eyes, turkey, turtle, tux, udder, vader-koala, vader, www
# (string) Specify a custom cowsay path or swap in your cowsay implementation of choice.
;cowpath=
# (string) This allows you to choose a specific cowsay stencil for the banners or use 'random' to cycle through them.
;cow_selection=default
# (boolean) This option forces color mode even when running without a TTY or the "nocolor" setting is True.
;force_color=False
# (path) The default root path for Ansible config files on the controller.
;home=~/.ansible
# (boolean) This setting allows suppressing colorizing output, which is used to give a better indication of failure and status information.
;nocolor=False
# (boolean) If you have cowsay installed but want to avoid the 'cows' (why????), use this.
;nocows=False
# (boolean) Sets the default value for the any_errors_fatal keyword, if True, Task failures will be considered fatal errors.
;any_errors_fatal=False
# (path) The password file to use for the become plugin. ``--become-password-file``.
# If executable, it will be run and the resulting stdout will be used as the password.
;become_password_file=
# (pathspec) Colon-separated paths in which Ansible will search for Become Plugins.
;become_plugins=/home/guigui/.ansible/plugins/become:/usr/share/ansible/plugins/become
# (string) Chooses which cache plugin to use, the default 'memory' is ephemeral.
;fact_caching=memory
# (string) Defines connection or path information for the cache plugin.
;fact_caching_connection=
# (string) Prefix to use for cache plugin files/tables.
;fact_caching_prefix=ansible_facts
# (integer) Expiration timeout for the cache plugin data.
;fact_caching_timeout=86400
# (list) List of enabled callbacks, not all callbacks need enabling, but many of those shipped with Ansible do as we don't want them activated by default.
;callbacks_enabled=
# (string) When a collection is loaded that does not support the running Ansible version (with the collection metadata key `requires_ansible`).
;collections_on_ansible_version_mismatch=warning
# (pathspec) Colon-separated paths in which Ansible will search for collections content. Collections must be in nested *subdirectories*, not directly in these directories. For example, if ``COLLECTIONS_PATHS`` includes ``'{{ ANSIBLE_HOME ~ "/collections" }}'``, and you want to add ``my.collection`` to that directory, it must be saved as ``'{{ ANSIBLE_HOME} ~ "/collections/ansible_collections/my/collection" }}'``.
;collections_path=/home/guigui/.ansible/collections:/usr/share/ansible/collections
# (boolean) A boolean to enable or disable scanning the sys.path for installed collections.
;collections_scan_sys_path=True
# (path) The password file to use for the connection plugin. ``--connection-password-file``.
;connection_password_file=
# (pathspec) Colon-separated paths in which Ansible will search for Action Plugins.
;action_plugins=/home/guigui/.ansible/plugins/action:/usr/share/ansible/plugins/action
# (boolean) When enabled, this option allows lookup plugins (whether used in variables as ``{{lookup('foo')}}`` or as a loop as with_foo) to return data that is not marked 'unsafe'.
# By default, such data is marked as unsafe to prevent the templating engine from evaluating any jinja2 templating language, as this could represent a security risk. This option is provided to allow for backward compatibility, however, users should first consider adding allow_unsafe=True to any lookups that may be expected to contain data that may be run through the templating engine late.
;allow_unsafe_lookups=False
# (boolean) This controls whether an Ansible playbook should prompt for a login password. If using SSH keys for authentication, you probably do not need to change this setting.
;ask_pass=False
# (boolean) This controls whether an Ansible playbook should prompt for a vault password.
;ask_vault_pass=False
# (pathspec) Colon-separated paths in which Ansible will search for Cache Plugins.
;cache_plugins=/home/guigui/.ansible/plugins/cache:/usr/share/ansible/plugins/cache
# (pathspec) Colon-separated paths in which Ansible will search for Callback Plugins.
;callback_plugins=/home/guigui/.ansible/plugins/callback:/usr/share/ansible/plugins/callback
# (pathspec) Colon-separated paths in which Ansible will search for Cliconf Plugins.
;cliconf_plugins=/home/guigui/.ansible/plugins/cliconf:/usr/share/ansible/plugins/cliconf
# (pathspec) Colon-separated paths in which Ansible will search for Connection Plugins.
;connection_plugins=/home/guigui/.ansible/plugins/connection:/usr/share/ansible/plugins/connection
# (boolean) Toggles debug output in Ansible. This is *very* verbose and can hinder multiprocessing. Debug output can also include secret information despite no_log settings being enabled, which means debug mode should not be used in production.
;debug=False
# (string) This indicates the command to use to spawn a shell under, which is required for Ansible's execution needs on a target. Users may need to change this in rare instances when shell usage is constrained, but in most cases, it may be left as is.
;executable=/bin/bash
# (string) This option allows you to globally configure a custom path for 'local_facts' for the implied :ref:`ansible_collections.ansible.builtin.setup_module` task when using fact gathering.
# If not set, it will fall back to the default from the ``ansible.builtin.setup`` module: ``/etc/ansible/facts.d``.
# This does **not** affect user defined tasks that use the ``ansible.builtin.setup`` module.
# The real action being created by the implicit task is currently ``ansible.legacy.gather_facts`` module, which then calls the configured fact modules, by default this will be ``ansible.builtin.setup`` for POSIX systems but other platforms might have different defaults.
;fact_path=
# (pathspec) Colon-separated paths in which Ansible will search for Jinja2 Filter Plugins.
;filter_plugins=/home/guigui/.ansible/plugins/filter:/usr/share/ansible/plugins/filter
# (boolean) This option controls if notified handlers run on a host even if a failure occurs on that host.
# When false, the handlers will not run if a failure has occurred on a host.
# This can also be set per play or on the command line. See Handlers and Failure for more details.
;force_handlers=False
# (integer) Maximum number of forks Ansible will use to execute tasks on target hosts.
;forks=5
# (string) This setting controls the default policy of fact gathering (facts discovered about remote systems).
# This option can be useful for those wishing to save fact gathering time. Both 'smart' and 'explicit' will use the cache plugin.
;gathering=implicit
# (list) Set the `gather_subset` option for the :ref:`ansible_collections.ansible.builtin.setup_module` task in the implicit fact gathering. See the module documentation for specifics.
# It does **not** apply to user defined ``ansible.builtin.setup`` tasks.
;gather_subset=
# (integer) Set the timeout in seconds for the implicit fact gathering, see the module documentation for specifics.
# It does **not** apply to user defined :ref:`ansible_collections.ansible.builtin.setup_module` tasks.
;gather_timeout=
# (string) This setting controls how duplicate definitions of dictionary variables (aka hash, map, associative array) are handled in Ansible.
# This does not affect variables whose values are scalars (integers, strings) or arrays.
# **WARNING**, changing this setting is not recommended as this is fragile and makes your content (plays, roles, collections) nonportable, leading to continual confusion and misuse. Don't change this setting unless you think you have an absolute need for it.
# We recommend avoiding reusing variable names and relying on the ``combine`` filter and ``vars`` and ``varnames`` lookups to create merged versions of the individual variables. In our experience, this is rarely needed and is a sign that too much complexity has been introduced into the data structures and plays.
# For some uses you can also look into custom vars_plugins to merge on input, even substituting the default ``host_group_vars`` that is in charge of parsing the ``host_vars/`` and ``group_vars/`` directories. Most users of this setting are only interested in inventory scope, but the setting itself affects all sources and makes debugging even harder.
# All playbooks and roles in the official examples repos assume the default for this setting.
# Changing the setting to ``merge`` applies across variable sources, but many sources will internally still overwrite the variables. For example ``include_vars`` will dedupe variables internally before updating Ansible, with 'last defined' overwriting previous definitions in same file.
# The Ansible project recommends you **avoid ``merge`` for new projects.**
# It is the intention of the Ansible developers to eventually deprecate and remove this setting, but it is being kept as some users do heavily rely on it. New projects should **avoid 'merge'**.
;hash_behaviour=replace
# (pathlist) Comma-separated list of Ansible inventory sources
inventory=./inventory
# (pathspec) Colon-separated paths in which Ansible will search for HttpApi Plugins.
;httpapi_plugins=/home/guigui/.ansible/plugins/httpapi:/usr/share/ansible/plugins/httpapi
# (float) This sets the interval (in seconds) of Ansible internal processes polling each other. Lower values improve performance with large playbooks at the expense of extra CPU load. Higher values are more suitable for Ansible usage in automation scenarios when UI responsiveness is not required but CPU usage might be a concern.
# The default corresponds to the value hardcoded in Ansible <= 2.1
;internal_poll_interval=0.001
# (pathspec) Colon-separated paths in which Ansible will search for Inventory Plugins.
;inventory_plugins=/home/guigui/.ansible/plugins/inventory:/usr/share/ansible/plugins/inventory
# (string) This is a developer-specific feature that allows enabling additional Jinja2 extensions.
# See the Jinja2 documentation for details. If you do not know what these do, you probably don't need to change this setting :)
;jinja2_extensions=[]
# (boolean) This option preserves variable types during template operations.
;jinja2_native=False
# (boolean) Enables/disables the cleaning up of the temporary files Ansible used to execute the tasks on the remote.
# If this option is enabled it will disable ``ANSIBLE_PIPELINING``.
;keep_remote_files=False
# (boolean) Controls whether callback plugins are loaded when running /usr/bin/ansible. This may be used to log activity from the command line, send notifications, and so on. Callback plugins are always loaded for ``ansible-playbook``.
;bin_ansible_callbacks=False
# (tmppath) Temporary directory for Ansible to use on the controller.
;local_tmp=/home/guigui/.ansible/tmp
# (list) List of logger names to filter out of the log file.
;log_filter=
# (path) File to which Ansible will log on the controller. When empty logging is disabled.
;log_path=
# (pathspec) Colon-separated paths in which Ansible will search for Lookup Plugins.
;lookup_plugins=/home/guigui/.ansible/plugins/lookup:/usr/share/ansible/plugins/lookup
# (string) Sets the macro for the 'ansible_managed' variable available for :ref:`ansible_collections.ansible.builtin.template_module` and :ref:`ansible_collections.ansible.windows.win_template_module`. This is only relevant to those two modules.
;ansible_managed=Ansible managed
# (string) This sets the default arguments to pass to the ``ansible`` adhoc binary if no ``-a`` is specified.
;module_args=
# (string) Compression scheme to use when transferring Python modules to the target.
;module_compression=ZIP_DEFLATED
# (string) Module to use with the ``ansible`` AdHoc command, if none is specified via ``-m``.
;module_name=command
# (pathspec) Colon-separated paths in which Ansible will search for Modules.
;library=/home/guigui/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
# (pathspec) Colon-separated paths in which Ansible will search for Module utils files, which are shared by modules.
;module_utils=/home/guigui/.ansible/plugins/module_utils:/usr/share/ansible/plugins/module_utils
# (pathspec) Colon-separated paths in which Ansible will search for Netconf Plugins.
;netconf_plugins=/home/guigui/.ansible/plugins/netconf:/usr/share/ansible/plugins/netconf
# (boolean) Toggle Ansible's display and logging of task details, mainly used to avoid security disclosures.
;no_log=False
# (boolean) Toggle Ansible logging to syslog on the target when it executes tasks. On Windows hosts, this will disable a newer style PowerShell modules from writing to the event log.
;no_target_syslog=False
# (raw) What templating should return as a 'null' value. When not set it will let Jinja2 decide.
;null_representation=
# (integer) For asynchronous tasks in Ansible (covered in Asynchronous Actions and Polling), this is how often to check back on the status of those tasks when an explicit poll interval is not supplied. The default is a reasonably moderate 15 seconds which is a tradeoff between checking in frequently and providing a quick turnaround when something may have completed.
;poll_interval=15
# (path) Option for connections using a certificate or key file to authenticate, rather than an agent or passwords, you can set the default value here to avoid re-specifying ``--private-key`` with every invocation.
;private_key_file=
# (boolean) By default, imported roles publish their variables to the play and other roles, this setting can avoid that.
# This was introduced as a way to reset role variables to default values if a role is used more than once in a playbook.
# Starting in version '2.17' M(ansible.builtin.include_roles) and M(ansible.builtin.import_roles) can indivudually override this via the C(public) parameter.
# Included roles only make their variables public at execution, unlike imported roles which happen at playbook compile time.
;private_role_vars=False
# (integer) Port to use in remote connections, when blank it will use the connection plugin default.
;remote_port=
# (string) Sets the login user for the target machines
# When blank it uses the connection plugin's default, normally the user currently executing Ansible.
;remote_user=
# (pathspec) Colon-separated paths in which Ansible will search for Roles.
;roles_path=/home/guigui/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
# (string) Set the main callback used to display Ansible output. You can only have one at a time.
# You can have many other callbacks, but just one can be in charge of stdout.
# See :ref:`callback_plugins` for a list of available options.
;stdout_callback=default
# (string) Set the default strategy used for plays.
;strategy=linear
# (pathspec) Colon-separated paths in which Ansible will search for Strategy Plugins.
;strategy_plugins=/home/guigui/.ansible/plugins/strategy:/usr/share/ansible/plugins/strategy
# (boolean) Toggle the use of "su" for tasks.
;su=False
# (string) Syslog facility to use when Ansible logs to the remote target.
;syslog_facility=LOG_USER
# (pathspec) Colon-separated paths in which Ansible will search for Terminal Plugins.
;terminal_plugins=/home/guigui/.ansible/plugins/terminal:/usr/share/ansible/plugins/terminal
# (pathspec) Colon-separated paths in which Ansible will search for Jinja2 Test Plugins.
;test_plugins=/home/guigui/.ansible/plugins/test:/usr/share/ansible/plugins/test
# (integer) This is the default timeout for connection plugins to use.
;timeout=10
# (string) Can be any connection plugin available to your ansible installation.
# There is also a (DEPRECATED) special 'smart' option, that will toggle between 'ssh' and 'paramiko' depending on controller OS and ssh versions.
;transport=ssh
# (boolean) When True, this causes ansible templating to fail steps that reference variable names that are likely typoed.
# Otherwise, any '{{ template_expression }}' that contains undefined variables will be rendered in a template or ansible action line exactly as written.
;error_on_undefined_vars=True
# (pathspec) Colon-separated paths in which Ansible will search for Vars Plugins.
;vars_plugins=/home/guigui/.ansible/plugins/vars:/usr/share/ansible/plugins/vars
# (string) The vault_id to use for encrypting by default. If multiple vault_ids are provided, this specifies which to use for encryption. The ``--encrypt-vault-id`` CLI option overrides the configured value.
;vault_encrypt_identity=
# (string) The label to use for the default vault id label in cases where a vault id label is not provided.
;vault_identity=default
# (list) A list of vault-ids to use by default. Equivalent to multiple ``--vault-id`` args. Vault-ids are tried in order.
;vault_identity_list=
# (string) If true, decrypting vaults with a vault id will only try the password from the matching vault-id.
;vault_id_match=False
# (path) The vault password file to use. Equivalent to ``--vault-password-file`` or ``--vault-id``.
# If executable, it will be run and the resulting stdout will be used as the password.
;vault_password_file=
# (integer) Sets the default verbosity, equivalent to the number of ``-v`` passed in the command line.
;verbosity=0
# (boolean) Toggle to control the showing of deprecation warnings
;deprecation_warnings=True
# (boolean) Toggle to control showing warnings related to running devel.
;devel_warning=True
# (boolean) Normally ``ansible-playbook`` will print a header for each task that is run. These headers will contain the name: field from the task if you specified one. If you didn't then ``ansible-playbook`` uses the task's action to help you tell which task is presently running. Sometimes you run many of the same action and so you want more information about the task to differentiate it from others of the same action. If you set this variable to True in the config then ``ansible-playbook`` will also include the task's arguments in the header.
# This setting defaults to False because there is a chance that you have sensitive values in your parameters and you do not want those to be printed.
# If you set this to True you should be sure that you have secured your environment's stdout (no one can shoulder surf your screen and you aren't saving stdout to an insecure file) or made sure that all of your playbooks explicitly added the ``no_log: True`` parameter to tasks that have sensitive values :ref:`keep_secret_data` for more information.
;display_args_to_stdout=False
# (boolean) Toggle to control displaying skipped task/host entries in a task in the default callback.
;display_skipped_hosts=True
# (string) Root docsite URL used to generate docs URLs in warning/error text; must be an absolute URL with a valid scheme and trailing slash.
;docsite_root_url=https://docs.ansible.com/ansible-core/
# (pathspec) Colon-separated paths in which Ansible will search for Documentation Fragments Plugins.
;doc_fragment_plugins=/home/guigui/.ansible/plugins/doc_fragments:/usr/share/ansible/plugins/doc_fragments
# (string) By default, Ansible will issue a warning when a duplicate dict key is encountered in YAML.
# These warnings can be silenced by adjusting this setting to False.
;duplicate_dict_key=warn
# (boolean) Whether or not to enable the task debugger, this previously was done as a strategy plugin.
# Now all strategy plugins can inherit this behavior. The debugger defaults to activating when
# a task is failed on unreachable. Use the debugger keyword for more flexibility.
;enable_task_debugger=False
# (boolean) Toggle to allow missing handlers to become a warning instead of an error when notifying.
;error_on_missing_handler=True
# (list) Which modules to run during a play's fact gathering stage, using the default of 'smart' will try to figure it out based on connection type.
# If adding your own modules but you still want to use the default Ansible facts, you will want to include 'setup' or corresponding network module to the list (if you add 'smart', Ansible will also figure it out).
# This does not affect explicit calls to the 'setup' module, but does always affect the 'gather_facts' action (implicit or explicit).
;facts_modules=smart
# (boolean) Set this to "False" if you want to avoid host key checking by the underlying connection plugin Ansible uses to connect to the host.
# Please read the documentation of the specific connection plugin used for details.
;host_key_checking=True
# (boolean) Facts are available inside the `ansible_facts` variable, this setting also pushes them as their own vars in the main namespace.
# Unlike inside the `ansible_facts` dictionary where the prefix `ansible_` is removed from fact names, these will have the exact names that are returned by the module.
;inject_facts_as_vars=True
# (string) Path to the Python interpreter to be used for module execution on remote targets, or an automatic discovery mode. Supported discovery modes are ``auto`` (the default), ``auto_silent``, ``auto_legacy``, and ``auto_legacy_silent``. All discovery modes employ a lookup table to use the included system Python (on distributions known to include one), falling back to a fixed ordered list of well-known Python interpreter locations if a platform-specific default is not available. The fallback behavior will issue a warning that the interpreter should be set explicitly (since interpreters installed later may change which one is used). This warning behavior can be disabled by setting ``auto_silent`` or ``auto_legacy_silent``. The value of ``auto_legacy`` provides all the same behavior, but for backward-compatibility with older Ansible releases that always defaulted to ``/usr/bin/python``, will use that interpreter if present.
;interpreter_python=/usr/bin/python3.11
# (boolean) If 'false', invalid attributes for a task will result in warnings instead of errors.
;invalid_task_attribute_failed=True
# (boolean) By default, Ansible will issue a warning when there are no hosts in the inventory.
# These warnings can be silenced by adjusting this setting to False.
;localhost_warning=True
# (int) This will set log verbosity if higher than the normal display verbosity, otherwise it will match that.
;log_verbosity=
# (int) Maximum size of files to be considered for diff display.
;max_diff_size=104448
# (list) List of extensions to ignore when looking for modules to load.
# This is for rejecting script and binary module fallback extensions.
;module_ignore_exts=.pyc, .pyo, .swp, .bak, ~, .rpm, .md, .txt, .rst, .yaml, .yml, .ini
# (bool) Enables whether module responses are evaluated for containing non-UTF-8 data.
# Disabling this may result in unexpected behavior.
# Only ansible-core should evaluate this configuration.
;module_strict_utf8_response=True
# (list) TODO: write it
;network_group_modules=eos, nxos, ios, iosxr, junos, enos, ce, vyos, sros, dellos9, dellos10, dellos6, asa, aruba, aireos, bigip, ironware, onyx, netconf, exos, voss, slxos
# (boolean) Previously Ansible would only clear some of the plugin loading caches when loading new roles, this led to some behaviors in which a plugin loaded in previous plays would be unexpectedly 'sticky'. This setting allows the user to return to that behavior.
;old_plugin_cache_clear=False
# (path) A number of non-playbook CLIs have a ``--playbook-dir`` argument; this sets the default value for it.
;playbook_dir=
# (string) This sets which playbook dirs will be used as a root to process vars plugins, which includes finding host_vars/group_vars.
;playbook_vars_root=top
# (path) A path to configuration for filtering which plugins installed on the system are allowed to be used.
# See :ref:`plugin_filtering_config` for details of the filter file's format.
# The default is /etc/ansible/plugin_filters.yml
;plugin_filters_cfg=
# (string) Attempts to set RLIMIT_NOFILE soft limit to the specified value when executing Python modules (can speed up subprocess usage on Python 2.x. See https://bugs.python.org/issue11284). The value will be limited by the existing hard limit. Default value of 0 does not attempt to adjust existing system-defined limits.
;python_module_rlimit_nofile=0
# (bool) This controls whether a failed Ansible playbook should create a .retry file.
;retry_files_enabled=False
# (path) This sets the path in which Ansible will save .retry files when a playbook fails and retry files are enabled.
# This file will be overwritten after each run with the list of failed hosts from all plays.
;retry_files_save_path=
# (str) This setting can be used to optimize vars_plugin usage depending on the user's inventory size and play selection.
;run_vars_plugins=demand
# (bool) This adds the custom stats set via the set_stats plugin to the default output.
;show_custom_stats=False
# (string) Action to take when a module parameter value is converted to a string (this does not affect variables). For string parameters, values such as '1.00', "['a', 'b',]", and 'yes', 'y', etc. will be converted by the YAML parser unless fully quoted.
# Valid options are 'error', 'warn', and 'ignore'.
# Since 2.8, this option defaults to 'warn' but will change to 'error' in 2.12.
;string_conversion_action=warn
# (boolean) Allows disabling of warnings related to potential issues on the system running Ansible itself (not on the managed hosts).
# These may include warnings about third-party packages or other conditions that should be resolved if possible.
;system_warnings=True
# (string) A string to insert into target logging for tracking purposes
;target_log_info=
# (boolean) This option defines whether the task debugger will be invoked on a failed task when ignore_errors=True is specified.
# True specifies that the debugger will honor ignore_errors, and False will not honor ignore_errors.
;task_debugger_ignore_errors=True
# (integer) Set the maximum time (in seconds) that a task can run for.
# If set to 0 (the default) there is no timeout.
;task_timeout=0
# (string) Make ansible transform invalid characters in group names supplied by inventory sources.
;force_valid_group_names=never
# (boolean) Toggles the use of persistence for connections.
;use_persistent_connections=False
# (bool) A toggle to disable validating a collection's 'metadata' entry for a module_defaults action group. Metadata containing unexpected fields or value types will produce a warning when this is True.
;validate_action_group_metadata=True
# (list) Accept list for variable plugins that require it.
;vars_plugins_enabled=host_group_vars
# (list) Allows to change the group variable precedence merge order.
;precedence=all_inventory, groups_inventory, all_plugins_inventory, all_plugins_play, groups_plugins_inventory, groups_plugins_play
# (string) The salt to use for the vault encryption. If it is not provided, a random salt will be used.
;vault_encrypt_salt=
# (bool) Force 'verbose' option to use stderr instead of stdout
;verbose_to_stderr=False
# (integer) For asynchronous tasks in Ansible (covered in Asynchronous Actions and Polling), this is how long, in seconds, to wait for the task spawned by Ansible to connect back to the named pipe used on Windows systems. The default is 5 seconds. This can be too low on slower systems, or systems under heavy load.
# This is not the total time an async command can run for, but is a separate timeout to wait for an async command to start. The task will only start to be timed against its async_timeout once it has connected to the pipe, so the overall maximum duration the task can take will be extended by the amount specified here.
;win_async_startup_timeout=5
# (list) Check all of these extensions when looking for 'variable' files which should be YAML or JSON or vaulted versions of these.
# This affects vars_files, include_vars, inventory and vars plugins among others.
;yaml_valid_extensions=.yml, .yaml, .json
[privilege_escalation]
# (boolean) Display an agnostic become prompt instead of displaying a prompt containing the command line supplied become method.
;agnostic_become_prompt=True
# (boolean) When ``False``(default), Ansible will skip using become if the remote user is the same as the become user, as this is normally a redundant operation. In other words root sudo to root.
# If ``True``, this forces Ansible to use the become plugin anyways as there are cases in which this is needed.
;become_allow_same_user=False
# (boolean) Toggles the use of privilege escalation, allowing you to 'become' another user after login.
;become=False
# (boolean) Toggle to prompt for privilege escalation password.
;become_ask_pass=False
# (string) executable to use for privilege escalation, otherwise Ansible will depend on PATH.
;become_exe=
# (string) Flags to pass to the privilege escalation executable.
;become_flags=
# (string) Privilege escalation method to use when `become` is enabled.
;become_method=sudo
# (string) The user your login/remote user 'becomes' when using privilege escalation, most systems will use 'root' when no user is specified.
;become_user=root
[persistent_connection]
# (path) Specify where to look for the ansible-connection script. This location will be checked before searching $PATH.
# If null, ansible will start with the same directory as the ansible script.
;ansible_connection_path=
# (int) This controls the amount of time to wait for a response from a remote device before timing out a persistent connection.
;command_timeout=30
# (integer) This controls the retry timeout for persistent connection to connect to the local domain socket.
;connect_retry_timeout=15
# (integer) This controls how long the persistent connection will remain idle before it is destroyed.
;connect_timeout=30
# (path) Path to the socket to be used by the connection persistence system.
;control_path_dir=/home/guigui/.ansible/pc
[connection]
# (boolean) This is a global option, each connection plugin can override either by having more specific options or not supporting pipelining at all.
# Pipelining, if supported by the connection plugin, reduces the number of network operations required to execute a module on the remote server, by executing many Ansible modules without actual file transfer.
# It can result in a very significant performance improvement when enabled.
# However this conflicts with privilege escalation (become). For example, when using 'sudo:' operations you must first disable 'requiretty' in /etc/sudoers on all managed hosts, which is why it is disabled by default.
# This setting will be disabled if ``ANSIBLE_KEEP_REMOTE_FILES`` is enabled.
;pipelining=False
[colors]
# (string) Defines the color to use on 'Changed' task status.
;changed=yellow
# (string) Defines the default color to use for ansible-console.
;console_prompt=white
# (string) Defines the color to use when emitting debug messages.
;debug=dark gray
# (string) Defines the color to use when emitting deprecation messages.
;deprecate=purple
# (string) Defines the color to use when showing added lines in diffs.
;diff_add=green
# (string) Defines the color to use when showing diffs.
;diff_lines=cyan
# (string) Defines the color to use when showing removed lines in diffs.
;diff_remove=red
# (string) Defines the color to use when emitting error messages.
;error=red
# (string) Defines the color to use for highlighting.
;highlight=white
# (string) Defines the color to use when showing 'OK' task status.
;ok=green
# (string) Defines the color to use when showing 'Skipped' task status.
;skip=cyan
# (string) Defines the color to use on 'Unreachable' status.
;unreachable=bright red
# (string) Defines the color to use when emitting verbose messages. In other words, those that show with '-v's.
;verbose=blue
# (string) Defines the color to use when emitting warning messages.
;warn=bright purple
[selinux]
# (boolean) This setting causes libvirt to connect to LXC containers by passing ``--noseclabel`` parameter to ``virsh`` command. This is necessary when running on systems which do not have SELinux.
;libvirt_lxc_noseclabel=False
# (list) Some filesystems do not support safe operations and/or return inconsistent errors, this setting makes Ansible 'tolerate' those in the list without causing fatal errors.
# Data corruption may occur and writes are not always verified when a filesystem is in the list.
;special_context_filesystems=fuse, nfs, vboxsf, ramfs, 9p, vfat
[diff]
# (bool) Configuration toggle to tell modules to show differences when in 'changed' status, equivalent to ``--diff``.
;always=False
# (integer) Number of lines of context to show when displaying the differences between files.
;context=3
[galaxy]
# (path) The directory that stores cached responses from a Galaxy server.
# This is only used by the ``ansible-galaxy collection install`` and ``download`` commands.
# Cache files inside this dir will be ignored if they are world writable.
;cache_dir=/home/guigui/.ansible/galaxy_cache
# (bool) whether ``ansible-galaxy collection install`` should warn about ``--collections-path`` missing from configured :ref:`collections_paths`.
;collections_path_warning=True
# (path) Collection skeleton directory to use as a template for the ``init`` action in ``ansible-galaxy collection``, same as ``--collection-skeleton``.
;collection_skeleton=
# (list) patterns of files to ignore inside a Galaxy collection skeleton directory.
;collection_skeleton_ignore=^.git$, ^.*/.git_keep$
# (bool) Disable GPG signature verification during collection installation.
;disable_gpg_verify=False
# (bool) Some steps in ``ansible-galaxy`` display a progress wheel which can cause issues on certain displays or when outputting the stdout to a file.
# This config option controls whether the display wheel is shown or not.
# The default is to show the display wheel if stdout has a tty.
;display_progress=
# (path) Configure the keyring used for GPG signature verification during collection installation and verification.
;gpg_keyring=
# (boolean) If set to yes, ansible-galaxy will not validate TLS certificates. This can be useful for testing against a server with a self-signed certificate.
;ignore_certs=
# (list) A list of GPG status codes to ignore during GPG signature verification. See L(https://github.com/gpg/gnupg/blob/master/doc/DETAILS#general-status-codes) for status code descriptions.
# If fewer signatures successfully verify the collection than `GALAXY_REQUIRED_VALID_SIGNATURE_COUNT`, signature verification will fail even if all error codes are ignored.
;ignore_signature_status_codes=
# (str) The number of signatures that must be successful during GPG signature verification while installing or verifying collections.
# This should be a positive integer or all to indicate all signatures must successfully validate the collection.
# Prepend + to the value to fail if no valid signatures are found for the collection.
;required_valid_signature_count=1
# (path) Role skeleton directory to use as a template for the ``init`` action in ``ansible-galaxy``/``ansible-galaxy role``, same as ``--role-skeleton``.
;role_skeleton=
# (list) patterns of files to ignore inside a Galaxy role or collection skeleton directory.
;role_skeleton_ignore=^.git$, ^.*/.git_keep$
# (string) URL to prepend when roles don't specify the full URI, assume they are referencing this server as the source.
;server=https://galaxy.ansible.com
# (list) A list of Galaxy servers to use when installing a collection.
# The value corresponds to the config ini header ``[galaxy_server.{{item}}]`` which defines the server details.
# See :ref:`galaxy_server_config` for more details on how to define a Galaxy server.
# The order of servers in this list is used as the order in which a collection is resolved.
# Setting this config option will ignore the :ref:`galaxy_server` config option.
;server_list=
# (int) The default timeout for Galaxy API calls. Galaxy servers that don't configure a specific timeout will fall back to this value.
;server_timeout=60
# (path) Local path to galaxy access token file
;token_path=/home/guigui/.ansible/galaxy_token
[inventory]
# (string) This setting changes the behaviour of mismatched host patterns, it allows you to force a fatal error, a warning or just ignore it.
;host_pattern_mismatch=warning
# (boolean) If 'true', it is a fatal error when any given inventory source cannot be successfully parsed by any available inventory plugin; otherwise, this situation only attracts a warning.
;any_unparsed_is_failed=False
# (bool) Toggle to turn on inventory caching.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory configuration.
# This message will be removed in 2.16.
;cache=False
# (string) The plugin for caching inventory.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration.
# This message will be removed in 2.16.
;cache_plugin=
# (string) The inventory cache connection.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration.
# This message will be removed in 2.16.
;cache_connection=
# (string) The table prefix for the cache plugin.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration.
# This message will be removed in 2.16.
;cache_prefix=ansible_inventory_
# (string) Expiration timeout for the inventory cache plugin data.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration.
# This message will be removed in 2.16.
;cache_timeout=3600
# (list) List of enabled inventory plugins, it also determines the order in which they are used.
;enable_plugins=host_list, script, auto, yaml, ini, toml
# (bool) Controls if ansible-inventory will accurately reflect Ansible's view into inventory or its optimized for exporting.
;export=False
# (list) List of extensions to ignore when using a directory as an inventory source.
;ignore_extensions=.pyc, .pyo, .swp, .bak, ~, .rpm, .md, .txt, .rst, .orig, .ini, .cfg, .retry
# (list) List of patterns to ignore when using a directory as an inventory source.
;ignore_patterns=
# (bool) If 'true' it is a fatal error if every single potential inventory source fails to parse, otherwise, this situation will only attract a warning.
;unparsed_is_failed=False
# (boolean) By default, Ansible will issue a warning when no inventory was loaded and notes that it will use an implicit localhost-only inventory.
# These warnings can be silenced by adjusting this setting to False.
;inventory_unparsed_warning=True
[netconf_connection]
# (string) This variable is used to enable bastion/jump host with netconf connection. If set to True the bastion/jump host ssh settings should be present in ~/.ssh/config file, alternatively it can be set to custom ssh configuration file path to read the bastion/jump host settings.
;ssh_config=
[paramiko_connection]
# (boolean) TODO: write it
;host_key_auto_add=False
# (boolean) TODO: write it
;look_for_keys=True
[jinja2]
# (list) This list of filters avoids 'type conversion' when templating variables.
# Useful when you want to avoid conversion into lists or dictionaries for JSON strings, for example.
;dont_type_filters=string, to_json, to_nice_json, to_yaml, to_nice_yaml, ppretty, json
[tags]
# (list) default list of tags to run in your plays, Skip Tags has precedence.
;run=
# (list) default list of tags to skip in your plays, has precedence over Run Tags
;skip=
# /etc/ansible/broadcast.yml
---
- name: Echoed stuff
hosts: ss1
become: true
tasks:
- name: say things to tty1
ansible.builtin.shell: echo {{ inventory_hostname }} | sudo tee /dev/tty1 && /bin/true
[sniffers:children]
ss1
ss2
[ss1]
; ss1-s6-whyred ansible_host=192.168.145.56
; ss1-s1 ansible_host=192.168.1.184 ansible_ssh_user=user
; ss1-s2 ansible_host=192.168.1.231
; ss1-s3 ansible_host=192.168.1.239
; ss1-s4 ansible_host=192.168.1.100
[ss2]
ss2-s6 ansible_host=192.168.1.244
; ss2-s5 ansible_host=192.168.1.100
# rp4 ansible_host=192.168.1.248
[all:vars]
ansible_connection=ssh
ansible_ssh_user=tribe
ansible_python_interpreter=/usr/bin/python3
ansible_executable=/bin/bash
- hosts: sniffers
become: true
tasks:
- ansible.builtin.shell: whoami
register: iam
- debug:
var: iam.stdout
\ No newline at end of file
# if your target device has a GUI, replace the whole shell command with notify-send "Hello world !"
---
- name: Print stuff to tty (plug your monitor in !)
hosts: all
become: true # becomes root
vars_prompt:
name: usr_msg
prompt: Message to print
private: false
default: "Hello world !"
tasks:
- name: say things to tty1 (connect a screen to see the result)
ansible.builtin.shell: echo "{{usr_msg}}" | sudo tee /dev/tty1 || /bin/true
# Documentation
[MITIK-MGMT](https://gitlab.inria.fr/mitik/measurement-management/mitik-mgmt/) is the tool used to start and sync the experiments.\
It contains scripts and playbooks that can be ran with [Ansible](https://wiki.archlinux.org/title/Ansible), which uses SSH to control fleets of devices remotely (`nodes`).
> Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.
## Table of Contents
[TOC]
## Playbooks
Visit [PLAYBOOKS.md](./PLAYBOOKS.md) for detailed information about each playbook.
## Installation
It requires installing ansible on your controlling computer (`master`):
```bash
sudo apt install ansible -y
```
Then clone the MITIK-MGMT repository and enter that folder :
```bash
git clone https://gitlab.inria.fr/mitik/measurement-management/mitik-mgmt
cd mitik-mgmt
```
### Folders structure
```bash
mitik-mgmt
├── config # Configuration files for Ansible. Run commands from here.
├── docs # Documentation for MITIK-MGMT
├── figures # Illustrations for documentation
├── files # Files sent to nodes for configuration
├── playbooks # Instruction lists to be used with ansible commands
└── results # Output of remote devices
```
Enter the `config` folder. When running ansible from this folder, it will read configuration files that are in that current directory.
### `inventory` file
==This step is mandatory==. Devices (`nodes`) you'll control (your `inventory`) are described inside the `inventory` file. [[Ansible documentation](https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html)]
In order yo fill your inventory, you'll need to know your nodes' username and IP address. A static IP for each node is highly recommended.
In the following example, we create a group of devices `ss1` with two nodes inside. They are locally nicknamed `ss1-s1` and `ss1-s2`, and they are reachable using their respective IP addresses. Inline variables set here override variables defined globally.
It is important to specify the super-sniffer inside the hostname, because else when tasks run you'll only see the number of the sniffer and not its group
```ini
[ss1]
ss1-s1 ansible_host=192.168.1.184
ss1-s2 ansible_host=192.168.1.231
```
---
The following adds members of the `ss1` and `ss2` groups to the `sniffers` group. Upon creating new groups, you might want to add them to the `sniffers`. This will let you run commands on all of its children at once.
```ini
[sniffers:children]
ss1
ss2
```
---
The following sets variables for all devices listed. More variables are available and described in the Ansible documentation. These values override those of `ansible.cfg`.
```ini
[all:vars]
ansible_connection=ssh
ansible_ssh_user=tribe
ansible_python_interpreter=/usr/bin/python3
```
---
### `ansible.cfg` file
This is more or less the default configuration file, generated running `ansible-config init --disabled > ansible.cfg`.
The following option has been changed :
```!yaml=137
inventory=./inventory ; Inline comment.
```
This sets the location of our inventory file, relative to the `config` folder.
## Usage
Please run your playbooks from the config folder.
You can make sure you're at the right place by typing `pwd` in your terminal.
By default, all playbooks target the group `sniffers`. View the setup instructions if you're unsure what this means.
You can run simple bash commands to nodes and view their results using:
```bash
ansible sniffers -m command -a "echo hello"
```
### First connection and ssh access
If you didn't configure it before, your `master` device isn't authorized to connect to your remote device yet.
For this to be solved, we're going to transfer the master's ssh key to the nodes so that it lets us in without password.
++This is a one-time process.++
Run the `ssh_setup.yml` playbook from the `config` folder :
```
sudo ansible-playbook ../playbooks/ssh_setup.yml
```
Fill in the prompt for nodes' ssh passord and your master's admin password, then wait for completion. From there on, you won't need to provide any authentication.
### Testing the connection to your nodes
Once your nodes are configured, test connections using:
```bash
ansible all -m ping
```
Green means good, red is bad.
:::spoiler Sample output
```bash
$ ansible all -m ping
rp4 | SUCCESS => {
"changed": false,
"ping": "pong"
}
s4 | SUCCESS => {
"changed": false,
"ping": "pong"
}
s2 | SUCCESS => {
"changed": false,
"ping": "pong"
}
s1 | SUCCESS => {
"changed": false,
"ping": "pong"
}
s3 | SUCCESS => {
"changed": false,
"ping": "pong"
}
s6 | SUCCESS => {
"changed": false,
"ping": "pong"
}
s5 | SUCCESS => {
"changed": false,
"ping": "pong"
}
```
:::
If you're still skeptical about it working, run
```
ansible-playbook ./test_echo.yml
```
which will make stuff appear in your nodes' tty1 (the one you see when you plug in a screen).
#### Setting up nodes using ansible
In order for your sniffers to work correctly, they need some configuration (installing some packages, the driver for the network adapters, the network interface names, etc).\
If you've just flashed your sniffers with the official Lite image, ++do not skip this step++.\
Detailed description of what this script does is to be found inside [Nodes setup and configuration](./PLAYBOOKS#nodes-setup-and-configuration)
Simply run the `sniffer-setup` playbook :
```
ansible-playbook ../playbooks/sniffer_setup.yml
```
This can be ran just to make sure things are set up properly.
#### Planning a sniffing session with cron and sens
Detailed description of what this script does is to be found inside [Starting and Stopping mitik-sens](./PLAYBOOKS#starting-and-stopping-mitik-sens).\
Run the `start_sens_sniffer.yml` playbook:
```
ansible-playbook ../playbooks/start_sens_sniffer.yml
```
And fill in the parameters to pass to the `sniffer.py` script.\
When running this command, note that it expects all sniffers to have the same amount of external adapters plugged in the same interfaces
#### Cancelling a future or running sniffing session
Detailed description of what this script does is to be found inside [Starting and Stopping mitik-sens](./PLAYBOOKS#starting-and-stopping-mitik-sens).\
Run the `stop_sens_sniffer.yml` playbook:
```
ansible-playbook ../playbooks/start_sens_sniffer.yml
```
#### Cancelling a future or running sniffing session
Detailed description of what this script does is to be found inside [Starting and Stopping mitik-sens](./PLAYBOOKS#starting-and-stopping-mitik-sens).\
Run the `stop_sens_sniffer.yml` playbook:
```
ansible-playbook ../playbooks/stop_sens_sniffer.yml
```
#### Testing current nodes statuses
Detailed description of what this script does is to be found inside [Starting and Stopping mitik-sens](./PLAYBOOKS#testing-devices-and-statuses).\
Run the `test_meta.yml` playbook:
```
ansible-playbook ../playbooks/test_meta.yml
```
# **Installing the sniffer manager**
The sniffer manager consists of several configuration components. Each tool used will be discussed below to ensure the succesfull tool implementation.
## **Hardware**
### **Raspberry Pi**
The sniffers use Raspbian Bullseye simplified version installed on the Raspberry Pi 4B. Raspberry PI allows the use of low-cost controllers to enable other functionalities such as GPS.
### **Wireless interfaces**
Each Raspberry Pi is equipped with external TP-Link TL-WN722N wireless interfaces which make available the monitor mode, required for the analysis of captured network traffic in the sniffer.
### **GPS module**
Each Raspberry Pi is equipped with an [u-blox NEO 6M-0-001](https://content.u-blox.com/sites/default/files/products/documents/NEO-6_DataSheet_%28GPS.G6-HW-09005%29.pdf). This module has one timepulse PPS module, in addition to the stand-alone GPS receiver.
<center>
<figure>
<img src="https://gitlab.inria.fr/fmorlano/mitik_management/-/raw/main/Figures/gps_module.png" alt="gps_module"/>
<figcaption>Figure 1. GPS module.</figcaption>
</figure>
</center>
## **Software**
### **Ansible**
The sniffer manager uses Ansible to configure all the sniffer parameters. This can be used remotely or locally. So, we use our own made Ansible-based tool to configure the sniffers with all the required parameters. Ansible is compatible with Linux distributions Mac OS and Windows. Currently, we use a Macbook as manager for our development.
```
# apt install ansible -y
```
To establish communication with the sniffers, an inventory is defined. Each sniffer is configured with a static IP. Besides that, the sniffers are organized in groups (super-sniffers).
### **Time synchronization and GPS configuration**
We consider to use time synchronization via GPS PPS (Pulse Per Second) signal.
Install **gpsd** for GPS decoding of both time and position; **pps-tools** to verify PPS signals from the GPS; and **chrony** to handle PPS signals.
```
# apt install gpsd gpsd-clients pps-tools chrony
```
Install **pynmea2** for interpretation of messages provided by the GPS based on the NMEA 0183 [1]. NMEA format has different properties, depending on its sentence type and the properties in the message data. For this application, $GPGGA format is udes to extract latitude, longitude and datetime.
```
# pip3 install pynmea2
```
PPS configuration requires intruction definitions in _/boot/config.txt_. For NMEA data from the serial communication, it is necessary to enable UART communication and set the baud rate.
```
# bash -c "echo 'dtoverlay=pps-gpio,gpiopin=18' >> /boot/config.txt"
# bash -c "echo 'enable_uart=1' >> /boot/config.txt"
# bash -c "echo 'init_uart_baud=9600' >> /boot/config.txt"
```
It is also necessary to add PPS in _/etc/modules_.
```
# bash -c "echo 'pps-gpio' >> /etc/modules
```
#### **Pin connections**
| GPS | Raspberry Pi |
| :---: | :---: |
| PPS | Pin 12 (GPIO 18)|
| VCC | Pin 4 |
| GND | Pin 6 |
| RX | Pin 8 |
| TX | Pin 10 |
<center>
<figure>
<img src="https://gitlab.inria.fr/fmorlano/mitik_management/-/raw/main/Figures/gps_conn.png" alt="gps_connection"/>
<figcaption>Figure 2. Wire up GPS module to Raspberry Pi.</figcaption>
</figure>
</center>
It is needed to make the UART serial port enabled:
```
# raspi-config nonint do_serial 2
```
Configuration of **gpsd** in _/etc/default/gpsd_ to connect before polling whatever GPS must be associated with it. This is used to provide reference clock information to ntpd or chronyd. Moreover, the device argument should be defined as /dev/ttyS0 to /dev/pps0 to monitor the serial data for PPS.
```
# Default settings for the gpsd init script and the hotplug wrapper.
START_DAEMON="true"
USBAUTO="true"
DEVICES="/dev/ttyS0 /dev/pps0"
GPSD_OPTIONS="-n"
GPSD_SOCKET="/var/run/gpsd.sock"
```
Configuration of PPS as time reference for **chrony** server.
```
# bash -c "echo 'refclock SHM 0 delay 0.200 refid NMEA' >> /etc/chrony/chrony.conf"
# bash -c "echo 'refclock PPS /dev/pps0 refid PPS' >> /etc/chrony/chrony.conf"
```
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