I'm missing the following example part you tried, but when you have:
- cron: name="daily_stats" hour="* 12 * * *"
job="/home/ec2-user/send_report_stats.sh"
One of these is:
- cron: 'name="daily_stats" hour="* 12 * * *"
job="/home/ec2-user/send_report_stats.sh"'
Or even:
- cron:
name: "daily_stats"
hour: "* 12 * * *"
job: "/home/ec2-user/send_report_stats.sh"
Which can be simplified to:
- cron:
name: daily_stats
hour: "* 12 * * *"
job: /home/ec2-user/send_report_stats.sh
Though the simplest thing is to just leave off quotes:
- cron: name=daily_stats hour="* 12 * * *"
job=/home/ec2-user/send_report_stats.sh
On Mon, Sep 8, 2014 at 12:17 AM, Chris Olido <[email protected]> wrote:
> I am creating a cron playbook, my code is as follow.
>
> - - - - -
>
> # Creates an entry like "* 5,2 * * ls -alh > /dev/null"
> - cron: name="daily_stats" hour="* 12 * * *"
> job="/home/ec2-user/send_report_stats.sh"
>
> and change to
>
> # Creates an entry like "* 5,2 * * ls -alh > /dev/null"
>
> - Name Creates cron job to run the reports.
>
> cron: name="daily_stats" hour="* 12 * * *"
> job="/home/ec2-user/send_report_stats.sh"
>
> - - - - -
>
> SNOTRA:TimePhone chrisolido$ ansible-playbook -i hosts cron.yml --check
>
> ERROR: Syntax Error while loading YAML script, cron.yml
>
> Note: The error may actually appear before this position: line 11, column
> 87
>
>
> # Creates an entry like "* 5,2 * * ls -alh > /dev/null"
>
> - cron: name="daily_stats" hour="* 12 * * *"
> job="/home/ec2-user/send_report_stats.sh"
>
>
> ^
>
> We could be wrong, but this one looks like it might be an issue with
>
> unbalanced quotes. If starting a value with a quote, make sure the
>
> line ends with the same set of quotes. For instance this arbitrary
>
> example:
>
>
> foo: "bad" "wolf"
>
>
> Could be written as:
>
>
> foo: '"bad" "wolf"'
>
>
> I tried following the example always having the same error.
>
>
> TIA,
>
> Chris
>
> --
> 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/bf35ade1-6587-4943-a87f-a8fedbd14de7%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/bf35ade1-6587-4943-a87f-a8fedbd14de7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CA%2BnsWgwhZcoHFkP6hENCsPuJ5ww8o-VgqMYaurj7gODiVDJaQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.