Code Monkey home page Code Monkey logo

ansible_tutorial's Introduction

#Ansible ##Ansible c’est quoi? Ansible est un « Configuration Management Tool » comme Chef, Puppet. Il permet entre autre de :

  • éviter les tâches répétitives
  • automatiser le déploiment de scripts
  • déploier un parc de machines en un rien de temps

Ansible, c'est des commandes exécutées sur une ou plusieurs machine(s) locale(s) ou distante(s), via SSH.

##Installation

###Sources :


$ git clone git://github.com/ansible/ansible.git 
$ cd ./ansible
$ source ./hacking/env-setup

###Python et gestionnaires de packages linux http://docs.ansible.com/intro_installation.html

##Configurations

###Les SSH keys:

ssh-copy-id hosts_ssh_path

###Inventory files

  • default : /etc/ansible/hosts
  • custom : option -i path_inventory_file

######Contenu du fichier Inventory : mail.example.com

[webservers]

foo.example.com

bar.example.com

[test_servers]

192.168.33.10 ansible_ssh_user=root

jumper ansible_ssh_port=5555 ansible_ssh_host=192.168.1.50

##Les commandes Ad-Hocs

Une commande Ad-Hoc est une commande qu’on exécute à la volée sans la sauvegarder.

$ ansible va_host -m ping -i hosts
$ ansible va_host -m copy -a "src=./hosts dest=/tmp/ hosts" –i hosts

##Les modules

Ansible dispose de plusieurs librairies appelé modules. Chaque module est utilisé pour un besoin spécifique.

Quelques modules : ping,command,copy,apt,yum .....

Exemple :

$ ansible va_hosts -m yum -a "name=acme state=installed"

##Le playbook

Un playbook est un fichier YAML

Un playbook contient les “tasks” à effectuer.

###Les hosts et les users:

ansible_tutorial's People

Contributors

freemanpolys avatar

Stargazers

Juri Grabowski avatar

Watchers

Hassane Moustapha avatar dofbi.eth avatar Ousmane Wilane avatar aliounedia avatar Mouhamadou Moustapha CAMARA avatar Abdelkader ALLAM avatar Ahmadou Dicko avatar James Cloos avatar  avatar Juri Grabowski avatar Josue Kouka avatar

Forkers

alphilippo

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.