ansibleのyumモジュール


実はこれらのものは、以前を含めてずっと前のもので、忘れてしまうのを恐れて、記録しておきます.その时、ひっくり返すことができます.初めて接触した时、手が速いと感じたので、パッケージされています.
たとえばvimをインストールする必要があるマシンのセットがある場合、1つのサーバ上でsshを実行してyum install vim-yを実行することはできません.少ない話はまだ広くて、多い話、ほほほ.
yumモジュールの使い方
[root@ansible ~]# ansible-doc -s yum
less 436
Copyright (C) 1984-2009 Mark Nudelman
less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Homepage: http://www.greenwoodsoftware.com/less
- name: Manages packages with the `yum' package manager
  action: yum
      conf_file              # The remote yum configuration file to use for the transaction.
      disable_gpg_check      # Whether to disable the GPG checking of signatures of packages being installed. Has an effect only
                               if state is `present' or `latest'.
      disablerepo            # `Repoid' of repositories to disable for the install/update operation. These repos will not
                               persist beyond the transaction. When specifying multiple repos,
                               separate them with a ",".
      enablerepo             # `Repoid' of repositories to enable for the install/update operation. These repos will not persist
                               beyond the transaction. When specifying multiple repos, separate
                               them with a ",".
      exclude                # Package name(s) to exclude when state=present, or latest
      list                   # Various (non-idempotent) commands for usage with `/usr/bin/ansible' and `not' playbooks. See
                               examples.
      name=                  # Package name, or package specifier with version, like `name-1.0'. When using state=latest, this
                               can be '*' which means run: yum -y update. You can also pass a url
                               or a local path to a rpm file.  To operate on several packages
                               this can accept a comma separated list of packages or (as of 2.0)
                               a list of packages.
      state                  # Whether to install (`present' or `installed', `latest'), or remove (`absent' or `removed') a
                               package.
      update_cache           # Force updating the cache. Has an effect only if state is `present' or `latest'.

yumパッケージマネージャを使用してパッケージを管理する
オプション:
    config_file:yumのプロファイル
    disable_gpg_check:gpg_を閉じるcheck
disablerepo:ソースを有効にしない
enablerepo:ソースを有効にする
    list
name:操作するパッケージの名前は、urlまたはローカルrpmパッケージのパスを渡すこともできます.
state:ステータス(present,absent,latest)
例はyumを使用してvimをインストールします.ここではすでにインストールされています.他の選択は自分の必要に応じて勝手に選択します.
[root@ansible ~]# ansible web -m yum -a 'name=vim state=present'
web | SUCCESS => {
    "changed": false, 
    "msg": "", 
    "rc": 0, 
    "results": [
        "vim-enhanced-2:7.4.629-5.el6.x86_64 providing vim is already installed"
    ]
}