我正在寻找包含以下信息的事实:
$ dpkg --print-architecture
amd64
我找不到它:
$ ansible host -m setup | grep amd64
"BOOT_IMAGE": "/boot/vmlinuz-4.19.0-6-amd64",
"ansible_kernel": "4.19.0-6-amd64",
"BOOT_IMAGE": "/boot/vmlinuz-4.19.0-6-amd64",
答案 0 :(得分:0)
您可以做(这对所有事情都有效):
ansible HOST -m setup -a 'filter=ansible_architecture'
或者(仅在Debian上有效):
- name: Get DEB architecture
shell: dpkg --print-architecture
register: deb_architecture
- name: Print DEB architecture
debug:
msg: "deb_architecture.stdout: {{ deb_architecture.stdout }}"