---
- name: test
hosts: all
gather_facts: no
vars_files:
- vcenter_creds.yml
- vars.yml
tasks:
- name: Enable SSH service
vmware_host_service_manager:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
esxi_hostname: "{{ hostname }}"
validate_certs: no
state: present
service_name: "TSM-SSH"
delegate_to: localhost
sdfsdfsd
---
- hosts: all
gather_facts: true
connection: local
vars_files:
- vcenter_creds.yml
- vars.yml
tasks:
- name: Gather vmware host facts from vCenter
community.vmware.vmware_host_facts:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
esxi_hostname: "{{ hostname }}"
validate_certs: no
register: host_facts
delegate_to: localhost
- name: Enable SSH service
vmware_host_service_manager:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
esxi_hostname: "{{ hostname }}"
validate_certs: no
state: present
service_name: "TSM-SSH"
delegate_to: localhost
- name: "change root pass"
community.vmware.vmware_local_user_manager:
hostname: "{{ hostname }}"
username: "{{ esxi_root_user }}"
password: "{{ esxi_root_pass }}"
local_user_name: "{{ esxi_root_user }}"
local_user_password: "{{ new_esxi_root_pass }}"
state: present
validate_certs: False
delegate_to: localhost
- name: Enable SSH service
vmware_host_service_manager:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
esxi_hostname: "{{ hostname }}"
validate_certs: no
state: absent
--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/F6s6Iaaawxs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d637013b-7cba-4401-b7c0-edcb70b6a52cn%40googlegroups.com.

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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALmkhkqb7ygKEc87sdhH0Mfnm_DPMTi2C5pEspm%2BNnUS2z1gcQ%40mail.gmail.com.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d637013b-7cba-4401-b7c0-edcb70b6a52cn%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/F6s6Iaaawxs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1552518980.884442.1682399125194%40office.mailbox.org.
change_esxi_root_pass
├── hosts
├── main.yml
└── roles
├── change_esxi_root
├── disable_ssh
└── enable_ssh
├── tasks
│ └── main.yml
└── vars
├── vars.yml
└── vcenter_creds.yml
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALmkhkozMiFyzJQuL--%3DqS%3DfFFauGqZb5BER4ss2WDdpAk_GVA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAF8BbLa_O2mPDvci1Xwq0ukJF-Fz-L4xXS%2Bu7rj6ux7pihrWTA%40mail.gmail.com.