Giter Club home page Giter Club logo

ansible-intro's Introduction

ANSIBLE

yum install epel-release
yum install ansible
yum install git
useradd -m ansible

useradd -m ansible
ansible ALL=(ALL) NOPASSWD: ALL

ansible server1 -m setup | less
ansible server1 -m ping

ansible server1 -b -m apt -a "update_cache=true name=apache2 state=present"
ansible server1 -b -m service -a "name=apache2 state=started"
ansible server1 -b -m service -a "name=apache2 state=stopped"

sudo su - ansible
ssh-keygen
ssh-copy-id server.dominio.tld

ansible-playbook -i inv web.yml
ansible-playbook -i inv web.yml --check #dry-run

variables

ansible-playbook -i inv web.yml -e "var1=value var2=value"

locate in file {{ var1 }}

ansible-playbook -i inv web.yml -e "mensaje="use variables""
{{mensaje}} Este lo use en el servidor

ansible server1 -m setup -a filter=*palabra*

tasks:

  • debug:
    var: variable

register al final de un task se puede imprimir
-debug:
msg: "xyz {{ variable }}"

handlers

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.