446 commandes partagées

Ta mémoire technique
collaborative

Ne perds plus jamais une commande. Recherche, copie et partage tes solutions techniques en quelques secondes.

CodeBox
446 Commandes
22 Développeurs
99 Technologies

446 résultat(s)

Chiffre un fichier de variables avec Ansible Vault.

bash
ansible-vault encrypt vars/secrets.yml

Utilise un fichier ou dossier d'inventaire personnalisé.

bash
ansible all -i inventaire/production --list-hosts

Affiche les hôtes d'un groupe spécifique.

bash
ansible webservers --list-hosts

Affiche l'inventaire complet en JSON (hôtes et variables).

bash
ansible-inventory --list

Exécute la commande en parallèle sur 10 hôtes à la fois.

bash
ansible all -m ping -f 10

Télécharge un fichier de chaque hôte vers le controller.

bash
ansible all -m fetch -a "src=/var/log/nginx/error.log dest=./logs/ flat=no"

Affiche tous les hôtes de l'inventaire actif.

bash
ansible all --list-hosts

Affiche un graphe visuel de la hiérarchie de l'inventaire.

bash
ansible-inventory --graph

Récupère uniquement un fact précis sur tous les hôtes.

bash
ansible all -m setup -a "filter=ansible_os_family"

Redémarre un service systemd sur tous les hôtes.

bash
ansible all -m service -a "name=nginx state=restarted" --become

Crée un dossier avec les permissions sur les hôtes distants.

bash
ansible all -m file -a "path=/var/www/mon-app state=directory mode=0755 owner=www-data" --become

Installe un paquet sur des hôtes Debian/Ubuntu.

bash
ansible all -m apt -a "name=nginx state=present" --become

Copie un fichier local vers tous les hôtes distants.

bash
ansible all -m copy -a "src=./fichier.conf dest=/etc/fichier.conf mode=0644"

Installe un paquet sur des hôtes CentOS/RHEL.

bash
ansible all -m yum -a "name=nginx state=present" --become

Supprime un fichier sur les hôtes distants.

bash
ansible all -m file -a "path=/tmp/fichier-temp.txt state=absent"