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
posted @ 2018-11-21 15:47  Done、  阅读(200)  评论(0编辑  收藏  举报