zoukankan      html  css  js  c++  java
  • [Ansible]yum_repository模块 添加 删除yum源

    添加yum源

    ansible all -m yum_repository -a "name=epel 
    description='EPEL TUM repo' 
    baseurl='https://mirrors.aliyun.com/epel/7/x86_64/' 
    gpgcheck=no 
    enabled=yes"
    

    删除yum源 只能删除自己管理过的否则无法删除

    ansible all -m yum_repository -a "name=epel 
    state=absent"
    

    测试结果

    [root@ceph2 ~]# yum repolist
    已加载插件:fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.tuna.tsinghua.edu.cn
     * extras: mirrors.tuna.tsinghua.edu.cn
     * updates: mirrors.tuna.tsinghua.edu.cn
    源标识                                                                                源名称                                                                                   状态
    Ceph                                                                                  Ceph                                                                                        107
    Ceph_X86_64                                                                           Ceph_X86_64                                                                                 588
    base/7/x86_64                                                                         CentOS-7 - Base                                                                          10,070
    epel                                                                                  EPEL TUM repo                                                                            13,446
    extras/7/x86_64                                                                       CentOS-7 - Extras                                                                           413
    updates/7/x86_64                                                                      CentOS-7 - Updates                                                                        1,127
    repolist: 25,751
    

    END

  • 相关阅读:
    polly异常重试、熔断
    ASP.NET Core-Linux发布部署
    ASP.NET Core-扩展Views的几种方式
    ASP.NET Core-使用AspNetCore实现AOP

    Docker-Dockerfile2
    Docker-Dockerfile1
    Docker-搭建私有仓库步骤


  • 原文地址:https://www.cnblogs.com/leoshi/p/13666401.html
Copyright © 2011-2022 走看看