Suppress yum/dnf/rpm command warnings

Ansible throws warnings when using yum/dnf/rpm with the command
module:

    [WARNING]: Consider using yum module rather than running yum

This patch adds the `warn: no` argument to suppress the warnings
in the Ansible output.
pull/2038/head
Major Hayden 2017-10-12 08:38:01 -05:00
parent 002b0341d0
commit 33b200d43a
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
6 changed files with 18 additions and 0 deletions

View File

@ -610,6 +610,8 @@
- name: remove package dependencies on redhat
command: yum -y autoremove
args:
warn: no
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "yum" and
@ -617,6 +619,8 @@
- name: remove package dependencies on redhat again
command: yum -y autoremove
args:
warn: no
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "yum" and
@ -624,6 +628,8 @@
- name: remove package dependencies on redhat
command: dnf -y autoremove
args:
warn: no
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "dnf" and
@ -631,6 +637,8 @@
- name: remove package dependencies on redhat again
command: dnf -y autoremove
args:
warn: no
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "dnf" and

View File

@ -1,6 +1,8 @@
---
- name: check ntp installation on atomic
command: rpm -q chrony
args:
warn: no
register: ntp_pkg_query
ignore_errors: true
always_run: true

View File

@ -1,6 +1,8 @@
---
- name: check ntp installation on redhat
command: rpm -q ntp
args:
warn: no
register: ntp_pkg_query
ignore_errors: true
always_run: true

View File

@ -22,6 +22,8 @@
# Remove yum caches so yum doesn't get confused if we are reinstalling a different ceph version
- name: purge yum cache
command: yum clean all
args:
warn: no
changed_when: false
when:
ansible_pkg_mgr == 'yum'

View File

@ -1,6 +1,8 @@
---
- name: check ntp installation on atomic
command: rpm -q chrony
args:
warn: no
register: ntp_pkg_query
ignore_errors: true
always_run: true

View File

@ -1,6 +1,8 @@
---
- name: check ntp installation on redhat
command: rpm -q ntp
args:
warn: no
register: ntp_pkg_query
ignore_errors: true
always_run: true