Playbook パッケージのアンインストールの書き方のサンプル
環境
Ansible 2.9
RHEL8
Python 3.8
構文
yum :
name:パッケージ名
state:absent
yum :
name:パッケージ名
state:absent
yum : name:パッケージ名 state:absent
使用例
- hosts: all
become: yes
tasks:
- name: Uninstall httpd
yum:
name: httpd
state: absent
- hosts: all
become: yes
tasks:
- name: Uninstall httpd
yum:
name: httpd
state: absent
- hosts: all become: yes tasks: - name: Uninstall httpd yum: name: httpd state: absent
Ansible 実行後のインストール済みパッケージ確認
# yum list installed | grep httpd