Ansible date variable

后端 未结 5 1682
醉酒成梦
醉酒成梦 2020-12-29 01:21

I\'m trying to learn how to use Ansible facts as variables, and I don\'t get it. When I run...

$ ansible localhost -m setup

...it lists all

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-29 01:36

    Note that the ansible command doesn't collect facts, but the ansible-playbook command does. When running ansible -m setup, the setup module happens to run the fact collection so you get the facts, but running ansible -m command does not. Therefore the facts aren't available. This is why the other answers include playbook YAML files and indicate the lookup works.

提交回复
热议问题