Re: [ansible-project] Patching through playbook!!!

96 views
Skip to first unread message
Message has been deleted
Message has been deleted

Serge van Ginderachter

unread,
Mar 25, 2015, 2:45:09 AM3/25/15
to ansible...@googlegroups.com

On 24 March 2015 at 11:55, aditya patnaik <adity...@gmail.com> wrote:
- hosts: all

- name: Add update to patch list
  command: xe patch-upload file-name=/root/PATCH/{{ update_filename }}
  register: uuid
 
- name: Install update to all servers in the pool
  command: xe patch-pool-apply uuid={{ uuid.stdout }}


But I get below output:

root@LAB-1 plays]# ansible-playbook play2.yml --ask-pass
SSH password:
ERROR: register is not a legal parameter in an Ansible Playbook


​You are mixing up plays and tasks, the latter need to be a list indented beneath the tasks: keywoard, which itself is on the same level as hosts:​
Message has been deleted

Vincent Van der Kussen

unread,
Mar 25, 2015, 2:55:30 AM3/25/15
to ansible...@googlegroups.com
Hi,

Can you try this. Like Serge mentioned, your indentation is probably wrong

http://paste.ubuntu.com/10675537/



On Wed, Mar 25, 2015 at 7:51 AM, aditya patnaik <adity...@gmail.com> wrote:
Thank you  Serge van Ginderachter  for replying  :-)


But is still get the error after adding tasks
Is there a better way to do it ?


[root@LAB-1 plays]# cat play2.yml
---
-
  hosts: all

  tasks:
-
  name: Add update to patch list
  command: xe patch-upload file-name=/root/PATCH/{{ update_filename }}
  register: uuid
-
  name: Install update to server
  command: xe patch-pool-apply uuid={{ uuid.stdout }}

[root@LAB-1 plays]# ansible-playbook play2.yml --ask-pass

SSH password:
ERROR: register is not a legal parameter in an Ansible Playbook

--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f3c0b064-831c-41d5-9cb8-8e366d0cd4c3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Serge van Ginderachter

unread,
Mar 25, 2015, 2:55:41 AM3/25/15
to ansible...@googlegroups.com
:facepalm:

You need to fix your indentation.

Please read docs on how yaml is structured, then come back :)

On 25 March 2015 at 07:51, aditya patnaik <adity...@gmail.com> wrote:
Thank you  Serge van Ginderachter  for replying  :-)


But is still get the error after adding tasks
Is there a better way to do it ?


[root@LAB-1 plays]# cat play2.yml
---
-
  hosts: all

  tasks:
-
  name: Add update to patch list
  command: xe patch-upload file-name=/root/PATCH/{{ update_filename }}
  register: uuid
-
  name: Install update to server
  command: xe patch-pool-apply uuid={{ uuid.stdout }}

[root@LAB-1 plays]# ansible-playbook play2.yml --ask-pass

SSH password:
ERROR: register is not a legal parameter in an Ansible Playbook

Reply all
Reply to author
Forward
0 new messages