similar to this. This pb i want to break it up into roles
any idea?
---
- 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
On Mon, Apr 24, 2023 at 10:36 AM Tony Wong <[email protected]> wrote:
> I got a pb that works like this. any idea how i can convert this to a role?
>
>
>
> ---
>
> - 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
>
> --
> 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
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d637013b-7cba-4401-b7c0-edcb70b6a52cn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d637013b-7cba-4401-b7c0-edcb70b6a52cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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/CALmkhkqb7ygKEc87sdhH0Mfnm_DPMTi2C5pEspm%2BNnUS2z1gcQ%40mail.gmail.com.