Can't figure out how use "gather_facts" on remote host
I have a AAP job with survey question to fill in variable vm_name and works.
then the first lines of code in job are i try to explicitly do this
- name: Test if can gather facts from server job runs on
- hosts: "{{ vm_name }}"
gather_facts: true
it crashes with syntax errors, i have tried 5 versions of those lines changing indenting and removing -name line as well, no luck.
My role main.yml
-
name: Take VM Snapshot
ansible.builtin.include_tasks:
file: snapshot.yml -
name: Run CIS Benchmark Script
ansible.builtin.include_tasks:
file: script.yml
it crashes on script.yml . if you want job output let me know.
thank you.