ansible - 在 M1 Mac 上的 Rosetta 2 仿真下,Ansible 以“ansible_machine”和“ansible_architecture”的形式返回什么
问题描述
在 M1 MacBook 上,ansible_architecture
返回ansible_machine
相同的值arm64
:
shuuji3@momo mac-dev-playbook
> ansible -m setup localhost | egrep '_architecture|_machine'
"ansible_architecture": "arm64",
"ansible_machine": "arm64",
在 M1 Mac 上的 Rosetta 2 仿真下呢?
解决方案
在 M1 Mac 上使用 Rosetta 2 仿真(Intel 模式)时,Ansible 返回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
事实。
参考
推荐阅读
- ms-access - MS Access 一次转置一行
- flutter - 如何像照片中一样对齐 UI
- spring-boot - 使用 axios 在 React 中实现搜索栏
- tensorflow - 在 virtualenv 中安装 tensorflow 后,vscode 说找不到模块 [ubuntu20.04]
- python - Python 导入脚本不起作用(错误:找不到模块)
- java - 如何在字符串中打印第一个最少重复字符
- aws-lambda - 为什么我在本地运行笔记本时可以导入 LambdaStep,但在 Sagemaker Studio 中运行时却不能?
- linux - 当我使用 link() 系统调用时,在 UNIX 文件系统(更具体地说,文件描述符、打开文件表和 inode)中发生了什么?
- google-play - 谷歌播放付款问题
- html - 如何在页面中插入不可选择的引号(通常在开头)?