--- - name: Set up an autocluster SSH key for the current user connection: local hosts: localhost tasks: - name: create SSH autocluster ID # Not the most modern but compatibile with old distros such as # Centos 6 command: > ssh-keygen -b 2028 -t rsa -N "" -C "autocluster" -f "{{ ansible_env.HOME }}/.ssh/id_autocluster" args: creates: "{{ ansible_env.HOME }}/.ssh/id_autocluster" - name: create SSH autocluster.d/ configuration directory file: path: "{{ ansible_env.HOME }}/.ssh/autocluster.d" state: directory - name: update SSH config to include config autocluster clusters lineinfile: path: "{{ ansible_env.HOME }}/.ssh/config" regexp: "^Include autocluster\.d/\*\.config$" line: "Include autocluster.d/*.config"