notify and handlers: in a role dont work

27 views
Skip to first unread message

Noam Greenberg

unread,
May 28, 2015, 12:46:54 PM5/28/15
to ansible...@googlegroups.com
Hi
i think this is a bug but can be that i dont understand the Docs ...

i have main play
```
- hosts: all
  gather_facts: yes
  user: root

  vars_files:
    - nagios/GlobalVar/main.yml
  vars_prompt:
    - name: password
      prompt: "MYSQL Pass that you will use Enter password"
      private: yes
  tasks:
  - set_fact: SQLPassword={{password}}
  - group_by: key=OS-{{ansible_distribution}}

- hosts: OS-CentOS
  gather_facts: no

  vars_files:
    - nagios/GlobalVar/main.yml
  handlers:
    - include: nagios/handlers/main.yml
  roles:
    - nagios/lamp
    - nagios/nagios
```
as you can see i add include in the main.yml file i have
```
- name: restart httpd
  service: name=httpd state=restarted
```
in the main task i have 
```
- name: Create PHP Test Page and Test it
  copy: src={{ PHPtestPage }} dest={{ PHPPath }}  force=yes owner=root group=root mode="u=rw,g=r,o=r"
 notify:
  - restart httpd
```
and it is not restart the HTTPD server i dont understand why ?
for the folder struct is like this
```
role --- > nagios --- > task1
                          ----> task 2
                          ---> hamdlers ----> main.yml
```
any help pleas :-)


Reply all
Reply to author
Forward
0 new messages