Workaround ansible-modules-core 1170 service module with Upstart

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

just use the version of service in devel, it was patched to fix that issue.

Sure, but it’s not always possible to use Ansible from devel.

you don't need the full ansible, just a copy of the service.py file
from ansible-modules-core