Re: [ansible-project] Changing the target server name

2021-02-24 Thread Stefan Hornburg (Racke)
On 2/25/21 8:32 AM, 'Praveen Kumar Singh' via Ansible Project wrote: > Hello Stefan, > > I am trying to create a playbook to perform the three below mentioned tasks > which is to accomplish the database refresh. > First two tasks (Database backup and Backup copy to destination server) are >

Re: [ansible-project] Changing the target server name

2021-02-24 Thread 'Praveen Kumar Singh' via Ansible Project
Hello Stefan, I am trying to create a playbook to perform the three below mentioned tasks which is to accomplish the database refresh. First two tasks (Database backup and Backup copy to destination server) are running fine but for the third one which is to restore the Database I need to change

Re: [ansible-project] Changing the target server name

2021-02-24 Thread Stefan Hornburg (Racke)
On 2/24/21 4:17 PM, 'Praveen Kumar Singh' via Ansible Project wrote: > Is there any way to change the target server name in the middle of the > playbook? This is for windows. > > Thanks and Regards, > Praveen Singh > Hello Praveen, do you mind to explain which use case you have in mind?

Re: [ansible-project] Re: Ansible Without Python?

2021-02-24 Thread Jean-Yves LENHOF
Le 24/02/2021 à 22:18, Jon Forrest a écrit : On 2/24/2021 12:42 PM, Sam Doran wrote: Jimi actually did this a while ago to see if there were any benefits. I wasn't aware of this. Thanks for the reference. In the end, there was no real benefit to moving to

[ansible-project] Re: Ansible Without Python?

2021-02-24 Thread Jon Forrest
On 2/24/2021 12:42 PM, Sam Doran wrote: Jimi actually did this a while ago to see if there were any benefits. I wasn't aware of this. Thanks for the reference. In the end, there was no real benefit to moving to Go since most of the time the control node is

Re: [ansible-project] Ansible Without Python?

2021-02-24 Thread Wei-Yen Tan
I think we are talking cross purposes here. You can create a 'library' as in task. run in any language. I will have a check to see how it executes. But I am pretty sure it executes as bash With file you give it. Get Outlook for iOS From:

Re: [ansible-project] Ansible Without Python?

2021-02-24 Thread Sam Doran
Jimi actually did this a while ago to see if there were any benefits. In the end, there was no real benefit to moving to Go since most of the time the control node is waiting for code to execute and return results from the managed nodes. There are probably

Re: [ansible-project] Ansible Without Python?

2021-02-24 Thread Jean-Yves LENHOF
Le 24/02/2021 à 21:21, Wei-Yen Tan a écrit : Well on the client side you can run any language. Ansible uses the shebang on the task module to execute the script. I have even written a custom module that runs powershell on a linux client. You could run bash. As long as you output json object  

Re: [ansible-project] Ansible Without Python?

2021-02-24 Thread Wei-Yen Tan
Well on the client side you can run any language. Ansible uses the shebang on the task module to execute the script. I have even written a custom module that runs powershell on a linux client. You could run bash. As long as you output json object ansible will just execute and return it back.

Re: [ansible-project] Ansible Without Python?

2021-02-24 Thread Jean-Yves LENHOF
Hi, There's part of the code that run on the controller, but also on the client. Today you can run the same ansible code on unix and linux server because the python binary is the one used on the client side, if using a compiled language you need to have all the binary version of all your

Re: [ansible-project] Ansible Without Python?

2021-02-24 Thread Wei-Yen Tan
Technically I think you could run ansible in any language. But there would have to be a deep rethink on how to reproduce what had already been created in the python scripts that make up ansible 'workflow'. there is a lot of moving parts in the backend that we don't see. Get Outlook for

[ansible-project] Ansible Without Python?

2021-02-24 Thread Jon Forrest
I had a radical thought the other day. Would it be possible to replace Python as the language used by Ansible with a compiled language, perhaps Go because of its fast compile and link speed? Note that I'm not talking about something like the existing Ansible shell module, which is only useful in

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Ok this one was easy .. just did below value: "{{ r.ansible_facts.ansible_distribution }}{{ r.ansible_facts.ansible_distribution_version }}" Thanks again Abhi & Stefan Hornburg (Racke) On Wed, Feb 24, 2021 at 10:11 AM Kiran Kumar wrote: > "{{ r.ansible_facts.ansible_distribution ~ ' ' ~ >

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
"{{ r.ansible_facts.ansible_distribution ~ ' ' ~ r.ansible_facts.ansible_distribution_version }}" , works it gives Ubuntu 18.04 How to get Ubuntu18.04 Ie remove the space ? Will try few things .. Any docs Please on this ? where you go these .. ~ ' ' ~ :) BTW yes, "{{

Re: [ansible-project] Need help with tags

2021-02-24 Thread Vladimir Botka
On Wed, 24 Feb 2021 09:05:27 -0800 (PST) Mouton Noir wrote: > Every task in the main.yml from "myrole" are conditioned with a different > value for a variable myowntags > ex: > when: myowntags == "fst-openshot" > > Then, in a taskfile or playbook, I can select the tasks I want with >

Re: [ansible-project] Need help with tags

2021-02-24 Thread Mouton Noir
I finally found a "trick" that made it for me : Every task in the main.yml from "myrole" are conditioned with a different value for a variable myowntags ex: when: myowntags == "fst-openshot" Then, in a taskfile or playbook, I can select the tasks I want with something like : - name: test

Re: [ansible-project] Need help with tags

2021-02-24 Thread Mouton Noir
Thanks Matt for your quick answer... Even if it doesn't arrange me... ;-) It's weird this is not possible. I'm surprised. I guess I'm not the first one to consider doing this. Is there a reason why ? Did you (or someone else) hear about a "trick" to get a similar behaviour using something else ?

Re: [ansible-project] Need help with tags

2021-02-24 Thread Matt Martz
There is no capability to limit tags from within a playbook. Tags can only be limited from the CLI via -t/--tags On Wed, Feb 24, 2021 at 10:15 AM Mouton Noir wrote: > Hi, > > I'd like to use tags to select tasks I launch. > I found documentations about how to limit playbook, role... execution

[ansible-project] Need help with tags

2021-02-24 Thread Mouton Noir
Hi, I'd like to use tags to select tasks I launch. I found documentations about how to limit playbook, role... execution to the tagged tasks l choose from adhoc command (-t option). But I need to do the same from another playbook... and I can't find anything about that ex : extract from the

[ansible-project] Changing the target server name

2021-02-24 Thread 'Praveen Kumar Singh' via Ansible Project
Is there any way to change the target server name in the middle of the playbook? This is for windows. Thanks and Regards, Praveen Singh -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Abhijeet Kasurde
how about - "{{ r.ansible_facts.ansible_distribution ~ ' ' ~ r.ansible_facts.ansible_distribution_version }}" On Wed, Feb 24, 2021 at 3:36 PM Kiran Kumar wrote: > > Setup gives : > > "ansible_distribution": "Ubuntu", > "ansible_distribution_file_parsed": true, >

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Stefan Hornburg (Racke)
On 2/24/21 11:04 AM, Kiran Kumar wrote: > > Setup gives : > >         "ansible_distribution": "Ubuntu", >         "ansible_distribution_file_parsed": true, >         "ansible_distribution_file_path": "/etc/os-release", >         "ansible_distribution_file_variety": "Debian", >        

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Setup gives : "ansible_distribution": "Ubuntu", "ansible_distribution_file_parsed": true, "ansible_distribution_file_path": "/etc/os-release", "ansible_distribution_file_variety": "Debian", "ansible_distribution_major_version": "18",

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Wow r.ansible_facts.ansible_lsb.description did worked !!! Thanks again Abhijit On Wed, Feb 24, 2021 at 12:17 AM Kiran Kumar wrote: > Thanks Abhijit, Awesome , it worked > > Only issue is > > value: "{{ r.ansible_facts.ansible_distribution }}" > when: vm_info.instance.customvalues.OS != >

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Thanks Abhijit, Awesome , it worked Only issue is value: "{{ r.ansible_facts.ansible_distribution }}" when: vm_info.instance.customvalues.OS != r.ansible_facts.ansible_distribution that Just give Ubuntu ... is it possible to extract the info from setup module ie below part..