Hi peeps,
I am trying to install hotfix patch to xen server host from remote centos
machine. I deployed ansible1.6.6 on the centos machine.
I have copied the patches to centos machine. kept it in /root/PATCH
directory.
I tired running this
*---*
*- 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:
r*oot@LAB-1 plays]# ansible-playbook play2.yml --ask-pass*
*SSH password:*
*ERROR: register is not a legal parameter in an Ansible Playbook*
*[root@LAB-1 plays]#*
-------------------------------------------------------------------------------------------------------------------------------
I also found another module from internet (courtesy Shanker Balan)
But has a different error though
# main.yml
*---*
*- action: shell /opt/xensource/bin/xe host-list name-label={{ ansible_fqdn
}} | awk '/^uuid/{print $5}'*
* register: hostid*
* changed_when: hostid|failed*
*- include: patch_apply.yml hotfix_id={{ item }} host_id={{ hostid.stdout
}}*
* with_items: hotfixes*
*[root@LAB-1 plays]# cat deploypatch.yml*
*---*
*-host:all*
*- name:Check And Apply XenServer Hotfix*
* action:shell /opt/xensource/bin/xe patch-list | grep -qw {{ hotfix_id }}*
* register:result*
* changed_when:result|failed*
* ignore_errors:True*
*- name:Copying {{ hotfix_id }}.zip*
* action:copy src={{ hotfix_id }}.zip dest=/tmp/*
* when:result|failed*
*- name:Unziping {{ hotfix_id }}.zip*
* action:command unzip /tmp/{{ hotfix_id }}.zip -d /tmp/ creates=/tmp/{{
hotfix_id }}.xsupdate*
* when:result|failed*
*- name:Uploading patch {{ hotfix_id }} to XenServer*
* action:shell /opt/xensource/bin/xe patch-upload file-name=/tmp/{{
hotfix_id }}.xsupdate*
* register:patch_id*
* when:result|failed*
*- name:Applying {{ hotfix_id }}*
* action:shell /opt/xensource/bin/xe patch-apply host-uuid={{ host_id }}
uuid={{ patch_id.stdout }}*
* when:result|failed*
* notify:restart xe-toolstack*
*- name:Cleanup Hotfix {{ hotfix_id }} install files*
* action:file path="/tmp/{{ hotfix_id }}* state=absent*
* when:result|failed*
*[root@LAB-ANSILE-1 plays]# ansible-playbook play3.yml --ask-pass*
*SSH password:*
*ERROR: parse error: playbooks must be formatted as a YAML list, got <type
'str'>*
*[root@LAB-1 plays]#*
Please help in this :-)
regards,
Adi
--
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/7f9be3a0-e867-4adc-a583-67bce40e12b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.