案例:升级CentOS操作系统
说明
初步的playbook
- hosts: new
tasks:
- name: clean no need repo config
command: rm -f /etc/yum.repos.d/*
notify:
- Remove all old repo config
- name: cp rhel.repo
copy: src=rhel.repo dest=/etc/yum.repos.d/rhel.repo owner=root group=root mode=0644
- name: upgrade all packages
yum: name=* state=latest改进后的playbook
删除目录下多个文件的技巧
从远程目录下载多个文件
创建远程目录
rpm安装
执行
sudo
参考
Last updated