Hey guys,                                                                       
                                                        
                                                                                
                                                        
just a workaround to 
https://github.com/ansible/ansible-modules-core/issues/1170.                    
                                   
I have roles which run on Ubuntu and use service: module to manage services.    
                                                        
                                                                                
                                                        
I don't want to "fix" the roles and revert when 1170 is released.               
                                                        
So I decided to fix this easily on playbook/play level. I install a SysV script 
                                                        
named after the service to manage with the following contents in pre_tasks, 
e.g.                                                        
for php5-fpm service:                                                           
                                                        
                                                                                
                                                        
                                                                                
                                                        
    #!/bin/bash                                                                 
                                                        
                                                                                
                                                        
    service php5-fpm $1                                                         
                                                        
                                                                                
                                                        
                                                                                
                                                        
Like that:

- name: Deploy php5-fpm
  hosts: fpm
  pre_tasks:
    - name: Install php5-fpm service hack
      copy:
        src=files/php5-fpm.sysv
        dest=/etc/init.d/php5-fpm
        owner=0
        group=0
        mode=0755
  role:
    - { role: php-fpm }


Once 1170 fix has been released just exchange copy task file file: state=absent,
role never has to be updated/released.

# kraM

-- 
kraM

   Think can be useful if someone is needing some thinking about something.

gpg --recv-keys 0x6C215719

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20150511110019.GD6260%40em.streik.ld.
For more options, visit https://groups.google.com/d/optout.

Attachment: pgpFReoIyixoa.pgp
Description: PGP signature

Reply via email to