Outils pour utilisateurs

Outils du site


blog

8 billet(s) pour mars 2026

Notes conteneurs oras artifact OCI2026/03/23 21:13Jean-Baptiste
Notes podman secret2026/03/23 15:10Jean-Baptiste
Notes ansible podman2026/03/23 14:08Jean-Baptiste
Notes podman volume2026/03/23 14:00Jean-Baptiste
Find list - Trouver des fichiers à partir d'une liste2026/03/18 14:32Jean-Baptiste
AWX inventaire vault2026/03/17 18:04Jean-Baptiste
AWX - Configuration git en local (sans serveur web)2026/03/05 16:24Jean-Baptiste
OpenSMTP2026/03/03 16:58Jean-Baptiste

Git facile

Voir http://lilobase.wordpress.com/2014/05/12/a-la-decouverte-de-git/

PC Dépôt

mkdir test.git
cd test.git
mkdir test.git

PC1

echo "test1" > test1.txt
echo "test1" > test.txt

PC2

echo "test2" > test2.txt
echo "test2" > test.txt

PC3

echo "test3" > test3.txt
echo "test3" > test.txt

PC1, PC2, PC3

git init
git add .
git commit -m "1ere initialisation"

PC1

git push -u git@koala:test.git master

PC2, PC3

git pull git@koala:test.git
 
# Pour chaque conflit :
modifier fichier en question
git add fichier_conflict
git commit
git push -u git@koala:test.git master

PC1, PC2, PC3

git add .
git commit
git pull git@koala:test.git
git add .
git commit
git push -u git@koala:test.git master
###########
Merge koala:test

Conflicts:
        test.txt
#
2025/03/24 15:06

Noyau Linux Debian

Méthode I

cat >> /etc/apt/sources.list <<EOF
deb http://linux-libre.fsfla.org/pub/linux-libre/freesh freesh main
EOF
# apt-get update && apt-get install linux-libre64 linux-libre64-headers
259 ko réceptionnés en 5s (49,8 ko/s)
Lecture des listes de paquets... Fait
W: Erreur de GPG : http://linux-libre.fsfla.org freesh InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY 6FCB32C947486962
$ #gpg --keyserver pgpkeys.mit.edu --recv-key 6FCB32C947486962
$ gpg --keyserver pool.sks-keyservers.net --recv-key 6FCB32C947486962
gpg: le porte-clefs « /root/.gnupg/secring.gpg » a été créé
gpg: demande de la clef 47486962 sur le serveur hkp pgpkeys.mit.edu
gpg: clef 47486962 : clef publique « Jason Self <jself@gnu.org> » importée
gpg: aucune clef de confiance ultime n'a été trouvée
gpg:       Quantité totale traitée : 1
gpg:                     importées : 1
$ gpg -a --export 6FCB32C947486962 | sudo apt-key add -
OK

Autre

Connaitre la version du noyau à partir des sources

make kernelversion
2025/03/24 15:06

tmp draft zabbix zabcon

Notes Zabcon - ne marche pas chez moi

http://trac.red-tux.net/ http://www.zabbix.com/img/zabconf2011/presentations/Andrew_Nelson_-_Zabbix_Console.pdf

apt-get install ruby-highline
 
 
gem install --user zabcon zbxapi
 
export PATH=$PATH:/home/jean/.gem/ruby/2.1.0/bin
 
https://github.com/red-tux/zabcon/blob/master/zabcon.conf.default

Erreur

zabcon.rb
x86_64-linux-gnu
Runtime error detected
(RuntimeError): Unbalanced String: help commands

Top 10 items in backtrace
1: /home/jean/.gem/ruby/2.1.0/gems/zabcon-0.0.392/libs/utility_items.rb:120:in `split2'
2: /home/jean/.gem/ruby/2.1.0/gems/zabcon-0.0.392/libs/command_tree.rb:663:in `add_command'
3: /home/jean/.gem/ruby/2.1.0/gems/zabcon-0.0.392/libs/zabcon_commands.rb:55:in `<top (required)>'
4: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
5: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
6: /home/jean/.gem/ruby/2.1.0/gems/zabcon-0.0.392/libs/zabcon_core.rb:42:in `<top (required)>'
7: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
8: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
9: /home/jean/.gem/ruby/2.1.0/gems/zabcon-0.0.392/zabcon.rb:315:in `run'
10: /home/jean/.gem/ruby/2.1.0/gems/zabcon-0.0.392/zabcon.rb:326:in `<top (required)>'
2025/03/24 15:06

Tests - Web

Voir :

Cypress

<body>
<h1>Result<h1>
</body>
cy.get('h1').contains('Result')
2025/03/24 15:06

Test ping et win_ping cibles Ansible rapport CSV

Voir aussi :

#!/usr/bin/ansible-playbook                                                                                                                         
---

- name: Test ping
  hosts: all
  ignore_unreachable: true
  gather_facts: false

  tasks:

    - name: Set_fact - fichier_csv - random
      run_once: true
      set_fact:
        fichier_csv: "/tmp/ping_result_{{ rand }}.csv"
      vars:
        rand: "{{ range(10000, 99999) | random }}"

    - name: Ansible win_ping
      ignore_errors: true
      win_ping:
      register: r_ping
      when: os | lower == 'windows'

    - name: Ansible ping
      ignore_errors: true
      ping:
      register: r_ping
      when: os | lower != 'windows'
      
    - name: setfacts hostname
      set_fact:
        field_hostname: "{{ inventory_hostname }}"

    - name: Create CSV test ping OK
      delegate_to: localhost
      lineinfile:
        path: "{{ fichier_csv }}"
        create: true
        mode: "0640"
        line: >-
          {{ field_hostname }};
          {%- if r_ping.ping is defined -%}
          {{ r_ping.ping + ';' }}
          {%- else -%}
          ;
          {{ r_ping.msg | replace(';', ',') | regex_replace('\n', ' ') | regex_replace('\r', ' ') + ';' }}
          {%- endif -%}
      when: r_ping.ping is defined or r_ping.msg is defined

    - name: block
      delegate_to: localhost
      run_once: true
      block:

        - name: find csv
          register: reg_find_csv
          find:
            paths: /tmp/
            patterns: "ping_result_*.csv"

        - name: set_fact - csv_found
          set_fact:
            csv_found: "{{ csv_found | d([]) + reg_find_csv.files | map(attribute='path') | list }}"

        - name: Send mail
          run_once: true
          delegate_to: localhost
          mail:
            host: smtp.acme.local
            port: 25
            to: me@acme.local
            subject: CSV ping
            attach: "{{ csv_found }}"
            body: >-
              See attachement.
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki