Re: [ansible-project] question on single playbook or roles?

2023-05-12 Thread Kosala Atapattu
If this is the only thing you're planning on doing with Ansible, I would go
for a single playbook. In my repository, I have roles for
enter_maintenance_mode and exit_maintenance_mode, since that function is
used in multiple contexts.

In my environment rather than performing a SSH to ESXi and run esxcli
command, which either you need to enable shell each time, or have that
turned on permanently, which leaves a security risk,. I'd rather use
PowerCLI. PS7 on Linux or Mac works fine with PowerCLI. I keep that to
apply Host Profiles and other functions where there are no native vmware
modules.

I have a PowerShell / PowerCLI delegate host dedicated for tasks which do
not have native modules, and delegate those tasks to the delegate host.

HTH,
*Kosala*




On Thu, May 11, 2023 at 3:29 AM Tony Wong  wrote:

> I got a few tasks i need to do on esxi host
>
> 1. put in maintenace mode
> 2. copy vib from my laptop to the the host shared datastore
> 3. install the patch
>
> esxcli softare vib install -d /path/xxx.zip
>
> 4. reboot the host
> 5. take it out of maintenance mode
>
>
> do i create roles for these or single 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-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c8b949a8-2024-43eb-9d46-61eead48e170n%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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAP7S5HZgXqU9VZwGV5E-cAgJxTwkR9VPbMhzkeBF7d9MOe-EkQ%40mail.gmail.com.


Re: [ansible-project] question on single playbook or roles?

2023-05-12 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
Yes, that was me, LOL.

Even a single playbook can be "parameterized" to use variables you supply via 
command line or a vars file. That offers reuse.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On May 12, 2023, at 11:54 AM, Kevin Knox  wrote:

Hmmm. My reply did not post. Maybe I replied to the user?

Anyway, my vote is to consider "roles" to be an enhancement. I have to be very 
certain I'm going to reuse the role before I will create it. If I'm not sure, 
then I call the creation of a role "gold plating" and unnecessary. So, I will 
create a straight playbook if there's any doubt in my mind about whether this 
is a reusable task. That does mean when the time comes to reuse the tasks that 
would be in the role, I need to refactor the original play to role-ify it, but 
that's pretty light work. I'd rather be certain I don't gold plate any plays 
than end up with a bunch of single-use roles cluttering my project.

On Wednesday, May 10, 2023 at 12:12:49 PM UTC-4 Rowe, Walter P. (Fed) wrote:
I agree with Dick. Is this something you will do over and over so taking the 
time makes sense? Or is this a once-and-done task?

Also look at the tools VMware offers. Ansible isn't always the right solution.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On May 10, 2023, at 11:38 AM, Dick Visser  wrote:

If you just want the quickest option then go for a playbook.
If you can spend some time on this then you could create a role that is meant 
for patching ESX hosts, and that includes helper tasks to handle the 
maintenance mode and the reboot.
Endless possibilities to do this, from quick and dirty to nicely parametrised


On Wed, 10 May 2023 at 17:29, Tony Wong  wrote:
I got a few tasks i need to do on esxi host

1. put in maintenace mode
2. copy vib from my laptop to the the host shared datastore
3. install the patch
esxcli softare vib install -d /path/xxx.zip

4. reboot the host
5. take it out of maintenance mode


do i create roles for these or single 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c8b949a8-2024-43eb-9d46-61eead48e170n%40googlegroups.com.
--
Sent from Gmail Mobile

--
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/CAF8BbLaiFAKhAOWbcrbZXgZkfg66pFNMkan8Z8gfL7oXWQBY9Q%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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9436cbdd-ab27-46f8-9e1e-8415c2db802an%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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/E6A9B1F6-E466-4580-BB95-C18A2DDB944D%40nist.gov.


Re: [ansible-project] question on single playbook or roles?

2023-05-12 Thread Kevin Knox
Hmmm. My reply did not post. Maybe I replied to the user?

Anyway, my vote is to consider "roles" to be an enhancement. I have to be 
very certain I'm going to reuse the role before I will create it. If I'm 
not sure, then I call the creation of a role "gold plating" and 
unnecessary. So, I will create a straight playbook if there's any doubt in 
my mind about whether this is a reusable task. That does mean when the time 
comes to reuse the tasks that would be in the role, I need to refactor the 
original play to role-ify it, but that's pretty light work. I'd rather be 
certain I don't gold plate any plays than end up with a bunch of single-use 
roles cluttering my project. 

On Wednesday, May 10, 2023 at 12:12:49 PM UTC-4 Rowe, Walter P. (Fed) wrote:

> I agree with Dick. Is this something you will do over and over so taking 
> the time makes sense? Or is this a once-and-done task? 
>
> Also look at the tools VMware offers. Ansible isn't always the right 
> solution.
>
> Walter
> --
> Walter Rowe, Division Chief
> Infrastructure Services, OISM
> Mobile: 202.355.4123 <(202)%20355-4123>
>
> On May 10, 2023, at 11:38 AM, Dick Visser  wrote:
>
> If you just want the quickest option then go for a playbook.
> If you can spend some time on this then you could create a role that is 
> meant for patching ESX hosts, and that includes helper tasks to handle the 
> maintenance mode and the reboot.  
> Endless possibilities to do this, from quick and dirty to nicely 
> parametrised 
>
>
> On Wed, 10 May 2023 at 17:29, Tony Wong  wrote:
>
>> I got a few tasks i need to do on esxi host 
>>
>> 1. put in maintenace mode
>> 2. copy vib from my laptop to the the host shared datastore
>> 3. install the patch
>> esxcli softare vib install -d /path/xxx.zip
>>
>> 4. reboot the host
>> 5. take it out of maintenance mode
>>
>>
>> do i create roles for these or single 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/c8b949a8-2024-43eb-9d46-61eead48e170n%40googlegroups.com
>>  
>> 
>> .
>>
> -- 
> Sent from Gmail Mobile
>
> -- 
> 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/CAF8BbLaiFAKhAOWbcrbZXgZkfg66pFNMkan8Z8gfL7oXWQBY9Q%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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9436cbdd-ab27-46f8-9e1e-8415c2db802an%40googlegroups.com.


Re: [ansible-project] question on single playbook or roles?

2023-05-10 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
I agree with Dick. Is this something you will do over and over so taking the 
time makes sense? Or is this a once-and-done task?

Also look at the tools VMware offers. Ansible isn't always the right solution.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On May 10, 2023, at 11:38 AM, Dick Visser  wrote:

If you just want the quickest option then go for a playbook.
If you can spend some time on this then you could create a role that is meant 
for patching ESX hosts, and that includes helper tasks to handle the 
maintenance mode and the reboot.
Endless possibilities to do this, from quick and dirty to nicely parametrised


On Wed, 10 May 2023 at 17:29, Tony Wong 
mailto:tdubb...@gmail.com>> wrote:
I got a few tasks i need to do on esxi host

1. put in maintenace mode
2. copy vib from my laptop to the the host shared datastore
3. install the patch
esxcli softare vib install -d /path/xxx.zip

4. reboot the host
5. take it out of maintenance mode


do i create roles for these or single 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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c8b949a8-2024-43eb-9d46-61eead48e170n%40googlegroups.com.
--
Sent from Gmail Mobile

--
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF8BbLaiFAKhAOWbcrbZXgZkfg66pFNMkan8Z8gfL7oXWQBY9Q%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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/E998E348-A6FB-49C1-B388-696AD8B3EABC%40nist.gov.


Re: [ansible-project] question on single playbook or roles?

2023-05-10 Thread Dick Visser
If you just want the quickest option then go for a playbook.
If you can spend some time on this then you could create a role that is
meant for patching ESX hosts, and that includes helper tasks to handle the
maintenance mode and the reboot.
Endless possibilities to do this, from quick and dirty to nicely
parametrised


On Wed, 10 May 2023 at 17:29, Tony Wong  wrote:

> I got a few tasks i need to do on esxi host
>
> 1. put in maintenace mode
> 2. copy vib from my laptop to the the host shared datastore
> 3. install the patch
> esxcli softare vib install -d /path/xxx.zip
>
> 4. reboot the host
> 5. take it out of maintenance mode
>
>
> do i create roles for these or single 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-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c8b949a8-2024-43eb-9d46-61eead48e170n%40googlegroups.com
> 
> .
>
-- 
Sent from Gmail Mobile

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF8BbLaiFAKhAOWbcrbZXgZkfg66pFNMkan8Z8gfL7oXWQBY9Q%40mail.gmail.com.


[ansible-project] question on single playbook or roles?

2023-05-10 Thread Tony Wong
I got a few tasks i need to do on esxi host

1. put in maintenace mode
2. copy vib from my laptop to the the host shared datastore
3. install the patch

esxcli softare vib install -d /path/xxx.zip

4. reboot the host
5. take it out of maintenance mode


do i create roles for these or single 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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c8b949a8-2024-43eb-9d46-61eead48e170n%40googlegroups.com.