geerlingguy/ansible-for-devops

Suboptimal command - Chapter 2 - Your first Ansible playbook

gunchev opened this issue · 0 comments

The example here is:

if ! rpm -qa | grep -qw chrony; then

which can be written simply as:

if ! rpm -q chrony --quiet; then

or

if ! rpm -q --quiet chrony; then

Which in turn will use index in the RPM's sqlite DB (or previously BDB).

Reporting as directed on Twitter :-)