Use multiple command line modules

Hi everyone,
Is it possible, with ansible command, to use multiple modules without having to create a playbook each time ?
I tried this, but it’s not run correctly.
ansible -m service_facts,debug -a “msg={{ ansible_facts.services[‘…’][‘state’] }}” localhost
I have this error
localhost | FAILED! => {
“msg”: “The task includes an option with an undefined variable. The error was: ‘dict object’ has no attribute ‘services’. ‘dict object’ has no attribute ‘services’. ‘dict object’ has no attribute ‘services’. ‘dict object’ has no attribute ‘services’”
}
Thanks

Hi,

No, AFAIK. ansible command works on task level (one invocation at a time), as ansible-playbook does on play level.

ok, thank you, i’m going to do playbook