Skip to main content

Ansible Version

verdate
ansible 4.02021-05-11
ansible-core 2.112021-04-27
ansible 3.02021-02-09

ansible 4.0

# 获取当前安装版本
python -c 'from ansible_collections.ansible_release import ansible_version; print(ansible_version)'

ansible-core 2.11

  • ansible-base 重命名为 ansible-core
  • 可从 collection 执行 playbooks
  • 可从本地安装 Ansible Collections
  • reinstall collection 可升级
  • 参考
# 从 collection 执行 playbook
ansible-playbook my_namespace.my_collection.playbook1 -i ./myinventory
# collection 中的 playbook
- import_playbook: my_namespace.my_collection.playbookX

ansible 3.0

ansible-base 2.10

  • 将非 base 模块划分为小的 collection,由 galaxy 分发
    • collection 能够包含几乎所有的 ansible 扩展点 - roles, plugins, modules, playbooks
    • 替代之前 galaxy 的 role 分发模式
    • ansible-base 3 MB 安装后 14 MB
    • ansible 44 MB 安装后 334 MB
  • 内置 collection 列表
  • 新增 ansible-base 包
  • CHANGELOG-v2.10
  • unvault - 新增 lookup 插件 - 读取加密文件内容
  • 废弃 hash_behaviour
  • 停止支持 Windows Server 2008
  • fact 包含 ansible_processor_nproc
note
  • 尚且无法执行 collection 中的 playbooks - #67435

2.9

  • 新增命令行补全
# 参数补全
python -m pip install argcomplete

# 启用补全
activate-global-python-argcomplete
# 或
eval $(register-python-argcomplete ansible)
eval $(register-python-argcomplete ansible-config)
eval $(register-python-argcomplete ansible-console)
eval $(register-python-argcomplete ansible-doc)
eval $(register-python-argcomplete ansible-galaxy)
eval $(register-python-argcomplete ansible-inventory)
eval $(register-python-argcomplete ansible-playbook)
eval $(register-python-argcomplete ansible-pull)
eval $(register-python-argcomplete ansible-vault)