Code Monkey home page Code Monkey logo

ansible_role_apply's Introduction

ansible-role-apply

Apply a single Ansible role to host(s) easily

Example usage

$ ansible-role-apply --help
Usage: ansible-role-apply [OPTIONS] ROLE HOSTS

Options:
  -s, --sudo / --no-sudo
  --show-playbook / --no-show-playbook
  --help                          Show this message and exit.

$ ansible-role-apply docker vagrant --sudo
...
PLAY [vagrant] ****************************************************************

GATHERING FACTS ***************************************************************
ok: [vagrant]
...
PLAY RECAP ********************************************************************
vagrant                    : ok=16   changed=1    unreachable=0    failed=0

$ ansible-role-apply docker vagrant --sudo --show-playbook
-------------------------------------------------------------------------------
#!/usr/bin/env ansible-playbook
---
- hosts:
    - vagrant
  roles:
    - docker
  sudo: True
-------------------------------------------------------------------------------
...
PLAY [vagrant] ****************************************************************
...
PLAY RECAP ********************************************************************
vagrant                    : ok=16   changed=1    unreachable=0    failed=0

ansible_role_apply's People

Contributors

msabramo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ansible_role_apply's Issues

Named options or posargs?

@sudarkoff said:

I'd also replace named options with positional args. One of the things that irritate me about
ansible is all those named opts - too much typing! :)

E.g.: ansible apply-role docker localhost

One problem with posargs is it makes it harder to do multiple roles or multiple hosts, but maybe that’s ok.

Allows pass-through options

It would be cool if you could specify ansible-playbook options and have the pass through to ansible-playbook.

$ ansible-role-apply --host=vagrant --role=docker --sudo --user=monkey --timeout=30
Error: no such option: --user

pip install?

did i mess that up somehow?

$ pip install ansible-role-apply
Collecting ansible-role-apply
  Downloading ansible_role_apply-0.0.0.tar.gz
Requirement already satisfied: ansible in /usr/local/lib/python2.7/site-packages (from ansible-role-apply)
Collecting click (from ansible-role-apply)
  Downloading click-6.7-py2.py3-none-any.whl (71kB)
    100% |████████████████████████████████| 71kB 1.7MB/s
Requirement already satisfied: pycrypto>=2.6 in /usr/local/lib/python2.7/site-packages (from ansible->ansible-role-apply)
Requirement already satisfied: paramiko in /usr/local/lib/python2.7/site-packages (from ansible->ansible-role-apply)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from ansible->ansible-role-apply)
Requirement already satisfied: jinja2 in /usr/local/lib/python2.7/site-packages (from ansible->ansible-role-apply)
Requirement already satisfied: PyYAML in /usr/local/lib/python2.7/site-packages (from ansible->ansible-role-apply)
Requirement already satisfied: cryptography>=1.1 in /usr/local/lib/python2.7/site-packages (from paramiko->ansible->ansible-role-apply)
Requirement already satisfied: pyasn1>=0.1.7 in /usr/local/lib/python2.7/site-packages (from paramiko->ansible->ansible-role-apply)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/site-packages (from jinja2->ansible->ansible-role-apply)
Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Requirement already satisfied: cffi>=1.4.1 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Requirement already satisfied: idna>=2.1 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Requirement already satisfied: enum34 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Requirement already satisfied: ipaddress in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Requirement already satisfied: packaging in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Requirement already satisfied: pycparser in /usr/local/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/site-packages (from packaging->cryptography>=1.1->paramiko->ansible->ansible-role-apply)
Building wheels for collected packages: ansible-role-apply
  Running setup.py bdist_wheel for ansible-role-apply ... done
  Stored in directory: /Users/krm158/Library/Caches/pip/wheels/bf/50/99/606f632bb376d45c480397fbeb8c4eb60c1a02edd4ad2a85df
Successfully built ansible-role-apply
Installing collected packages: click, ansible-role-apply
Successfully installed ansible-role-apply-0.0.0 click-6.7
$ ansible-role-apply --help
Traceback (most recent call last):
  File "/usr/local/bin/ansible-role-apply", line 7, in <module>
    from ansible_role_apply import ansible_role_apply
ImportError: No module named ansible_role_apply

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.