Giter Club home page Giter Club logo

ansible_kernel's Introduction

ansible_kernel

ansible kernel for jupyter

Tested under max osx 10.12 with ansible 2.3.X.

  1. read hosts file from '/usr/local/etc/ansible/hosts'

    [tf]
    192.168.X.XXX ansible_python_interpreter="/usr/bin/env python3" ansible_ssh_user=remote_user_name ansible_become_pass=remote_user_password
    
    [local]
    localhost              ansible_connection=local
    

    tf and local group in hosts file, and input follow to show 'hello world' on to machine.

    hosts: tf, local
    tasks:
      - debug: msg="hello world"
    
  2. human readable output

    TASK [localhost: TASK: Gathering Facts] 
    
    
    TASK [192.168.10.238: TASK: Gathering Facts] 
    
    
    TASK [192.168.10.238: TASK: debug] 
    hello world
    
    TASK [localhost: TASK: debug] 
    hello world
    
    ok
    
  3. default hosts is localhost

    - debug: msg="hello world"
    - shell: ls -l
    

    output:

    TASK [localhost: TASK: Gathering Facts] 
    
    
    TASK [localhost: TASK: debug] 
    hello world
    
    TASK [localhost: TASK: command] 
    stdout:
    total 24
    drwxr-xr-x  4 mind  staff   136 Aug 11 18:01 2017
    -rw-r--r--  1 mind  staff   830 Aug 11 23:48 Untitled.ipynb
    -rw-r--r--  1 mind  staff  1090 Aug 14 16:32 Untitled1.ipynb
    stderr:
    
    
    ok
    
  4. set gather_facts to false could skip 'Gathering Facts'

    hosts: tf
    gather_facts: no
    tasks:
        - debug: msg="hello world"
    

    output:

    TASK [192.168.10.238: TASK: debug] 
    hello world
    
    ok
    
  5. use hosts set global default hosts

    # hosts=local, tf
    

Usage

$ pip install -e .
$ python -m ansible_kernel.install --sys-prefix

ansible_kernel's People

Contributors

peace0phmind 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.