Git Product home page Git Product logo

Comments (2)

satshas avatar satshas commented on July 20, 2024

Hello,

I have the same issue deploying with Docker, while trying to connect with a different user than root (but still having root privileges).

fatal: [XXX.XXX.XXX.XXX]: UNREACHABLE! => {
    "changed": false,
    "unreachable": true
}

MSG:

Failed to connect to the host via ssh: Warning: Permanently added 'XXX.XXX.XXX.XXX' (ECDSA) to the list of known hosts.
[email protected]: Permission denied (publickey,password).



PLAY RECAP ****************************************************************************
XXX.XXX.XXX.XXX            : ok=0    changed=0    unreachable=1    failed=0 

Same as above, outside deployment the SSH is working fine, and did work fine during the deployment guide.
I also tried to change options of the ansible.cfg inside the leihs instance but I saw it gets rewritten while running the deploy.

Do you know a quick solution to the problem?

Control machine: Ubuntu 20.04
Host: Ubuntu Server 16.04

Daniele

from leihs-instance.

lbarning avatar lbarning commented on July 20, 2024

We needed to add the local ssh-files to the scripts/-from-docker file.

-v "/home/$USER/.ssh/:/root/.ssh/" \

Our files looks like this:

#!/bin/sh -eu

# build the docker image and tag it with a name
docker build -t leihs/ansible-controller ./leihs/deploy

# start a temporary container from this image,
# mounting our working directory in it,
# passing through ssh-agent from host so passwordless auth works,
# then run given command
docker run --rm -it \
    -w "/leihs-instance/leihs/deploy" \
    -v "$(pwd):/leihs-instance" \
    -v "$(pwd)/tmp:/tmp/tmp" \
    -v "$(pwd)/leihs:/leihs" \
    -e S3_CACHE_ENDPOINT="${S3_CACHE_ENDPOINT:-}" \
    -e S3_CACHE_BUCKET="${S3_CACHE_BUCKET:-}" \
    -e S3_ACCESS_KEY_ID="${S3_ACCESS_KEY_ID:-}" \
    -e S3_SECRET_ACCESS_KEY="${S3_SECRET_ACCESS_KEY:-}" \
    -v "/home/$USER/.ssh/:/root/.ssh/" \
    leihs/ansible-controller \
    "$@"

After that we got an error regarding the .ssh/config file which was moved to config.old as a quick fix.
I hope this is helpful.

Lukas

from leihs-instance.

Related Issues (20)

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.