GithubHelp home page GithubHelp logo

ansible-workshop's Introduction

Atelier Ansible

Ce dépôt permet de s'exercer avec Ansible sur des machines locales ou en ligne.

Installer Ansible

$ sudo apt install python-pip && sudo pip install ansible

Machines virtuelles locales

Utilisation:

$ cd vagrant
$ vagrant up

Ces deux commandes permettent de créer deux machines virtuelles Centos 7 accessible sur 10.0.0.5 et 10.0.0.6.

Pour arrêter les machines:

$ vagrant halt

Pour détruire les machines:

$ vagrant destroy    

Les mot de passe root est azerty.

Commandes utiles

Avant toutes chose, il faut s'assurer de pouvoir se connecter aux machines en SSH:

$ ssh [email protected]     ->  azerty
$ ssh [email protected]     ->  azerty

Lancer un playbook ansible sur les machines:

$ cd ansible-playground
$ ansible-playbook -i inventory/inventory.cfg playbooks/example1.cfg

Lancer un playbook mais demander le mot de passe de connexion:

$ ansible-playbook -i inventory/inventory.cfg playbooks/example1.yml --ask-pass

N'éxécuter que les tâches taggées Yum ou Configuration:

$  ansible-playbook -i inventory/inventory.cfg playbooks/example1.yml -t yum,configuration         

Erreurs courantes

Received disconnect from 10.0.0.5 port 22:2: Too many authentication failures

En cas d'erreur:

Received disconnect from 10.0.0.5 port 22:2: Too many authentication failures
Disconnected from 10.0.0.5 port 22

Vous devriez configurer votre client SSH dans le fichier ~/.ssh/config

Host 10.0.0.*
    IdentityFile ~/.ssh/id_rsa
    User root

Vous pouvez aussi utiliser cette commande:

$ 🐼 ssh -o pubkeyauthentication=no [email protected] 

ansible-workshop's People

Contributors

remipassmoilesel avatar

Watchers

 avatar  avatar

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.