Playbook state:latestですべてのパッケージをアップデートする
環境
Ansible 2.9
RHEL8
Python 3.8
構文
yum:
name: '*'
state: latest
yum:
name: '*'
state: latest
yum: name: '*' state: latest
name: '*’ かつ state: latest を指定してすべてのパッケージをアップデートします。
使用例
OSのすべてのパッケージをアップデートします。
- hosts: all
become: yes
tasks:
- name: Update packages
yum:
name: '*'
state: latest
- hosts: all
become: yes
tasks:
- name: Update packages
yum:
name: '*'
state: latest
- hosts: all become: yes tasks: - name: Update packages yum: name: '*' state: latest
Ansible 実行後のアップデート可能パッケージチェック
# yum check-update