Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-11 Thread Aharonu
Thank you Sumanth. I saw coloring to do for file level but as I am new of it, not got how to do it for tabs wise(sheet1, sheet2) *How to make it for tabs level in one file?* Example I got for doing file level: Cell Background and Foreground Colors Two important properties of Format object are

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-11 Thread Sumanth Parakala
Hi, Maybe deprecated, but this should be fine. You may use xlsx_writer.close() and also check. Speed of excecution depends on no: of rows. Never played with Colors, but font and book, worksheet modifications can be done using Xlsxwriter modules in pd. pd.ExcelWriter.book pd.ExcelWriter.sheets

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-10 Thread Aharonu
Hi Sumanth and Everyone, I have tested and it is working but i has to make small changes to work it. Is that okay to keep? xlsx_writer._save() --> it is getting success xlsx_writer.save() --> mentioned in script but getting error if i use it. I observed the first line ( header) in xlsx

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Sumanth Parakala
Try using a python to merge csvs into xlsx and shell module before mail module. -- localhost@root tmp # cat csv_xlsx_combine.py import pandas as pd csv1_data = pd.read_csv('file1.csv') csv2_data = pd.read_csv('file2.csv') xlsx_writer =

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Aharonu
Noted. Thank you! On Wed, 9 Aug 2023, 18:17 Evan Hisey, wrote: > I would send it as two files and let the user integrate to one file if > they prefer since it is not a technical requirement of usage. Csv as you > note does not support tabs. With out a hard technical requirement the > effort to

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Evan Hisey
I would send it as two files and let the user integrate to one file if they prefer since it is not a technical requirement of usage. Csv as you note does not support tabs. With out a hard technical requirement the effort to supply tabs may exceed the value. On Wed, Aug 9, 2023, 7:42 AM Thanh

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Aharonu
If not with csv, may I know if possible with exceel or xlsx..etc.Thx On Wed, 9 Aug 2023, 18:12 Thanh Nguyen Duc, wrote: > Technically csv doesn’t support multiple tabs so it is not able to achieve. > > Thanks and Best Regards, > > Thanh. > > On 9 Aug 2023, at 19:39, Aharonu wrote: > >  >

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Thanh Nguyen Duc
Technically csv doesn’t support multiple tabs so it is not able to achieve.Thanks and Best Regards,Thanh.On 9 Aug 2023, at 19:39, Aharonu wrote:Hi Evan Hisey,Thanks for your response.It is end user requested preferences. We don't need to avoid multiple files but segerate required data in one csv

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Aharonu
Hi Evan Hisey, Thanks for your response. It is end user requested preferences. We don't need to avoid multiple files but segerate required data in one csv file with multiple tabs. Example, If I want to pull filesystem which are online and offline staus. We need both in one file cvs ox excel

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Evan Hisey
Try starting with reviewing the problem the solution is trying to solve. Why does it have too be two tabs? Is it a technical requirement or just a preference? What will be consuming the data? Can it be used as two cvs? On Wednesday, August 9, 2023 at 6:56:50 AM UTC-5 Aharonu wrote: > Thank

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Aharonu
Thank you. Even I am not much aware of Python coming in advance level. It looks like big task. I will wait anyone suggest us more better way On Wed, 9 Aug 2023, 17:15 Thanh Nguyen Duc, wrote: > Hope can help. I am not python programmer so code may not clean. > from ansible.module_utils.basic

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Thanh Nguyen Duc
Hope can help. I am not python programmer so code may not clean.from ansible.module_utils.basic import *import sysimport osimport csvimport xlsxwriterimport globimport codecsimport pwdimport grpdef main():fields = {"csv_dir": {"required": True, "type": "str"},"output_xlsx_file": {"required": True,

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Aharonu
Hi Thanh Nguyen Duc, Thanks for quick response. May I get that reference details so I will give try for my requirement. On Wed, 9 Aug 2023, 16:29 Thanh Nguyen Duc, wrote: > Csv i don’t think have multiple tabs. I have done with excel instead. You > can use j2 template to create a csv then

Re: [ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Thanh Nguyen Duc
Csv i don’t think have multiple tabs. I have done with excel instead. You can use j2 template to create a csv then python to consolidate them to 1 file.On 9 Aug 2023, at 17:55, Aharonu wrote:Hi Todd and Team,Could you please help one below query? Thank you.Example, I have  file1.csv creates

[ansible-project] Mail module - multiple tabs in csv file

2023-08-09 Thread Aharonu
Hi Todd and Team, Could you please help one below query? Thank you. Example, I have *file1.csv *creates throught mail module as mentionedbelow. I need to create 2 tabs (data-set1, data_set2) in *file1.csv* and update required data. How can I deal with this? Thank you - name: Send csv file

[ansible-project] mail module with when condition

2022-07-05 Thread Milan Patel
--- - name: This playbook is for Testing Disk Space hosts: proxy become: yes become_method: sudo serial: 1 any_errors_fatal: true ignore_errors: yes gather_facts: yes vars: ansible_paython_interpreter: /usr/bin/python tasks: - name: report the status code

Re: [ansible-project] mail module

2020-09-20 Thread Dick Visser
On Sun, 20 Sep 2020 at 15:50, P Music's wrote: > > I attached my ansible version screen shot and error screenshot please look at > this and help me out as soon as possible I stuck up with this problem for a > week Sounds like bad planning on your side. You might get more help if you provide

Re: [ansible-project] mail module

2020-09-20 Thread Dick Visser
On Sun, 20 Sep 2020 at 08:24, Dick Visser wrote: > > sender: "x...@gmail.com" > > There is no 'sender' argument. See > https://docs.ansible.com/ansible/latest/modules/mail_module.html Actually 'sender' is an undocumted alias for 'from', so this will work. -- Dick Visser

Re: [ansible-project] mail module

2020-09-20 Thread Dick Visser
On Sat, 19 Sep 2020 at 11:02, P Music's wrote: > > here is my playbook > --- > - hosts:all >tasks: > - name: send mail > mail: > host: "smtp.gmail.com" > port: 587 > sender: "x...@gmail.com" There

Re: [ansible-project] mail module

2020-09-19 Thread P Music's
hi team can you please suggest a solution if anyone knows whats happening here On Sat, 19 Sep, 2020, 2:31 PM P Music's, wrote: > here is my playbook > --- > - hosts:all >tasks: > - name: send mail > mail: > host: "smtp.gmail.com" >

Re: [ansible-project] mail module

2020-09-19 Thread P Music's
here is my playbook --- - hosts:all tasks: - name: send mail mail: host: "smtp.gmail.com" port: 587 sender: "x...@gmail.com" to: "Prajwal H G " subject: "Report

Re: [ansible-project] mail module

2020-09-17 Thread Dick Visser
Post your playbook On Fri, 18 Sep 2020 at 07:53, Prajwal Gowda wrote: > hi team i need one help with the mail module > it is throwing error address family not supported > if anyone know how to send mail when the task failed please help > > thanks > prajwal h g > > > > > > > > > -- > > > You

[ansible-project] mail module

2020-09-17 Thread Prajwal Gowda
hi team i need one help with the mail module it is throwing error address family not supported if anyone know how to send mail when the task failed please help thanks prajwal h g -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

[ansible-project] Mail Module: "Connection unexpectedly closed: timed out"

2018-12-17 Thread Bharath Kumar
Hello Ansible Team/Users, I have a Playbook which is expected to send an email, as below. When run, it errors out with "Unable to Connect mailer.domain.com:25: Connection unexpectedly closed: timed out". --- - hosts: localhost gather_facts: yes vars_prompt: - name: file prompt: