From 833d1215a3cf3a430dc290f0ab585ca765e0092a Mon Sep 17 00:00:00 2001 From: jerome Date: Wed, 21 May 2025 07:19:34 +0200 Subject: script_local --- playbooks/lxc.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'playbooks/lxc.yml') diff --git a/playbooks/lxc.yml b/playbooks/lxc.yml index 3fb1b18..666cfb3 100644 --- a/playbooks/lxc.yml +++ b/playbooks/lxc.yml @@ -55,18 +55,18 @@ shell: "lxc-info -iH debian-lxc" register: ip_debian - - name: ssh-keyscan ip debian - remote_user: "jerome" - become: no - local_action: shell ssh-keyscan -H {{ip_debian.stdout}} >> ~/.ssh/known_hosts - - - name: ssh-keyscan ip rocky + - name: inventaire remote_user: "jerome" become: no - local_action: shell ssh-keyscan -H {{ip_rocky.stdout}} >> ~/.ssh/known_hosts + copy: + content: "[containers]\n{{ip_rocky.stdout}}\n{{ip_debian.stdout}}" + dest: "hosts" + delegate_to: localhost - - name: inventaire + - name: ssh-keyscan remote_user: "jerome" become: no - local_action: copy content="[containers]\n{{ip_rocky.stdout}}\n{{ip_debian.stdout}}" dest="hosts" + shell: + cmd: ssh-keyscan -H -f hosts >> ~/.ssh/known_hosts + delegate_to: localhost -- cgit v1.2.3