ansible-ssh | program invokes ssh with the same arguments

 by   2ndQuadrant Python Version: Current License: No License

kandi X-RAY | ansible-ssh Summary

kandi X-RAY | ansible-ssh Summary

ansible-ssh is a Python library typically used in Devops, Ansible applications. ansible-ssh has no bugs, it has no vulnerabilities and it has low support. However ansible-ssh build file is not available. You can download it from GitHub.

This program invokes ssh with the same arguments that ansible does to connect to hosts defined in its inventory:. Using it saves having to duplicate information from the inventory into ~/.ssh/config files in order to ssh to them interactively. There's an independent ansible-shell program that tries to execute ansible modules on multiple hosts in parallel. This program has nothing to do with that. It just lets you ssh to ONE host using information from the Ansible inventory. Note that the "ssh_extra_args" PR against the ansible repository would make it possible to configure per-host or per-group ProxyCommands to use jump hosts. We could support that in this program already, but it would be of limited use until the PR is merged upstream since ansible itself would not be able to connect to those hosts otherwise. The initial prototype of this code was written by Carlos Chapi. It's still pretty rough around the edges, but the basic functionality works. This code is released under the MIT license. -- Abhijit Menon-Sen ams@2ndQuadrant.com.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ansible-ssh has a low active ecosystem.
              It has 14 star(s) with 7 fork(s). There are 6 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 2 open issues and 1 have been closed. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of ansible-ssh is current.

            kandi-Quality Quality

              ansible-ssh has 0 bugs and 0 code smells.

            kandi-Security Security

              ansible-ssh has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ansible-ssh code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              ansible-ssh does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              ansible-ssh releases are not available. You will need to build from source code and install.
              ansible-ssh has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ansible-ssh
            Get all kandi verified functions for this library.

            ansible-ssh Key Features

            No Key Features are available at this moment for ansible-ssh.

            ansible-ssh Examples and Code Snippets

            No Code Snippets are available at this moment for ansible-ssh.

            Community Discussions

            QUESTION

            `git clone` fails for role in private git repo when running `ansible-galaxy install -r requirements.yml`
            Asked 2020-Jul-21 at 10:05

            I have added a .gitlab-ci.yml to my private project. One of the steps is to get a role from a private gitlab repo. However this fails with

            ...

            ANSWER

            Answered 2020-Jul-21 at 10:05

            Running the same command ansible-galaxy install -r requirements.yml on my machine runs fine.

            That means you have the right public/private key in ~/.ssh/id_rsa on your machine, and you are executing it locally with your account.

            If you copy it in your GitLab step, make sure to check the rights, and possible the passphrase and known_hosts, as in here or in the documentation:

            Source https://stackoverflow.com/questions/62967790

            QUESTION

            Ansible logging
            Asked 2019-Jul-10 at 10:16

            I am having difficulty getting Ansible to perform logging. A simple YAML named demo5.yml spins up AWS EC2 instances (below). The following entry has been added into the ansible.cfg file: log_pth=/var/log/ansible.log

            The playbook YAML is executed by calling: ansible-playbook demo5.yml -v

            There is nothing in the ansible.log after execution.

            What am I doing incorrectly?

            ...

            ANSWER

            Answered 2017-Jul-04 at 15:21

            The parameter name is log_path, not log_pth.

            Source https://stackoverflow.com/questions/44909444

            QUESTION

            Problems with ansible 2.7.9 using host_vars (undefined variable)
            Asked 2019-Apr-12 at 12:11

            Ansible 2.7.9 is not using host_vars

            Ive setup a very simple setup with 3 hosts, mainly for testing purposes . I have hosts :

            ...

            ANSWER

            Answered 2019-Apr-05 at 15:18

            This is as expected the main.yml will get sourced automatically while executing the playbook. consider this file as global variables.

            The reason ansible2.yml is not getting sourced is because ansible expects you to source that explicitly while executing.

            You can use below code for that(generic).

            Source https://stackoverflow.com/questions/55536600

            QUESTION

            Ansible attempting to Connect to Windows Machine Via SSH (fails)
            Asked 2018-Aug-15 at 20:08

            We have a linux ansible server managing software installation on a Windows domain. We have successfully installed software onto all our windows machines without issue. We just added a new Windows 10 computer (yes, we have succesfully connected to other Win10 computers), and when we run our ansible install script we are getting the following error

            fatal: [afc54]: UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/home/ansible/.ansible/cp/ansible-ssh-afc54-22-ansible\" does not exist\r\ndebug2: ssh_connect: needpriv 0\r\ndebug1: Connecting to afc54 [192.168.2.193] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: connect to address 192.168.2.193 port 22: Connection timed out\r\nssh: connect to host afc54 port 22: Connection timed out\r\n", "unreachable": true

            In the [Gathering Facts] section of the playbook, the new machine shows

            Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setu‌​p.py

            while the other windows machines shows

            Using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win‌​_updates.ps1

            Why is ansbile trying to connect via SSH rather than the windows port 5986? The same script works successfully on all our other windows computers, but this one has me stumped.

            EDIT: If I specify the credentials and specs on the machine's line in the host file (i.e. ansible_user=user@domain ansible_password=password ansible_port=5986 ansible_connection=winrm) then I get the following error

            afc54 | UNREACHABLE! => { "changed": false, "msg": "kerberos: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579), ssl: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)", "unreachable": true }

            ...

            ANSWER

            Answered 2018-Aug-15 at 20:08

            I am not clear why this worked, but I changed the group name in the hosts file and in the playbook (it was [install] is now [windows]), and it's now running correctly.

            EDIT: A year later I finally noticed the reason this worked. In the group_vars directory, there was nothing set up for [install] but there was an existing configuration for [windows] under windows.yml Hopefully this helps someone else =)

            Source https://stackoverflow.com/questions/44533990

            QUESTION

            Ansible stops connecting to the host via ssh
            Asked 2018-Aug-03 at 19:56
            Introduction

            For over a month I've been running the following command:

            ...

            ANSWER

            Answered 2018-Aug-03 at 19:56

            I believe the connection may be dropping due to the lack of output from your play.

            Add the following to your ssh_args in ansible.cfg:

            Source https://stackoverflow.com/questions/51675831

            QUESTION

            NXOS Ansible "Connection failure: timed out"
            Asked 2018-Apr-30 at 16:36

            I am very new to Ansible and am trying to run my first playbook against a nexus 5600. I am using the cisco-programmable-fabric playbook I have connectivity to the N5K, and can ping it from the Centos7 VM. I can also access the NXAPI sandbox via the browser.

            When I run the playbook I the errors shown in the picture. One host gets gets a connection timed out error. The host "mt-l1" has an error with a redirect.

            Ansible version is 2.5.1 and python version is 2.7.5.

            Errors

            NXAPI Config

            hosts file

            etc/hosts file

            ...

            ANSWER

            Answered 2018-Apr-30 at 16:36

            It appears from your error message that the connection to the devices using the nxos_config module is attempting to use a proxy server. I'm guessing that since you are manipulating /etc/hosts on your local machine that these devices are not registered in DNS, and therefore the proxy would not be able to reach them.

            As a quick test, I would run the following commands and re-run your playbook.

            unset HTTP_PROXY unset HTTPS_PROXY unset http_proxy unset https_proxy

            Assuming that works, you could have a peek here for a more elegant fix

            HTH

            Source https://stackoverflow.com/questions/50081147

            QUESTION

            Ansible fails to connect with SSH (banner exchange)
            Asked 2018-Apr-09 at 12:08

            Sorry in advance if the question is not clear and/or if i am not askin where i should.

            I have issues with connecting to hosts with ansible via SSH. It worked few days ago but i have been having the same message error for several days :

            ...

            ANSWER

            Answered 2018-Apr-03 at 12:18

            Try to use ansible_user instead ansible_ssh_user and ansible_password instead ansible_ssh_pass. It depends of your ansible version. Also you may need to place [group:vars] after [group] section in the inventory file.

            There is simple way to check difference

            ansible 192.168.15.29 -i your_hosts_file -m ping -e "ansible_ssh_user=remote ansible_ssh_pass=password"

            or

            ansible 192.168.15.29 -i your_hosts_file -m ping -e "ansible_user=remote ansible_password=password"

            Source https://stackoverflow.com/questions/49629480

            QUESTION

            Using ssh-keyscan in shell module does not produce any output in Ansible
            Asked 2017-Nov-08 at 15:41

            I'm trying to follow this solution to add use the shell module and ssh-keyscan to add a key to my known_hosts file of a newly created EC2 instance.

            After trying to do this multiple ways as listed on that question I eventually ran just the ssh-keyscan command using the shell module without the append. I am getting no output from this task:

            ...

            ANSWER

            Answered 2017-Nov-08 at 15:41

            The answer is that it doesn't work the first time. While researching another method I stumbled across the retries keyword in ansible that allows a retry of whatever command. I tried this and on attempt number 2 in the retry loop it is working.

            Source https://stackoverflow.com/questions/47167924

            QUESTION

            node-ansible fails to connect to the host when multiple connections coexist
            Asked 2017-Sep-13 at 01:52

            I have an API server which may trigger multiple node-ansibles simultaneously to connect to a remote machine to do something.

            Here's the node.js code:

            ...

            ANSWER

            Answered 2017-Sep-13 at 01:52

            It's strange that setting the connection type to paramiko solves my problem.

            Here's the config file located in ~/.ansible.cfg:

            Source https://stackoverflow.com/questions/46174966

            QUESTION

            Ansible Task Clone Private Repo Hangs
            Asked 2017-May-24 at 08:50

            Set up a repo to set up a Laravel server. A provisioning script using Ansible basically.The repo is called Stedding. It is based on a Digital Ocean tutorial and some code from Roots Trellis as I need PHP 7.1 packages.

            Now the issue is that the private Github repo does not get cloned. Been reading on ssh agents, forwarding and all that. Tried sudoers and ansible.cfg setups like here. But no success yet. I prefer not to add private keys. So I tried what Geerlingguy suggested here using

            ...

            ANSWER

            Answered 2017-May-24 at 08:50

            In the end the main issue was that I needed to set agent forwarding properly. I did it using

            Source https://stackoverflow.com/questions/43961237

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ansible-ssh

            You can download it from GitHub.
            You can use ansible-ssh like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/2ndQuadrant/ansible-ssh.git

          • CLI

            gh repo clone 2ndQuadrant/ansible-ssh

          • sshUrl

            git@github.com:2ndQuadrant/ansible-ssh.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Python Libraries

            public-apis

            by public-apis

            system-design-primer

            by donnemartin

            Python

            by TheAlgorithms

            Python-100-Days

            by jackfrued

            youtube-dl

            by ytdl-org

            Try Top Libraries by 2ndQuadrant

            pglogical

            by 2ndQuadrantC

            bdr

            by 2ndQuadrantC

            pg_stat_plans

            by 2ndQuadrantC

            bdr-postgres

            by 2ndQuadrantC

            array_textsort

            by 2ndQuadrantC