Workaround ansible-modules-core 1170 service module with Upstart

37 views
Skip to first unread message

Mark Kusch

unread,
May 11, 2015, 9:23:24 AM5/11/15
to ansible...@googlegroups.com
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

Brian Coca

unread,
May 11, 2015, 9:56:01 AM5/11/15
to ansible...@googlegroups.com
just use the version of service in devel, it was patched to fix that issue.



--
Brian Coca

mark....@gmail.com

unread,
May 12, 2015, 4:49:01 AM5/12/15
to ansible...@googlegroups.com
Sure, but it's not always possible to use Ansible from devel.

Brian Coca

unread,
May 12, 2015, 8:26:12 AM5/12/15
to ansible...@googlegroups.com
you don't need the full ansible, just a copy of the service.py file
from ansible-modules-core



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages