在 M1 Mac 上的 Rosetta 2 仿真下,Ansible return as `ansible_machine` 和 `ansible_architecture` 是什么

What does Ansible return as `ansible_machine` and `ansible_architecture` under the Rosetta 2 emulation on M1 Mac

在 M1 Mac书籍上,ansible_architectureansible_machine returns 相同的值是 arm64:

shuuji3@momo mac-dev-playbook
> ansible -m setup localhost | egrep '_architecture|_machine'
        "ansible_architecture": "arm64",
        "ansible_machine": "arm64",

在 M1 上的 Rosetta 2 仿真下如何 Mac?

在 M1 Mac 上使用 Rosetta 2 仿真(Intel 模式)时,Ansible returns x86_64 值与之前的 intel Mac:

shuuji3@momo ~ % ansible -m setup localhost | egrep '_architecture|_machine'
        "ansible_architecture": "arm64",
        "ansible_machine": "arm64",

# Run the shell on the Intel mode
shuuji3@momo ~ % env /usr/bin/arch -x86_64 /bin/zsh --login

shuuji3@momo ~ % ansible -m setup localhost | egrep '_architecture|_machine'
        "ansible_architecture": "x86_64",
        "ansible_machine": "x86_64",
        "ansible_userspace_architecture": "x86_64",

请注意,Ansible 添加了 ansible_userspace_architecture 事实。

参考资料