Re: [ansible-project] exception: mapping values are not allowed in this context

2018-03-21 Thread Matt Martz
`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 
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: 
> exception: mapping values are not allowed in this context
>   in "", 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/c958ac69-cc85-4308-a941-5bacb4cb101d%40googlegroups.
> com
> 
> .
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
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.


Re: [ansible-project] exception: mapping values are not allowed in this context

2018-03-21 Thread John Harmon
Matt, thank you.  I wasn't aware of import_tasks, but it does what I want 
it to do.  Thanks again!

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8569fcdc-40ed-45b5-89a5-7d762550dc5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] exception: mapping values are not allowed in this context

2018-03-21 Thread John Harmon
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: 
exception: mapping values are not allowed in this context
  in "", 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c958ac69-cc85-4308-a941-5bacb4cb101d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.