GithubHelp home page GithubHelp logo

ansible-toolbox's People

Contributors

awkspace avatar c0sco avatar larsks avatar mylokin avatar nicolov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-toolbox's Issues

Adjust ANSIBLE_ROLES_PATH to local dir

I have custom roles on $(pwd)/roles dir, but since ansible-role generate the playbook in /tmp the path is ignored. I'm running with ANSIBLE_ROLES_PATH=pwd/roles ansible-role ... to fix that, but it should be defined to respect the role-search-path

run with sudo

Hi,
I found this issue while run ansible-role with sudo command:

Traceback (most recent call last): File "/usr/local/bin/ansible-role", line 9, in <module> load_entry_point('ansible-toolbox==0.2', 'console_scripts', 'ansible-role')() File "build/bdist.linux-x86_64/egg/ansible_toolbox/cmd/role.py", line 37, in main File "build/bdist.linux-x86_64/egg/ansible_toolbox/cmd/role.py", line 33, in main File "/usr/lib64/python2.7/subprocess.py", line 536, in check_call retcode = call(*popenargs, **kwargs) File "/usr/lib64/python2.7/subprocess.py", line 523, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/usr/lib64/python2.7/subprocess.py", line 1343, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

To reproduce, just type:

$ sudo ansible-role role_name

Has some way to run it with sudo?

Thanks

Permission error

I have this task:


- name: Symlink "smartless" in "/usr/local/bin/"
  file:
    state: link
    src: "{{ smartless_clone_dir_path }}/smartless/smartless"
    dest: "/usr/local/bin/smartless"
    owner: "{{ smartless_user_name | default(omit) }}"
    group: "{{ smartless_user_name | default(omit) }}"
    mode: "u+rwx,g+rwx,o+rx-w"

And this error using ansible-role:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error while linking: [Errno 13] Permission denied", "path": "/usr/local/bin/smartless", "state": "absent"}

I managed to get past the error but I don't know how, I tried -K, -b, -u but it didn't work then suddenly it worked

Can someone explain me? (it's been a while I used ansible tho)

Also this tool is really useful

feature: ansible-ssh script

One very useful script to have would an ansible-ssh which would start an interactive ssh session with the $1 hostname from inventory ini.

This can be implemented in few lines of bash or python and it would have to load all ssh info from ansible config using ansible-inventory command.

No installation instructions

This looks interesting and I would like to try it out. Is this an ansible module? If so, how do I install it? A little section with some pointers in the readme about getting it running would be really helpful for those of us unfamiliar with what you wrote here.

Thanks!

Suggestion: default inventory

I have a suggestion.
How about using inventory from ansible.cfg by default instead of localhost?

Or the same way as ansible do it:

  • ANSIBLE_CONFIG (an environment variable)
  • ansible.cfg (in the current directory)
  • .ansible.cfg (in the home directory)
  • /etc/ansible/ansible.cfg

Project status 2020?

Hey,
I would first like to congratulate you on this project.
It's aims to be everything I ever found missing in ansible...
It's often unclear to me how do people work and develop with ansible without the wrappers your project provides.

Now, having said that... Is the project bit rotting? :)
Did it continue to live somewhere else?

Display changes when --diff is present

When running a playbook, adding the --diff flag will cause changes (e.g., rendered template files, etc.) to be displayed in Ansible's output. It would be nice if ansible-role did the same:

$ ansible-role  -I [IP], postfix --diff

Presently, the above command results in:

ansible-role: error: unrecognized arguments: --diff

Commit 496581ac broke roles in cwd

Commit 496581a (fix issues around the use of relative paths) moves the generated temp playbook file to /tmp instead of ., but this means the role search path is now /tmp/roles instead of ./roles, as search is relative to the playbook directory.

That breaks the simplest example from the docs:

For example, if you have a role roles/testrole, you can run it like this:

ansible-role testrole

It likely broke the Travis build as well:

ERROR! the role 'testrole' was not found in /tmp/roles:/home/travis/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/tmp
The error appears to have been in '/tmp/tmptMm7Wj'

To fix, you could probably prepend $PWD/roles to the role search path, although this would leave /tmp/roles in there.

Add Python 3 Support

    load_entry_point('ansible-toolbox==0.2', 'console_scripts', 'ansible-role')()
  File "/home/lwm/.local/share/virtualenvs/x-DA8ldsYh/lib/python3.5/site-packages/ansible_toolbox/cmd/role.py", line 37, in main
    App().main()
  File "/home/lwm/.local/share/virtualenvs/x-DA8ldsYh/lib/python3.5/site-packages/ansible_toolbox/cmd/role.py", line 26, in main
    gather=args.gather,
  File "/home/lwm/.local/share/virtualenvs/x-DA8ldsYh/lib/python3.5/tempfile.py", line 622, in func_wrapper
    return func(*args, **kwargs)
TypeError: a bytes-like object is required, not 'str'

Can't run role

Just installed ansible-toolbox and tried to run one of my roles:

maroz@rabbit:/etc/ansible$ ansible-role add_ssh_fingerprint_to_known_hosts -i ubuntu-hosts
Traceback (most recent call last):
File "/usr/local/bin/ansible-role", line 9, in
load_entry_point('ansible-toolbox==1.0', 'console_scripts', 'ansible-role')()
File "build/bdist.linux-x86_64/egg/ansible_toolbox/cmd/role.py", line 37, in main
File "build/bdist.linux-x86_64/egg/ansible_toolbox/cmd/role.py", line 20, in main
File "build/bdist.linux-x86_64/egg/ansible_toolbox/base.py", line 11, in get_template
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 812, in get_template
return self._load_template(name, self.make_globals(globals))
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 774, in _load_template
cache_key = self.loader.get_source(self, name)[1]
File "/usr/lib/python2.7/dist-packages/jinja2/loaders.py", line 235, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: role.yml

Ansible version: ansible 2.0.2.0
Python version: Python 2.7.10
OS: Ubuntu 15.10

Argparse consumes quotes - add docs mention ?

Argparse treats options as strings, so -e test="123" means for it:
dest = e
options= 'test=123'

this is problematic when using spaces or json in extra vars:

ansible-eval -e test='[1, 2, 3]' "{{ test }}" will show [1,

This can be solved by using double quotes:
ansible-eval -e test="'[1, 2, 3]'" "{{ test }}" will show [1,2,3]

Or surrounding whole extra argument:

ansible-eval -e "test=\"{\"key\": \"value\"}\"" "{{ test }}"

This indeed is not 1 to 1 same mechanism as with ansible-playbook, so it's worth mentioning. Fixing that is not easiest thing, but quoting every extra-arg which has "=" in it is doable.

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.