Re: [ansible-devel] Re: Playbook help - syntax

2016-05-25 Thread Kai Stian Olstad

On 25.05.2016 07:23, 'jhawkesworth' via Ansible Development wrote:
Single line ansible module calls can use the key=value key=value 
syntax,
but when you are using the multi-line yaml style syntax it needs to be 
key:

value


This statement is not correct.


yamllint.com or a yaml-aware text editor can be a help when you are 
getting

used to writing playbooks.


Code like this work
- name: Update the Apache config
  copy: >
src=httpd.conf
dest=/etc/httpd/httpd.conf

Even dropping the bigger than and it works, also yamllint.com says it is 
valid.


More about multiline here
https://support.ansible.com/hc/en-us/articles/201957837-How-do-I-split-an-action-into-a-multi-line-format-

--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-devel] Re: Playbook help - syntax

2016-05-24 Thread 'jhawkesworth' via Ansible Development
Yes, Will is right, this is really a question for ansible-project.

However, it looks to me like you have an = where there should be a : in 

log_path= "c:/temp/ansible_wu.txt"


should be

log_path: "C:/temp/ansible_wu.txt"

Single line ansible module calls can use the key=value key=value syntax, 
but when you are using the multi-line yaml style syntax it needs to be key: 
value

yamllint.com or a yaml-aware text editor can be a help when you are getting 
used to writing playbooks.

All the best,

Jon


On Wednesday, May 25, 2016 at 2:09:15 AM UTC+1, Will Thames wrote:
>
> This is a question for the ansible-project list rather than ansible-devel.
>
> The playbook you've posted doesn't appear complete, as the error message 
> relates to a task name that isn't in the below playbook (this is feedback 
> so that you can have better luck in ansible-project)
>
> On Wednesday, May 25, 2016 at 4:35:10 AM UTC+10, Bud Calabrese wrote:
>>
>> I am working on a Ansible file that will update our Windows boxes instead 
>> of using SCCM. I keep getting an error. Here is my playbook. 
>>
>> ---
>> - hosts: Windows
>>   connection: winrm
>>   tasks:
>> - name: Install Critical Updates
>>   win_updates:
>> category_names:
>>   - CriticalUpdates
>> log_path= "c:/temp/ansible_wu.txt"
>> - name: Reboot Servers
>>   raw: shutdown.exe /r /t 10  
>> The error is:ERROR! Syntax Error while loading YAML.
>>
>>
>> The error appears to have been in '/home/bud/ansible/WinUpdate.yml': line 
>> 13, column 5, but may
>> be elsewhere in the file depending on the exact syntax problem.
>>
>> The offending line appears to be:
>>
>>
>> - name: Restart machine
>> ^ here
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.