---

- name: copy Python files to target
  copy:
    src: unity
    dest: ~/roles/unity/files/
    mode: 0755
  when: ansible_connection != "local"

- name: Accept EULA
  command: python ./roles/unity/files/unity/unity_cmd.py accept-eula {{ host }} {{ username }} {{ old_password }}
  register: out

- name: Update Password
  command: python ./roles/unity/files/unity/unity_cmd.py update-password {{ host }} {{ username }} {{ old_password }} {{ password }}
  register: out

- name: Update DNS servers
  command: python ./roles/unity/files/unity/unity_cmd.py update-dns {{ host }} {{ username }} {{ password }} {{ dns_servers }}
  register: out

- name: Update NTP servers
  command: python ./roles/unity/files/unity/unity_cmd.py update-ntp {{ host }} {{ username }} {{ password }} {{ ntp_servers }}
  register: out

- debug: var=out.stdout_lines

---

- name: copy Python files to target
  copy:
    src: unity
    dest: ~/roles/unity/files/
    mode: 0755
  when: ansible_connection != "local"

- name: Accept EULA
  command: python ./roles/unity/files/unity/unity_cmd.py accept-eula {{ host }} {{ username }} {{ old_password }}
  register: out

- debug: var=out.stdout_lines

- name: Update Password
  command: python ./roles/unity/files/unity/unity_cmd.py update-password {{ host }} {{ username }} {{ old_password }} {{ password }}
  register: out

- debug: var=out.stdout_lines

- name: Update DNS servers
  command: python ./roles/unity/files/unity/unity_cmd.py update-dns {{ host }} {{ username }} {{ password }} {{ dns_servers }}
  register: out

- debug: var=out.stdout_lines

- name: Update NTP servers
  command: python ./roles/unity/files/unity/unity_cmd.py update-ntp {{ host }} {{ username }} {{ password }} {{ ntp_servers }}
  register: out

- debug: var=out.stdout_lines

Print outcome out after each API call
Print outcome out after each API call
