LoginSignup
25
24

More than 5 years have passed since last update.

yumモジュールでenablerepoを複数指定する場合の小ネタ

Last updated at Posted at 2013-10-22

正しい書き方

(2013/12/07)yteraokaさんのご指摘で、正しい動作はこちらであることを確認しました。
CLI上でのyum同様、リポジトリの指定はカンマ区切りとなります。

環境

$ ansible-playbook --version
ansible-playbook 1.4.1 (1.4.1 7bf799af65)
- name: Install Redis
  yum: pkg={{ item }} state=present enablerepo=remi,epel
  with_items:
    - redis #in remi
    - gperftools-libs #in epel dependency
    - libunwind #in epql dependency
    - libunwind-devel #in epel ??

間違った書き方

(2013/12/07)以下は掲載当初のもので間違った書き方です。使用しないでください。

ansibleのyumモジュールで複数のリポジトリを指定する場合は以下のようにします。

- name: Install Redis
  yum: pkg={{ item }} state=present enablerepo=remi enablerepo=epel
  with_items:
    - redis #in remi
    - gperftools-libs #in epel dependency
    - libunwind #in epql dependency
    - libunwind-devel #in epel ??

コマンドラインからのyumと違うので注意が必要です。
コマンドラインだとカンマ区切りで指定できます。

$ yum install redis --enablerepo=remi,epel
25
24
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
24