[ansible-project] Ansible output from csv file to html table

2018-08-26 Thread Saravanan Ponnusamy
All,
Ansible output of a playbook is csv file format. This needs to be converted 
to html table and send as mail body output within Ansible playbook. 
Can someone share the task detail to convert csv file to html table.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b0c9cb3c-d61c-41c5-92ee-bc81b02d21e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ec2_vol and windows hosts

2018-08-26 Thread John Roh
Have you used to packer to build an AMI? I use packer option to build and
to attach ec2 volumes,
https://www.packer.io/docs/builders/amazon-ebs.html#ami_block_device_mappings
.

John.

On Sun, Aug 26, 2018 at 10:38 AM Bruce Affonso 
wrote:

> Hi,
>
> I know how to use ec2_vol to mount a drive to a Windows host.  Are there
> and Ansible options or modules available that then allow that drive to be
> set online, initialized and formatted or do we need to use powershell
> commands?
>
> Thanks,
>
> Bruce
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d20c996e-3b88-4860-a539-dcd8a95f5729%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPxBRp44EJpFWkV_pZA%3DYHUe7qUFgkrySn%3Dj3%2BpQN%2BHxKHmEgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible output from csv file to html table

2018-08-26 Thread Saravanan Ponnusamy
Ansible output of a playbook is csv file format. This needs to be converted 
to html table and send as mail body output within Ansible playbook. 
Can someone share the task detail to convert csv file to html table.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7d74373b-6bb5-4d52-9c0b-895fe77749d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible playbook -read array variables from external file recursively

2018-08-26 Thread Saravanan Ponnusamy
It works. Thanks a lot  Kai Stian Olstad.

On Sunday, 26 August 2018 16:38:04 UTC-4, Kai Stian Olstad wrote:
>
> On Sunday, 26 August 2018 21.13.42 CEST Saravanan Ponnusamy wrote: 
> > 
> > Variables declared as an array in an external file. Need to read these 
> > variables recursively in the playbook during play for multiple records. 
> > Request to suggest right looping to use in Ansible playbook. 
> > 
> > Currently able to get the item and not item.[variable]. 
> > 
> > 
> > Playbook: 
> > 
> > --- 
> > - hosts: 127.0.0.1 
> >   gather_facts: no 
> > 
> >   tasks: 
> > - debug: 
> > var: "{{ item }}" 
> >   with_lines: cat array.yaml 
> > 
> > 
> > $ cat array.yaml 
> > 
> > - { name: user1, uid: 1001, env: dev, app: app1 } 
> > - { name: user2, uid: 1002, env: cit, app: app2 } 
>
> You need to put them in a dictionary, then you can do this. 
>
> array.yml 
> --- 
> myvar: 
>   - { name: user1, uid: 1001, env: dev, app: app1 } 
>   - { name: user2, uid: 1002, env: cit, app: app2 } 
>
>
>   tasks: 
> - include_vars: array.yml 
>
> - debug: msg="{{ item.name }} {{ item.uid }} {{ item.env }} {{ 
> item.app }}" 
>   with_items: '{{ myvar }}' 
>
>
> -- 
> Kai Stian Olstad 
>
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/76f0616c-dbf2-4fdb-8d95-26aa4f31ad71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible playbook -read array variables from external file recursively

2018-08-26 Thread Kai Stian Olstad
On Sunday, 26 August 2018 21.13.42 CEST Saravanan Ponnusamy wrote:
> 
> Variables declared as an array in an external file. Need to read these 
> variables recursively in the playbook during play for multiple records. 
> Request to suggest right looping to use in Ansible playbook.
> 
> Currently able to get the item and not item.[variable].
> 
> 
> Playbook:
> 
> ---
> - hosts: 127.0.0.1
>   gather_facts: no
> 
>   tasks:
> - debug:
> var: "{{ item }}"
>   with_lines: cat array.yaml
> 
> 
> $ cat array.yaml
> 
> - { name: user1, uid: 1001, env: dev, app: app1 }
> - { name: user2, uid: 1002, env: cit, app: app2 }

You need to put them in a dictionary, then you can do this.

array.yml
---
myvar:
  - { name: user1, uid: 1001, env: dev, app: app1 }
  - { name: user2, uid: 1002, env: cit, app: app2 }


  tasks:
- include_vars: array.yml

- debug: msg="{{ item.name }} {{ item.uid }} {{ item.env }} {{ item.app }}"
  with_items: '{{ myvar }}'


-- 
Kai Stian Olstad


-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6301016.cGKDcUDIWS%40x1.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible playbook -read array variables from external file recursively

2018-08-26 Thread Saravanan Ponnusamy


Variables declared as an array in an external file. Need to read these 
variables recursively in the playbook during play for multiple records. 
Request to suggest right looping to use in Ansible playbook.

Currently able to get the item and not item.[variable].


Playbook:

---
- hosts: 127.0.0.1
  gather_facts: no

  tasks:
- debug:
var: "{{ item }}"
  with_lines: cat array.yaml


$ cat array.yaml

- { name: user1, uid: 1001, env: dev, app: app1 }
- { name: user2, uid: 1002, env: cit, app: app2 }

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/66c88031-b60f-4b6d-8a4a-1bf0551072f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Please explain ec2_instance volumes config

2018-08-26 Thread Bruce Affonso

I think this thread got derailed - so is there a way to configure volume 
with the ec2_instance module?  

It works with ec2 module but hoping to use the ec2_instance module since it 
uses boto3 which I am told would help me workaround an issue I am having 
launching ec2 instances from a server with IAM role attached vs 
access/secret keys.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f962b6ae-c6a3-47fd-bdc3-63be3a47e0e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ec2_vol and windows hosts

2018-08-26 Thread Bruce Affonso
Hi,

I know how to use ec2_vol to mount a drive to a Windows host.  Are there 
and Ansible options or modules available that then allow that drive to be 
set online, initialized and formatted or do we need to use powershell 
commands?

Thanks,

Bruce

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d20c996e-3b88-4860-a539-dcd8a95f5729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.