Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

the command is always reported as changed #25

Open
JanMalte opened this issue Aug 3, 2016 · 6 comments
Open

the command is always reported as changed #25

JanMalte opened this issue Aug 3, 2016 · 6 comments

Comments

@JanMalte
Copy link

JanMalte commented Aug 3, 2016

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.

@gaqzi
Copy link
Owner

gaqzi commented Aug 3, 2016

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

@JanMalte
Copy link
Author

JanMalte commented Aug 3, 2016

- 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

@dabrowne
Copy link

dabrowne commented Sep 1, 2017

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
Copy link

dabrowne commented Sep 1, 2017

Just found this patch on a fork from @grypyrg which solved my issue: grypyrg@dc32394

@grypyrg
Copy link
Contributor

grypyrg commented Sep 1, 2017

I sent a new PR #29. I thought I sent it before.

@szpak
Copy link

szpak commented Jun 29, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants