--- - hosts: all tasks: - name: get server hostname command: hostname