Hi
I am using community.vmware related modules in a playbook .. which updates
tags & reboot vms
In the same vm i would like to patch the VM
Below is the code .. but the yum module here seems not acting on the target
ie "{{ vm_name }" but does not the ansible control node itself
Any suggestions Please ( My requirement is not to use separate playbook )
---
- hosts: localhost
gather_facts: false
connection: local
vars_files:
- /etc/ansible/playbooks/vm-provision/vars/vc.yml
tasks:
- name: Update tags
community.vmware.vmware_guest_custom_attributes:
hostname: "{{ vcenter_server }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
name: "{{ vm_name }"
state: present
attributes:
- name: OS
value: "{{ vcenter_OS }}"
- name: Location
value: "{{ vcenter_Location }}"
- name: upgrade all packages
yum: name=* state=latest
- name: Reboot the VM
community.vmware.vmware_guest_powerstate:
hostname: "{{ vcenter_server }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
folder: "{{ vcenter_folder }}"
name: "{{ vm_name }"
state: reboot-guest
Thanks
Kiran
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/45726bf6-d0df-4b05-bc4a-6a33358f92een%40googlegroups.com.