ansible-ssh-config icon indicating copy to clipboard operation
ansible-ssh-config copied to clipboard

the command is always reported as changed

Open JanMalte opened this issue 8 years ago • 6 comments

using this great command to set up .ssh/config is always reporting as changed to ansible. It should only report as changed, if the file was changed.

JanMalte avatar Aug 03 '16 12:08 JanMalte

@JanMalte could you please share the command you're using? a little easier to debug from that :)

gaqzi avatar Aug 03 '16 14:08 gaqzi

- name: add gitlab.company.de to ssh config
  ssh_config: host=gitlab.company.de
              hostname=queen.company.de
              port=2215
              remote_user=git
              identity_file=/root/.ssh/id_gitlab_deploy
              user=root
              state=present
  tags: ssh

- name: add gitlab.3rdparty to ssh config
  ssh_config: host=gitlab.3rdparty
              hostname=gitlab.3rdparty
              remote_user=git
              identity_file=/root/.ssh/id_gitlab_deploy
              strict_host_key_checking=no
              user=root
              state=present
  tags: ssh

JanMalte avatar Aug 03 '16 20:08 JanMalte

Did you get anywhere with this? I'm currently experiencing the same issue with the below config:

- name: Add deploy keys to ssh config
  ssh_config:
    user: "{{ ansible_user }}"
    host: "{{ item.host }}"
    hostname: github.com
    identity_file: "~/.ssh/{{ item.identity_file }}"
    strict_host_key_checking: true
    state: present
  with_items:
    - host: repo1.github.com
      identity_file: repo1_deploy.github.id_rsa
    - host: repo2.github.com
      identity_file: repo2_deploy.github.id_rsa

dabrowne avatar Sep 01 '17 08:09 dabrowne

Just found this patch on a fork from @grypyrg which solved my issue: https://github.com/grypyrg/ansible-ssh-config/commit/dc32394c2f458b87aa7ba67e0f88ea8ebaf6b02f

dabrowne avatar Sep 01 '17 08:09 dabrowne

I sent a new PR https://github.com/gaqzi/ansible-ssh-config/pull/29. I thought I sent it before.

grypyrg avatar Sep 01 '17 10:09 grypyrg

a related PR for multiple entries on the list - #30.

szpak avatar Jun 29 '18 15:06 szpak