Re: [ansible-devel] ansible ssh: connect to host 172.x.x.x port 22: No route to host

2023-04-16 Thread Magnus Lubeck
Well, this is in no way an ansible issue, unless you are a bit more verbose.Do you have any console output?Can you ping the host?Can you ssh to the host as the ansible user?If not, solve those issues, then come back.Sent from my iPhoneOn 16 Apr 2023, at 19:28, Abdulrehman Khurram wrote:Facing usi

Re: [ansible-devel] Need help to reboot the host

2022-02-14 Thread Magnus Lubeck
You can simply do it by having multiple plays in one playbook. Many ways to skin this cat. ``` --- - name: reboot server 1 hosts: server1 tasks: - reboot - name: reboot the rest hosts: zoneA, !server1 tasks: - reboot ``` Sent from my iPhone > On 15 Feb 2022, at 07:13, jay

Re: [ansible-devel] Trying to upgrade Windows 10 and install updates with Ansible.

2020-07-27 Thread Magnus Lubeck
Hi Alan, Extend the list of "category_names" to include more or less all and any possible category. What happens when you run the playbook, is that it only lists and installs the ones that you states in the "category_names", whereas the Windows Update in your clients will search for all and anyth

Re: [ansible-devel] Two sets of arguments/parameters for one module?

2020-07-09 Thread Magnus Lubeck
I see no problem with doing that. Just make sure that your module has default values for both parameter1 and param_container, so that you can enter your method. Then, once you are in your code, you can check for the version and take proper action. //magnus Sent from my iPhone > On 10 Jul 202

Re: [ansible-devel] How to skip and move on to the next task if a condition is met?

2020-07-03 Thread Magnus Lubeck
You use "register: myVariable" on the shell task, then "when: myVariable.stdout == XY" on the next task. https://www.mydailytutorials.com/ansible-register-variables/ //magnus On Fri, Jul 3, 2020 at 1:51 PM Amir Alavi wrote: > Hi all, > > Newbie here - I'm writing a playbook that I'm running a

[ansible-devel] Re: Access group_vars from custom module

2019-10-03 Thread Magnus Lubeck
I think you have missed part of the ansible concept, and is mixing up where you loop through the variables. It sounds like you want to call a program that is looping through something you mention in a group_var file, whereas the plugin should just take a single parameter, and do its thing atomic

Re: [ansible-devel] Is changing the default setting of TRANSFORM_INVALID_GROUP_CHARS a good idea?

2019-08-26 Thread Magnus Lubeck
Den lördag 24 augusti 2019 kl. 00:37:41 UTC+2 skrev Kai Stian Olstad: > > > > > Because using hyphen is recommended way for hostname (also DNS) > > Hyphen in hostname is not affected by this, just group names since they > are variables. > > Groups are not at all a variable, to be honest. It