---
- hosts: bb
tasks:
- yum: name={{ item }} state=installed
with_items:
- yum-utils
- bash-completion
- vim
- ntpdate
- device-mapper-persistent-data
- lvm2
- yum:
name:
# - docker-ce-20.10.21
- kubelet-1.22.17
- kubeadm-1.22.17
- kubectl-1.22.17
state: installed
- yum:
name: "{{ packages }}"
vars:
packages:
- ipvsadm
- ipset
state: installed
标签:play,name,17,installed,state,ansible,yum,1.22 From: https://www.cnblogs.com/LBSD/p/16989021.html