- hosts: localhost connection: local gather_facts: false vars: include_path: ~/.ssh/config.d/codemonkey.config tasks: - name: Include ssh config dir lineinfile: path: ~/.ssh/config line: Include ~/.ssh/config.d/* state: present insertbefore: BOF - name: ensure ssh config dir exists file: path: ~/.ssh/config.d state: directory - name: Creating local SSH config files template: lstrip_blocks: true src: create_ssh_config.j2 dest: "{{ include_path }}" mode: 0644