`import_playbook` cannot be used within a play. Your play starts with `-
hosts: "{{ host }}"`. Your `import_playbook` would need to come either
before that, or after your `fail` task.
Maybe you are looking for `import_tasks` instead?
On Wed, Mar 21, 2018 at 10:53 AM, John Harmon <[email protected]>
wrote:
> I have the following playbook. If I comment out the line for
> import_playbook, the error goes away. Can anybody see what is wrong with
> this? I am guessing a syntax error, but I can't seem to find it. Thanks
> in advance!:
>
> ---
> - hosts: "{{ host }}"
> gather_facts: false
> tasks:
>
> - import_playbook: update_gitlab_scripts.yml
>
> - name: "Check tcp tuning settings"
> shell: "/home/gomer/scripts/check_tcp_tuning.sh"
> no_log: true
> register: results
>
> - fail:
> msg: "TCP Tuning needed for {{ ansible_hostname }}"
> when: results.rc > 0
>
> ERROR:
> ERROR! Syntax Error while loading YAML.
>
>
> The error appears to have been in '/etc/ansible/playbooks/
> checks/check_tcp_tuning.yml': line 8, column 11, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
>
> - name: "Check tcp tuning settings"
> ^ here
>
> exception type: <class 'yaml.scanner.ScannerError'>
> exception: mapping values are not allowed in this context
> in "<unicode string>", line 8, column 11
>
>
> --
> 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/c958ac69-cc85-4308-a941-5bacb4cb101d%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/c958ac69-cc85-4308-a941-5bacb4cb101d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Matt Martz
@sivel
sivel.net
--
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/CAD8N0v9daQsJ%2BNr_m4y7v2StbrUEzL6KU-VWYUbm65%3DQzk2DFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.