Setting an intial cron job and leaving it alone on later plays

I've got a playbook for preparing new Drupal websites. It doesn't
itself go through the full installation (which is interactive), but
preps what is needed to complete the installation - installing drupal
code, setting up Apache2, creating database user and the database
itself, etc.

One of the things I'm doing is prepping a cron job that can be completed
and enabled after the manual part of the configuration is done. I'm
doing this:

- name: Create cron job
  cron:
    name: Drupal cron job
    disabled: true
    minute: "*/15"
    job: curl --silent --compressed url
    user: "{{ username }}"

The idea is that the 'url' in the job will be manually replaced by the
required url (obtainable from the Drupal Status Report screen, and
containing many, many random characters), and enabled.

Of course, if I run this playbook again, the job is going to be changed
back to 'curl --silent --compressed url', and of course, I don't want
that, but I do want to be able to re-run this playbook against a site,
to apply appropriate changes.

The cron module, unlike some other Ansible modules, doesn't seem to have
a way to say "Don't replace this cron job if it is already in the
crontab, even if it's changed" (as opposed to, say, template, which has
a 'force: no' which will keep you from overwriting an already existing
file). Having the name parameter will keep it from adding multiple
copies of a cron job, but it doesn't prevent a modified version from
being overwritten.

Am I missing something? Is there a not-too-hacky way to do what I want
to do here?

Ben

Get the list of jobs already present

    - name: Get list of cron jobs
      cron:
        user: "{{ username }}"
        name: NOT_EXISTENT
        state: absent
      register: result

    - name: Display list of cron jobs
      debug:
        var: result.jobs

Then run the task if the job isn't present

    - name: Create cron job
      cron:
        name: Drupal cron job
        disabled: true
        minute: "*/15"
        job: curl --silent --compressed url
        user: "{{ username }}"
      when: "'Drupal cron job' not in result.jobs"

HTH,

  -vlado

"Don't replace this cron job if it is already in the crontab, even if it's
changed"

Get the list of jobs already present

    - name: Get list of cron jobs

<snip>

Then run the task if the job isn't present

    - name: Create cron job

<snip>

Excellent!

And I note that this isn't even hinted at in the cron module
documentation. I'll file this under "It may be worthwhile to experiment
and register the results of various modules to see when they produce
when their output is registered". Also "Perhaps module documentation
should document what is produced when you register their output".

Ben