Re: [ansible-project] Hooks in Ansible

2022-07-25 Thread Daniel Gonçalves

Thank you for you answer.

I already know *post_tasks*, *handlers*, and *ansible-runner*, but I 
don't think there are good for what I'm looking for.


You need a bit more context: I have a custom lookup plugin that 
initialize some data and execute a new process in order to keep these 
datas available during the playbook life.
I want to be able to send a SIGTERM signal to the process to terminate 
it at the end of playbook execution.


As I want to share this custom plugin, I don't want any user 
interaction, because it's not the user role to worry about this extra 
process.
So *post_tasks*, *handlers*, and *wait_for* are excluded. 
*ansible-runner* may be a good alternative but I don't want to force 
users to use *ansible-runner* instead of *ansible*.


I hope it's more clear.

Regards,

Daniel


Le 2022-07-25 21:55, Vladimir Botka a écrit :

On Mon, 25 Jul 2022 19:06:33 +0200
Daniel Gonçalves  wrote:


What I want to do is executing some code at the end of the playbook
execution, in other words executing some code at some arbitrary 
playbook
execution step. I wonder if there is some event listener I can 
subscribe

on in order to execute my code.


This depends on the use case:

1) To execute the code at the end of the playbook you can use
   *post_tasks*. At some arbitrary playbook execution step use
   *tasks*.

2) To trigger the execution of a code by some events you can use
   the module *wait_for*

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/wait_for_module.html#ansible-builtin-wait-for-module-waits-for-a-condition-before-continuing
   and *handlers*
   
https://docs.ansible.com/ansible/latest/user_guide/playbooks_handlers.html


3) To execute the code after the playbook finished you can use
   *ansible-runner*

https://ansible-runner.readthedocs.io/en/stable/python_interface/#usage-examples


--
Vladimir Botka


--
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/fc37dcdc7b8f71b00daad2b092aa6642%40lves.fr.


Re: [ansible-project] sucessfully ran single play but not when the play is part of a task in the pb

2022-07-25 Thread Dick Visser
I don't see a question?
And what do you mean by this playbook being pet of a playbook task?
Where is that code? Do we need to guess again what that looks like?

On Tue, 26 Jul 2022 at 02:23, Tony Wong  wrote:

> I sucessully ran this play as a single play
>
> ---
> - hosts: localhost
>   name: test
>   tasks:
>   - name: run rke installer
> shell: 'rke up'
> args:
>   chdir: "/home/rke"
> become: yes
> become_user: "rke"
> delegate_to: localhost
> register: result
>   - debug:
>   msg: "{{ result }} "
>
>
> however this did not work as part of a playbook task
>
>
> --
> 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/510cb366-ef13-4e1d-882e-f3db12d3ce7cn%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/CAF8BbLZB3h4U1jTGZ_tUvp2si13_cUgO%3DGjZHySvuD9inR_n3Q%40mail.gmail.com.


Re: [ansible-project] IMDS V2 Unauthorised Error || Guidance Required

2022-07-25 Thread SARANSH BANKIWAL
PFB the used code for checking the IMDS V2 instance. 
[image: Screenshot 2022-07-26 at 8.23.50 AM.png]

On Tuesday, July 26, 2022 at 8:14:13 AM UTC+5:30 ril...@gmail.com wrote:

> At this point with a supported ansible version, can you paste in the code 
> you were using to query the metadata service?
>
> On Mon, Jul 25, 2022 at 9:38 PM SARANSH BANKIWAL  
> wrote:
>
>> Hi Rilindo, 
>> As stated by you i upgraded the python version and ansible version as 
>> well. Attaching screenshots for the reference. But still the same issue 
>> persists in the Metadata fetch.
>>
>> [image: Screenshot 2022-07-26 at 8.02.56 AM.png]
>>
>> On Tuesday, July 26, 2022 at 7:24:11 AM UTC+5:30 ril...@gmail.com wrote:
>>
>>> You probably won’t be able to upgrade as long as you are using Python 
>>> 2.7. You will have to figure out a way to get a newer version of Python on 
>>> the machine if you intend to upgrade to the most recent version of Ansible.
>>>
>>> - Rilindo
>>>
>>> On Jul 25, 2022, at 7:46 PM, SARANSH BANKIWAL  
>>> wrote:
>>>
>>> Hi , thanks for the prompt response, 
>>> I read the article previously as well but was not able to install 
>>> Ansible to a version of 5 or above because of less available resources. Can 
>>> you please help in the same. 
>>> Thanks in advance.
>>>
>>> On Tuesday, July 26, 2022 at 5:55:09 AM UTC+5:30 ril...@gmail.com wrote:
>>>
 Hi Saransh,

 I am going to guess that it has to do with your version of ansible as 
 it appears 2.9 does not yet support  IMDS v2, where as latest version (at 
 least 5 and above) doesdoes, as noted in this link:

 "The module is configured to utilize the session oriented Instance 
 Metadata Service v2 (IMDSv2) 
 https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
 ."


 https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_metadata_facts_module.html

 https://docs.ansible.com/ansible/5/collections/amazon/aws/ec2_metadata_facts_module.html


 - Rilindo

 On Jul 25, 2022, at 7:11 PM, SARANSH BANKIWAL  
 wrote:

 Hello all, 
 Currently i was working on migration from IMDS v1 to IMDS v2 in AWS and 
 got the below error. 

 FAILED! => {"changed": false, "msg": "Failed to retrieve metadata from 
 AWS: HTTP Error 401: Unauthorized", "response": {"body": ">>> version=\"1.0\" encoding=\"iso-8859-1\"?>\n>>> \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t\"
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\;>\n>>> xmlns=\"http://www.w3.org/1999/xhtml\; xml:lang=\"en\" lang=\"en\">\n 
 \n  401 - Unauthorized\n \n \n  401 
 - 
 Unauthorized\n \n\n", "connection": "close", 
 "content-length": "343", "content-type": "text/html", "date": "Mon, 25 Jul 
 2022 23:26:11 GMT", "msg": "HTTP Error 401: Unauthorized", "server": 
 "EC2ws", "status": 401, "url": "
 http://169.254.169.254/latest/meta-data/"}}

 *My ansible version on this Instance is : (ansible --version)*

 ansible 2.9.15
 config file = /etc/ansible/ansible.cfg
 configured module search path = [u'/root/.ansible/plugins/modules', 
 u'/usr/share/ansible/plugins/modules']
 ansible python module location = 
 /usr/lib/python2.7/dist-packages/ansible
 executable location = /usr/bin/ansible
 python version = 2.7.17 (default, Jul  1 2022, 15:56:32) [GCC 7.5.0]

 Can someone please in this as stuck on this.
 Thanks in advance. 

 -- 
 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/d6328c61-380e-4c9d-b043-2203d81385a5n%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/9207373f-4a95-49a1-8894-e8e8ee79d81en%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 
>> 

Re: [ansible-project] IMDS V2 Unauthorised Error || Guidance Required

2022-07-25 Thread Rilindo Foster
You probably won’t be able to upgrade as long as you are using Python 2.7. You 
will have to figure out a way to get a newer version of Python on the machine 
if you intend to upgrade to the most recent version of Ansible.

- Rilindo

> On Jul 25, 2022, at 7:46 PM, SARANSH BANKIWAL  
> wrote:
> 
> Hi , thanks for the prompt response, 
> I read the article previously as well but was not able to install Ansible to 
> a version of 5 or above because of less available resources. Can you please 
> help in the same. 
> Thanks in advance.
> 
> On Tuesday, July 26, 2022 at 5:55:09 AM UTC+5:30 ril...@gmail.com wrote:
> Hi Saransh,
> 
> I am going to guess that it has to do with your version of ansible as it 
> appears 2.9 does not yet support  IMDS v2, where as latest version (at least 
> 5 and above) doesdoes, as noted in this link:
> 
> "The module is configured to utilize the session oriented Instance Metadata 
> Service v2 (IMDSv2) 
> https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
>  
> ."
> 
> https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_metadata_facts_module.html
>  
> 
> https://docs.ansible.com/ansible/5/collections/amazon/aws/ec2_metadata_facts_module.html
>  
> 
> 
> 
> - Rilindo
> 
> 
>> On Jul 25, 2022, at 7:11 PM, SARANSH BANKIWAL > > wrote:
>> 
> 
>> Hello all, 
>> Currently i was working on migration from IMDS v1 to IMDS v2 in AWS and got 
>> the below error. 
>> FAILED! => {"changed": false, "msg": "Failed to retrieve metadata from AWS: 
>> HTTP Error 401: Unauthorized", "response": {"body": "> encoding=\"iso-8859-1\"?>\n> Transitional//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
>>  \">\n> xmlns=\"http://www.w3.org/1999/xhtml\ " 
>> xml:lang=\"en\" lang=\"en\">\n \n  401 - Unauthorized\n 
>> \n \n  401 - Unauthorized\n \n\n", 
>> "connection": "close", "content-length": "343", "content-type": "text/html", 
>> "date": "Mon, 25 Jul 2022 23:26:11 GMT", "msg": "HTTP Error 401: 
>> Unauthorized", "server": "EC2ws", "status": 401, "url": 
>> "http://169.254.169.254/latest/meta-data/ 
>> "}}
>> 
>> My ansible version on this Instance is : (ansible --version)
>> 
>> ansible 2.9.15
>> config file = /etc/ansible/ansible.cfg
>> configured module search path = [u'/root/.ansible/plugins/modules', 
>> u'/usr/share/ansible/plugins/modules']
>> ansible python module location = /usr/lib/python2.7/dist-packages/ansible
>> executable location = /usr/bin/ansible
>> python version = 2.7.17 (default, Jul  1 2022, 15:56:32) [GCC 7.5.0]
>> 
>> Can someone please in this as stuck on this.
>> Thanks in advance. 
>> 
>> 
> 
>> -- 
>> 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/d6328c61-380e-4c9d-b043-2203d81385a5n%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/9207373f-4a95-49a1-8894-e8e8ee79d81en%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/9464E7B0-EB20-47C8-8950-41159F01B04E%40gmail.com.


Re: [ansible-project] IMDS V2 Unauthorised Error || Guidance Required

2022-07-25 Thread SARANSH BANKIWAL
Hi , thanks for the prompt response, 
I read the article previously as well but was not able to install Ansible 
to a version of 5 or above because of less available resources. Can you 
please help in the same. 
Thanks in advance.

On Tuesday, July 26, 2022 at 5:55:09 AM UTC+5:30 ril...@gmail.com wrote:

> Hi Saransh,
>
> I am going to guess that it has to do with your version of ansible as it 
> appears 2.9 does not yet support  IMDS v2, where as latest version (at 
> least 5 and above) doesdoes, as noted in this link:
>
> "The module is configured to utilize the session oriented Instance 
> Metadata Service v2 (IMDSv2) 
> https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
> ."
>
>
> https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_metadata_facts_module.html
>
> https://docs.ansible.com/ansible/5/collections/amazon/aws/ec2_metadata_facts_module.html
>
>
> - Rilindo
>
> On Jul 25, 2022, at 7:11 PM, SARANSH BANKIWAL  
> wrote:
>
> Hello all, 
> Currently i was working on migration from IMDS v1 to IMDS v2 in AWS and 
> got the below error. 
>
> FAILED! => {"changed": false, "msg": "Failed to retrieve metadata from 
> AWS: HTTP Error 401: Unauthorized", "response": {"body": " version=\"1.0\" encoding=\"iso-8859-1\"?>\n \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t\"
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\;>\n http://www.w3.org/1999/xhtml\; xml:lang=\"en\" lang=\"en\">\n \n  
> 401 - Unauthorized\n \n \n  401 - 
> Unauthorized\n \n\n", "connection": "close", 
> "content-length": "343", "content-type": "text/html", "date": "Mon, 25 Jul 
> 2022 23:26:11 GMT", "msg": "HTTP Error 401: Unauthorized", "server": 
> "EC2ws", "status": 401, "url": "http://169.254.169.254/latest/meta-data/
> "}}
>
> *My ansible version on this Instance is : (ansible --version)*
>
> ansible 2.9.15
> config file = /etc/ansible/ansible.cfg
> configured module search path = [u'/root/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
> ansible python module location = /usr/lib/python2.7/dist-packages/ansible
> executable location = /usr/bin/ansible
> python version = 2.7.17 (default, Jul  1 2022, 15:56:32) [GCC 7.5.0]
>
> Can someone please in this as stuck on this.
> Thanks in advance. 
>
> -- 
> 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/d6328c61-380e-4c9d-b043-2203d81385a5n%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/9207373f-4a95-49a1-8894-e8e8ee79d81en%40googlegroups.com.


Re: [ansible-project] IMDS V2 Unauthorised Error || Guidance Required

2022-07-25 Thread Rilindo Foster
Hi Saransh,

I am going to guess that it has to do with your version of ansible as it 
appears 2.9 does not yet support  IMDS v2, where as latest version (at least 5 
and above) doesdoes, as noted in this link:

"The module is configured to utilize the session oriented Instance Metadata 
Service v2 (IMDSv2) 
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
 
."

https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_metadata_facts_module.html
 

https://docs.ansible.com/ansible/5/collections/amazon/aws/ec2_metadata_facts_module.html
 



- Rilindo

> On Jul 25, 2022, at 7:11 PM, SARANSH BANKIWAL  
> wrote:
> 
> Hello all, 
> Currently i was working on migration from IMDS v1 to IMDS v2 in AWS and got 
> the below error. 
> FAILED! => {"changed": false, "msg": "Failed to retrieve metadata from AWS: 
> HTTP Error 401: Unauthorized", "response": {"body": " encoding=\"iso-8859-1\"?>\n Transitional//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\;>\n  xmlns=\"http://www.w3.org/1999/xhtml\; xml:lang=\"en\" lang=\"en\">\n 
> \n  401 - Unauthorized\n \n \n  401 - 
> Unauthorized\n \n\n", "connection": "close", 
> "content-length": "343", "content-type": "text/html", "date": "Mon, 25 Jul 
> 2022 23:26:11 GMT", "msg": "HTTP Error 401: Unauthorized", "server": "EC2ws", 
> "status": 401, "url": "http://169.254.169.254/latest/meta-data/"}}
> 
> My ansible version on this Instance is : (ansible --version)
> 
> ansible 2.9.15
> config file = /etc/ansible/ansible.cfg
> configured module search path = [u'/root/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
> ansible python module location = /usr/lib/python2.7/dist-packages/ansible
> executable location = /usr/bin/ansible
> python version = 2.7.17 (default, Jul  1 2022, 15:56:32) [GCC 7.5.0]
> 
> Can someone please in this as stuck on this.
> Thanks in advance. 
> 
> 
> -- 
> 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/d6328c61-380e-4c9d-b043-2203d81385a5n%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/25527E49-8CFA-41AF-9FBE-801037F79E8A%40gmail.com.


[ansible-project] sucessfully ran single play but not when the play is part of a task in the pb

2022-07-25 Thread Tony Wong
I sucessully ran this play as a single play

---
- hosts: localhost
  name: test
  tasks:
  - name: run rke installer 
shell: 'rke up'
args:
  chdir: "/home/rke"  
become: yes
become_user: "rke"
delegate_to: localhost
register: result
  - debug:
  msg: "{{ result }} "


however this did not work as part of a playbook task


-- 
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/510cb366-ef13-4e1d-882e-f3db12d3ce7cn%40googlegroups.com.


[ansible-project] IMDS V2 Unauthorised Error || Guidance Required

2022-07-25 Thread SARANSH BANKIWAL
Hello all, 
Currently i was working on migration from IMDS v1 to IMDS v2 in AWS and got 
the below error. 

FAILED! => {"changed": false, "msg": "Failed to retrieve metadata from AWS: 
HTTP Error 401: Unauthorized", "response": {"body": "\nhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\;>\nhttp://www.w3.org/1999/xhtml\; xml:lang=\"en\" lang=\"en\">\n 
\n  401 - Unauthorized\n \n \n  401 - 
Unauthorized\n \n\n", "connection": "close", 
"content-length": "343", "content-type": "text/html", "date": "Mon, 25 Jul 
2022 23:26:11 GMT", "msg": "HTTP Error 401: Unauthorized", "server": 
"EC2ws", "status": 401, "url": "http://169.254.169.254/latest/meta-data/"}}

*My ansible version on this Instance is : (ansible --version)*

ansible 2.9.15
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.17 (default, Jul  1 2022, 15:56:32) [GCC 7.5.0]

Can someone please in this as stuck on this.
Thanks in advance. 

-- 
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/d6328c61-380e-4c9d-b043-2203d81385a5n%40googlegroups.com.


Re: [ansible-project] Hooks in Ansible

2022-07-25 Thread Vladimir Botka
On Mon, 25 Jul 2022 19:06:33 +0200
Daniel Gonçalves  wrote:

> What I want to do is executing some code at the end of the playbook 
> execution, in other words executing some code at some arbitrary playbook 
> execution step. I wonder if there is some event listener I can subscribe 
> on in order to execute my code.

This depends on the use case:

1) To execute the code at the end of the playbook you can use
   *post_tasks*. At some arbitrary playbook execution step use
   *tasks*.

2) To trigger the execution of a code by some events you can use
   the module *wait_for*
   
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/wait_for_module.html#ansible-builtin-wait-for-module-waits-for-a-condition-before-continuing
   and *handlers*
   https://docs.ansible.com/ansible/latest/user_guide/playbooks_handlers.html

3) To execute the code after the playbook finished you can use
   *ansible-runner*
   
https://ansible-runner.readthedocs.io/en/stable/python_interface/#usage-examples


-- 
Vladimir Botka

-- 
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/20220725215524.6aaab024%40gmail.com.


pgppsViJXWnql.pgp
Description: OpenPGP digital signature


[ansible-project] Newbie question

2022-07-25 Thread Jeffrey Parrott
Newbie here, looking to see if Ansible will allow me to do initial 
configurations on a new out of the box Cisco switch. I need the ability to 
have the switch connect to my network and download a specific 
configuration, Any help is well appreciated

-- 
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/296382fb-e9d6-4f2c-84df-efbfb49e92abn%40googlegroups.com.


[ansible-project] Hooks in Ansible

2022-07-25 Thread Daniel Gonçalves

Hello,

I wonder if you already had some discussions about hooks in Ansible. I 
tried some research but found nothing useful about what I am looking 
for.


What I want to do is executing some code at the end of the playbook 
execution, in other words executing some code at some arbitrary playbook 
execution step. I wonder if there is some event listener I can subscribe 
on in order to execute my code.


I don't know if this is good place to discuss about that or if I need to 
start a thread on devel. If so let me know.


Daniel.

--
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/4d71d73e0628d665990e3cf317078529%40lves.fr.


Re: [ansible-project] why am i not able to access id_rsa.pub as another user?

2022-07-25 Thread Brian Coca
> so does it mean I am unable to use elevate privileges using lookup?

exactly



-- 
--
Brian Coca

-- 
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/CACVha7da--n6LF-hdrvtO7obdsKpRjiUWxZOXaXZGtzv89xQ1A%40mail.gmail.com.


Re: [ansible-project] Ansible module for VM workstation to PowerOn & PowerOff

2022-07-25 Thread Mohan
Okay. Thank you very much. I'll check it out.

On Mon, 25 Jul 2022, 5:40 pm Will McDonald,  wrote:

> https://github.com/qsypoq/Ansible-VMware-Workstation-Fusion-Pro-Modules
> looks like it wraps vmrest.exe which would allow you to control the power
> state of VMs.
>
> You could also, more crudely, just stop/start using vmrun.exe
> [stop|suspend|start]  and wrap that with
> command/shell/win_powershell.
>
>
> On Mon, 25 Jul 2022 at 12:59, Mohan  wrote:
>
>> Hello Community members,
>>
>> I’m using vmware workstation version 15.0.0 on Ubuntu-20.04-LTS machine.
>>
>> We have deployed VM workstation based Windows-10 machines in that. I
>> want to know which ansible module we can use to *PowerOn *and *PowerOff 
>> *windows-10
>> virtual machines from workstation?
>>
>> I was searching online to find ansible module for the same, However i
>> couldn’t find the ideal document. So please let me know module in ansible?
>>
>> --
>> 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/adc99c80-db2e-4f06-ad1a-5db1a5dbfb5bn%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/JUarxotNpyY/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAKtKohSzTRcg6Xeptx84X-m0PgJJVoQLhkWCEpVAYK4Qc%3DAaGw%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/CA%2B4Hw5ZRAjmXQ-URjFENszsPa-PqGR5HsFVWiGN1D0ffsz3CRA%40mail.gmail.com.


Re: [ansible-project] Ansible module for VM workstation to PowerOn & PowerOff

2022-07-25 Thread Will McDonald
https://github.com/qsypoq/Ansible-VMware-Workstation-Fusion-Pro-Modules
looks like it wraps vmrest.exe which would allow you to control the power
state of VMs.

You could also, more crudely, just stop/start using vmrun.exe
[stop|suspend|start]  and wrap that with
command/shell/win_powershell.


On Mon, 25 Jul 2022 at 12:59, Mohan  wrote:

> Hello Community members,
>
> I’m using vmware workstation version 15.0.0 on Ubuntu-20.04-LTS machine.
>
> We have deployed VM workstation based Windows-10 machines in that. I want
> to know which ansible module we can use to *PowerOn *and *PowerOff *windows-10
> virtual machines from workstation?
>
> I was searching online to find ansible module for the same, However i
> couldn’t find the ideal document. So please let me know module in ansible?
>
> --
> 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/adc99c80-db2e-4f06-ad1a-5db1a5dbfb5bn%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/CAKtKohSzTRcg6Xeptx84X-m0PgJJVoQLhkWCEpVAYK4Qc%3DAaGw%40mail.gmail.com.


[ansible-project] Ansible module for VM workstation to PowerOn & PowerOff

2022-07-25 Thread Mohan
Hello Community members,

I’m using vmware workstation version 15.0.0 on Ubuntu-20.04-LTS machine.

We have deployed VM workstation based Windows-10 machines in that. I want 
to know which ansible module we can use to *PowerOn *and *PowerOff *windows-10 
virtual machines from workstation?

I was searching online to find ansible module for the same, However i 
couldn’t find the ideal document. So please let me know module in ansible?

-- 
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/adc99c80-db2e-4f06-ad1a-5db1a5dbfb5bn%40googlegroups.com.


Re: [ansible-project] looking for support

2022-07-25 Thread Dick Visser
So we don't know what the problem was, and instead of receiving some
context, we now also don't know what the solution was.
This one is ranked high in the top 10 of useless threads...

On Mon, 25 Jul 2022 at 09:27, Shyju Krishnan  wrote:

> Hi,
>
> Now it is working
> however the first time master node the corden and update the patch and
> rebooted after that only getting this error
> i just rerun the playbook again now it is working
>
> i will let you know if any issues
>
> On Mon, Jul 25, 2022 at 9:54 AM Abhijeet Kasurde 
> wrote:
>
>> I totally agree with Antony. It will be easier to answer the question if
>> you provide these details.
>>
>> Regarding your question, the task mentioned before the 'Cordon and Drain
>> Node' task failed with a non-zero return value and the failed ('Cordon and
>> Drain Node') task in the screenshot is expecting zero return code with JSON
>> output.
>>
>> On Sun, Jul 24, 2022 at 7:49 PM Antony Stone <
>> antony.st...@ansible.open.source.it> wrote:
>>
>>> On Sunday 24 July 2022 at 15:56:46, Shyju Krishnan wrote:
>>>
>>> > [image: image.png]
>>>
>>> Please:
>>>
>>> 1. Copy and paste text, don't post screenshots (especially in
>>> difficult-to-read
>>> colour combinations)
>>>
>>> 2. Show us the command you ran before getting the error
>>>
>>> 3. Show us the text of the error in as readable a format as possible
>>>
>>> 4. Show us your playbook (if it's small) or the relevent section of it
>>> (if
>>> it's big)
>>>
>>> 5. Consider using pastebin or similar if you want to show us more than
>>> arounnd
>>> 25 lines of playbook.
>>>
>>>
>>> Thanks,
>>>
>>>
>>> Antony.
>>>
>>> --
>>> Schrödinger's rule of data integrity: the condition of any backup is
>>> unknown
>>> until a restore is attempted.
>>>
>>>Please reply to the
>>> list;
>>>  please *don't*
>>> CC me.
>>>
>>>
>>
>> --
>> Thanks,
>> Abhijeet Kasurde
>>
>> --
>> 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/CAFwWkHqt0QBmeeNUrLRL%3D3cQq4_th-snDh3LxwStk%3DYt2ZskLg%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/CAN3_iPuG8FqjrmfRHLMwVC5QCZGUamXfnqbfdnnA8ss3Snd_0Q%40mail.gmail.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/CAF8BbLaPqunZgc2XhAEVpRBPZ4-pUe64NyO3m%2BQ98QXBM8rMUQ%40mail.gmail.com.


Re: [ansible-project] looking for support

2022-07-25 Thread Shyju Krishnan
Hi,

Now it is working
however the first time master node the corden and update the patch and
rebooted after that only getting this error
i just rerun the playbook again now it is working

i will let you know if any issues

On Mon, Jul 25, 2022 at 9:54 AM Abhijeet Kasurde 
wrote:

> I totally agree with Antony. It will be easier to answer the question if
> you provide these details.
>
> Regarding your question, the task mentioned before the 'Cordon and Drain
> Node' task failed with a non-zero return value and the failed ('Cordon and
> Drain Node') task in the screenshot is expecting zero return code with JSON
> output.
>
> On Sun, Jul 24, 2022 at 7:49 PM Antony Stone <
> antony.st...@ansible.open.source.it> wrote:
>
>> On Sunday 24 July 2022 at 15:56:46, Shyju Krishnan wrote:
>>
>> > [image: image.png]
>>
>> Please:
>>
>> 1. Copy and paste text, don't post screenshots (especially in
>> difficult-to-read
>> colour combinations)
>>
>> 2. Show us the command you ran before getting the error
>>
>> 3. Show us the text of the error in as readable a format as possible
>>
>> 4. Show us your playbook (if it's small) or the relevent section of it
>> (if
>> it's big)
>>
>> 5. Consider using pastebin or similar if you want to show us more than
>> arounnd
>> 25 lines of playbook.
>>
>>
>> Thanks,
>>
>>
>> Antony.
>>
>> --
>> Schrödinger's rule of data integrity: the condition of any backup is
>> unknown
>> until a restore is attempted.
>>
>>Please reply to the
>> list;
>>  please *don't*
>> CC me.
>>
>>
>
> --
> Thanks,
> Abhijeet Kasurde
>
> --
> 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/CAFwWkHqt0QBmeeNUrLRL%3D3cQq4_th-snDh3LxwStk%3DYt2ZskLg%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/CAN3_iPuG8FqjrmfRHLMwVC5QCZGUamXfnqbfdnnA8ss3Snd_0Q%40mail.gmail.com.