ansible-ssh-config
ansible-ssh-config copied to clipboard
the command is always reported as changed
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 could you please share the command you're using? a little easier to debug from that :)
- 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
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
Just found this patch on a fork from @grypyrg which solved my issue: https://github.com/grypyrg/ansible-ssh-config/commit/dc32394c2f458b87aa7ba67e0f88ea8ebaf6b02f
I sent a new PR https://github.com/gaqzi/ansible-ssh-config/pull/29. I thought I sent it before.
a related PR for multiple entries on the list - #30.