Ansible 在 M1 Mac 上的 Rosetta 2 仿真下作为 `ansible_machine` 和 `ansible_architecture` 返回什么 [英] What does Ansible return as `ansible_machine` and `ansible_architecture` under the Rosetta 2 emulation on M1 Mac

查看:17
本文介绍了Ansible 在 M1 Mac 上的 Rosetta 2 仿真下作为 `ansible_machine` 和 `ansible_architecture` 返回什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 M1 MacBook 上,ansible_architectureansible_machine 返回与 arm64 相同的值:

On a M1 MacBook, ansible_architecture and ansible_machine returns the same value that is arm64:

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

在 M1 Mac 上的 Rosetta 2 仿真下怎么样?

What about under the Rosetta 2 emulation on M1 Mac?

推荐答案

在 M1 Mac 上使用 Rosetta 2 仿真(Intel 模式)时,Ansible 返回 x86_64 值,就像以前的 intel Mac:

When using the Rosetta 2 emulation (Intel mode) on the M1 Mac, Ansible returns x86_64 values like the previous 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 事实.

Note that Ansible adds the ansible_userspace_architecture fact.

这篇关于Ansible 在 M1 Mac 上的 Rosetta 2 仿真下作为 `ansible_machine` 和 `ansible_architecture` 返回什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆