Horje
ansible only disable service if installed Code Example
ansible only disable service if installed
- shell: dpkg-query -W 'avahi'
  ignore_errors: True
  register: is_avahi
  when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

- shell: rpm -q 'avahi'
  ignore_errors: True
  register: is__avahi
  when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'

- service: name=avahi-daemon enabled=no state=stopped
  when: is_avahi|failed




Shell

Related
bash multiply float Code Example bash multiply float Code Example
how to opentext editor from terminal in ubuntu Code Example how to opentext editor from terminal in ubuntu Code Example
failed to load plugin '@typescript-eslint' declared in '.eslintrc.json': cannot find module 'eslint' Code Example failed to load plugin '@typescript-eslint' declared in '.eslintrc.json': cannot find module 'eslint' Code Example
linunx reload shell Code Example linunx reload shell Code Example
the requested url was not found on this server. apache/2.4.29 (ubuntu) server at Code Example the requested url was not found on this server. apache/2.4.29 (ubuntu) server at Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12