Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (23 sloc) 504 Bytes
---
- name: start httpd if it's stopped
hosts: node-1
become: yes
tasks:
- name: install httpd
yum:
name: httpd
state: latest
- name: check httpd processes is running
shell: ps -ef |grep http[d]
register: ret
ignore_errors: yes
changed_when: no
- name: print return value
debug:
var: ret
- name: start httpd (httpd is stopped)
service:
name: httpd
state: started
when:
- ret.rc == 1
You can’t perform that action at this time.