- name: Create the home volume tags: active hosts: localhost connection: local roles: - storage - name: Create BSDNIX Servers tags: active hosts: vps connection: local gather_facts: False user: root roles: - role: install # during testing the ip addresses change all the time, so tune the # known_hosts file accordingly after setup - name: Add/cleanup public keys of all vps' to known_hosts file tags: active hosts: localhost connection: local gather_facts: false vars: ssh_known_hosts_file: "{{ lookup('env','HOME') + '/.ssh/known_hosts' }}" ssh_known_hosts: "{{ groups['running'] }}" tasks: - shell: "ssh-keygen -f '/home/scip/.ssh/known_hosts' -R {{ item }}" loop: "{{ ssh_known_hosts | map('extract', hostvars, ['ipv6']) | list }}"