- name: sysprep for debian/ubuntu systems gather_facts: no hosts: "{{target}}" become: "{{become}}" tasks: #- assert: # that: ansible_facts['os_family'] == "Debian" # that works only when inventory_hostname is a true hostname - not just an ip - name: hostname matches inventory hostname: name: "{{inventory_hostname}}" - name: debian sysprep ansible.builtin.script: cmd: scripts/debian-sysprep.bash {{group_names[0]}} {{country_code}} {{timezone}} chdir: /root register: script_output changed_when: >- "changed - all done" in script_output.stdout - name: display script stdout debug: var=script_output.stdout_lines when: script_output.stdout is defined - name: display script stderr debug: var=script_output.sterr_lines when: script_output.sterr is defined # shared local scripts and such - import_tasks: tasks-common-postinstall.yml