在M1 Mac上的Rosetta 2仿真下,Ansible会以"ansible_machine"和"ansible_architecture"的形式返回什么? [英] What does Ansible return as `ansible_machine` and `ansible_architecture` under the Rosetta 2 emulation on M1 Mac

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

问题描述

在M1 MacBook上, ansible_architecture ansible_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.

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

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