Giter Club home page Giter Club logo

hautedispo's Introduction

name banner

À propos de moi

Langages, Outils et Compétences 🛠

Java C C++ Python SQL PostgreSQL MariaDB Linux Bash MySQL PowerShell Solidity C# Checkmk WordPress Haproxy RAID Technologies LaTex

Statistiques GitHub 📈

hautedispo's People

Contributors

adelfortin avatar shaddow7 avatar

Watchers

 avatar

hautedispo's Issues

Idée de remplacement

Je te propose de simplifier ton scan ip par cette fonction.

#!/bin/bash

prefix_adresse="192.168.56"
nombre_adresse_voulue=3
fichier_ip="/root/.deploy/adresse_ipv4.log"

# Cette fonction permet de liste tous les adresses IP qui sont vivant
# sur le réseau
function find_adresses {
    # Récupere uniquement les adresses qui sont alive
    fping -aqg ${prefix_adresse}.0/24 >$fichier_ip
    # récupere au moin le nombre d'adresse suffisant
    head -n ${nombre_adresse_voulue} ${fichier_ip} >tmp && mv tmp ${fichier_ip}
}

find_adresses

# Fin du programme
exit 0

Modification du fichier /common/tasks/main.yml

---   
  - name: Set machine facts
    set_fact:
      machine: "machine{{ host_index }}"
    when: inventory_hostname == item
    loop: "{{ groups['machine_sans_configuration'] }}"
    loop_control:
      index_var: host_index
      
  - name: Debug
    debug: 
      msg: machine

  - name: CREATION DES DOSSIERS POUR LE DEPLOIEMENT
    ansible.builtin.file:
      path: /root/.deploy
      state: directory
   
  - name: COPIE DES FICHIERS DE CONFIGURATIONS
    ansible.builtin.copy:
      src: "{{ src }}"
      dest: "{{ dst }}"
    with_items:
      - { "src" : /root/.deploy/.bashrc , "dst" : /root/.deploy/.bashrc }
      - { "src" : /root/.deploy/agnoster.bash , "dst" : /root/.deploy/agnoster.bash }
      - { "src" : "/root/.deploy/config{{ machine }}.sh" , "dst" : "/root/.deploy/config{{ machine }}.sh" }
      - { "src" : "/root/.deploy/configssh{{ machine }}" , "dst" : /root/.deploy/config }

  - name: COPIE DES FICHIERS DE CONFIGURATIONS DE LA MACHINE
    ansible.builtin.copy:
      src: /root/.deploy/transformer_en_routeur.sh
      dest: /root/.deploy/transformer_en_routeur.sh
    when: (host_index == 1 or host_index == 7)
 
  - name: DONNE LES DROITS D'EXECUTION POUR LE SCRIPT DE CONFIGURATION DE LA MACHINE
    ansible.builtin.file: 
      src: /root/.deploy/transformer_en_routeur.sh
      dest: /root/.deploy/transformer_en_routeur.sh
      mode: o+x
    when: (host_index == 1 or host_index == 7)

  - name: DONNE LES DROITS D'EXECUTION POUR LE SCRIPT DE CONFIGURATION DE LA MACHINE
    ansible.builtin.file:
      src: /root/.deploy/config{{ machine }}.sh
      dest: /root/.deploy/config{{ machine }}.sh
      mode: o+x

  - name: EXECUTE LE SCRIPT DE CONFIGURATION DE LA MACHINE
    ansible.builtin.command: /bin/bash /root/.deploy/config{{ machine }}.sh

  # Configuration et installation de DNF et EPEL
  - name: CONFIG DNF | Ajout du proxy dans le fichier de configuration de dnf
    lineinfile:
      path: /etc/dnf/dnf.conf
      line: proxy=http://proxy.infra.dgfip:3128
    
  - name: COPIE DES FICHIERS DE CONFIGURATIONS DE LA MACHINE
    ansible.builtin.copy:
      src: /root/.deploy/untarscript.sh
      dest: /root/.deploy/untarscript.sh
      
  - name: COPIE DES FICHIERS DE CONFIGURATIONS DE LA MACHINE
    ansible.builtin.copy:
      src: /root/powerline_fonts.tar.gz
      dest: /root/powerline_fonts.tar.gz
    
  - name: DONNE LES DROITS D'EXECUTION POUR LE SCRIPT D'INSTALLATION DES POLICES DE CARACTERES
    ansible.builtin.command: chmod o+x /root/.deploy/untarscript.sh

  - name: EXECUTE LE SCRIPT D'INSTALLATION DES POLICES DE CARACTERES
    ansible.builtin.command: bash /root/.deploy/untarscript.sh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.