ansible upload

# 链接地址:https://www.cnblogs.com/xiaoxiaoleo/p/6626299.html
# synchronize: 从拉取远程服务器文件,需要加mode: pull
# unarchive: 解压远程服务器文件,需要加copy: no
---
- hosts: notfontserver
  tasks:
  - name: 在没有字体的主机上,安装fontconfig服务
    yum: name=fontconfig state=latest

- hosts: notfontserver
  tasks:
  - name: 将本机字体打包文件(/home/yutang/fonts.tar.gz)传输到没有字体的主机
    synchronize:
      src: /home/yutang/fonts.tar.gz
      dest: /usr/share/fonts.tar.gz

- hosts: notfontserver
  tasks:
  - name: 解压远程主机的打包文件,禁止复制
    unarchive: 
      src: /usr/share/fonts.tar.gz
      dest: /usr/share/
      copy: no

- hosts: notfontserver
  tasks:
  - name: 刷新字体库
    shell:  fc-list

猜你喜欢

转载自www.cnblogs.com/ipyanthony/p/9995546.html