I just solved this differently by using the creates argument to the shell module. In my opinion you should *know* the name of the S and K symlinks so a wildcard shouldn't be necessary. Here's my approach:
- shell: update-rc.d myinitscript defaults
args:
creates: /etc/rc2.d/S20myinitscript
This will skip the update-rc.d if the symlink already exists. It will actually be skipped if its' a regular file or a directory too, but I'm not that paranoid. (Or you'd have to check each symlink that you expect to be created.) Test what's reasonably going to break, that's my philosophy here.
Regards,
Tore