Ansible
- Ansible(1)Ansibleの概要
- Ansible(2)ファイル関連モジュール
- Ansible(3)システム管理モジュール
- Ansible(4)コマンド実行モジュール
- Ansible(5)パッケージ管理関連モジュール
yum_repository
YUMリポジトリの追加削除を行う。
| 変数 | デフォルト | 内容 | 備考 |
|---|---|---|---|
| name | 必須 | レポジトリ名 | |
| description | 詳細内容 | ||
| baseurl | ベースURL | ||
| gpgkey | GPG KEYのURL | ||
| gpgcheck | システムに依存 | GPGチェックをするかどうか | |
| enabled | yes | 有効化するかどうか |
Example
- name: Add repository
yum_repository:
name: epel
description: EPEL YUM repo
enabled: no
baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/
gpgkey: https://download.fedoraproject.org/pub/fedora/epel/RPM-GPG-KEY-EPEL-7
gpgcheck: yes
yum
YUMによるパッケージのインストールや更新、削除を行う。
| 変数 | デフォルト | 内容 | 備考 |
|---|---|---|---|
| name | パッケージ名 | 全てを選択する場合は* | |
| enablerepo | 有効化するリポジトリ名 | ||
| security | no | セキュリティ関連の更新のみインストール | |
| state | 実行内容 | absent, installed, latest, present, removed |
Example
- name: ensure a list of packages installed
yum:
name: "{{ packages }}"
enablerepo: epel
vars:
packages:
- httpd
- httpd-tools
- name: upgrade all packages about security
yum:
name: '*'
state: latest
security: yes