Kira-kira begini cara melakukannya (tetapi belum teruji):
- name: Retrieve stuff from mysql
command: >
mysql --user=alice --password=topsecret dbname
--host=147.102.160.1 --batch --skip-column-names
--execute="SELECT stuff from stuff_table"
register: stuff
check_mode: no
changed_when: False
- name: Do something with stuff
debug: "{{ item }}"
with_items: stuff.stdout_lines
Didokumentasikan di sini .