Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (2.3k points)

Hey guys, so i've been trying to get a list of all the apps on my RHEL 7 machine but using the service --list-all i don't get anything. Is it possible to use ansible to list all the commands.

I've been using this command adhoc:

ansible all -m raw -a "systemctl list-unit-files | grep enabled"

2 Answers

0 votes
by (12.4k points)

You can try the below command for this:

 - name: yum_command 

  yum:

    list=installed

  register: yum_packages

- debug:

    var: yum_packages

Want To Learn more about DevOps? Then do check out: DevOps Training

To know more about Ansible, check out: 

0 votes
by (6.9k points)

Try running this playbook, it should give you the list of all the commands: 

- name: yum_command 

  yum:

    list=installed

  register: yum_packages

- debug:

    var: yum_packages

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...