See the service_facts module, new in Ansible 2.5. - name: Populate service facts service_facts: - debug: msg: Docker installed! when: "'docker' in services" Of course I could also just check if the wrapper script exists in /etc/init.d.
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core . To check whether it is installed ...
07.01.2021 · How to checking for a package in the system use Ansible. I use vagrant to create VMs. My example Ansible create multiple server here. I will …
10.03.2019 · Ansible: check if a package is installed on a remote system. Have a self-written letsencrypt role (see the Prometheus: RTFM blog monitoring set up …
The Ansible service_facts module is probably a good bet. IIRC the Apache service is named httpd on all major RHEL releases so you don't have to make release ...
09.08.2016 · You can run ad-hoc commands against an Ansible inventory or another list of hosts using ansible directly rather than ansible-playbook but that would be a very minor usage of a much more complex tool. Of course if you're already using Ansible then it might help to use the same tool but normally something like that would be checked with something like cluster SSH …
02.08.2018 · Configuring Ansible for Apache Once Ansible is installed, we need to specify Ansible which hosts to talk to. We could use the default host file located in /etc/ansible/hosts however, that is applied globally across your system and often requires admin permissions. To make things easier we will use a local hosts file.