Coder Social home page Coder Social logo

ansible-role-ssh_keys's People

Contributors

eusebium avatar

Watchers

 avatar

ansible-role-ssh_keys's Issues

sh_keys_ssh_keyscan_hosts: generates an error

Hi,

I've got an error caused by the defaults/main.yml

ssh_keys_ssh_keyscan_hosts:
  - "{{ ansible_fqdn }}"
  - "{{ ansible_hostname }}"
  - "{{ ansible_default_ipv4.address }}"
  - "{{ ansible_eth1.ipv4.address | default(omit) }}"    <--- Causes Error 

I've implemeted an workaround like this:

# When updating known_hosts select how you will reach the ssh server (ip or hostname).
# Default is all.
ssh_keys_ssh_keyscan_common_hosts:
  - "{{ ansible_fqdn }}"
  - "{{ ansible_hostname }}"
  - "{{ ansible_default_ipv4.address }}"
ssh_keys_ssh_keyscan_hosts: "{{ (ssh_keys_ssh_keyscan_common_hosts +\
  [ ansible_eth1.ipv4.address ]) if ansible_eth1.ipv4.address is defined else ssh_keys_ssh_keyscan_common_hosts }}"

Maybe you'll implement that, else I'm setting the variable ssh_keys_ssh_keyscan_hosts in group_vars.

Thanks for publishing the role.

Josef

Environment

$ ansible --version
ansible 2.9.13
  config file = /home/admin/swarm-cluster/ansible.cfg
  configured module search path = ['/home/admin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0]


$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"

$ ip addr | grep "inet "
    inet 127.0.0.1/8 scope host lo
    inet 192.168.1.201/24 brd 192.168.1.255 scope global dynamic ens192

Error message

TASK [eusebium.ssh_keys : SSH gather host keys] ******************************************************************************************************
task path: /home/admin/swarm-cluster/roles/eusebium.ssh_keys/tasks/main.yml:84


failed: [swarm2 -> swarm2] (item=__omit_place_holder__f35f1a15d9edae6ae7c3e2c9e3789e5047a8d0cb) => {
    "ansible_loop_var": "item",
    "changed": false,
    "cmd": [
        "ssh-keyscan",
        "__omit_place_holder__f35f1a15d9edae6ae7c3e2c9e3789e5047a8d0cb"
    ],
    "delta": "0:00:05.040866",
    "end": "2020-10-02 16:19:12.998494",
    "item": "__omit_place_holder__f35f1a15d9edae6ae7c3e2c9e3789e5047a8d0cb",
    "rc": 1,
    "start": "2020-10-02 16:19:07.957628"
}

MSG:

non-zero return code
failed: [swarm1 -> swarm1] (item=__omit_place_holder__f35f1a15d9edae6ae7c3e2c9e3789e5047a8d0cb) => {
    "ansible_loop_var": "item",
    "changed": false,
    "cmd": [
        "ssh-keyscan",
        "__omit_place_holder__f35f1a15d9edae6ae7c3e2c9e3789e5047a8d0cb"
    ],
    "delta": "0:00:05.060103",
    "end": "2020-10-02 16:19:12.998428",
    "item": "__omit_place_holder__f35f1a15d9edae6ae7c3e2c9e3789e5047a8d0cb",
    "rc": 1,
    "start": "2020-10-02 16:19:07.938325"
}

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.