Thanks to all who responded.
The example below is a yaml file to gather data from a Juniper Networks
Switch device.
How would you do it this?
- name: Get Facts
hosts: 192.168.1.1
roles:
- Juniper.junos
connection: local
gather_facts: no
vars_prompt:
- name: ADMUSER
prompt: Username
private: no
- name: ADMPASS
prompt: password
private: yes
tasks:
- name: Retrieve LLDP Neighbor Information Using PyEZ-included Table
juniper_junos_table:
file: "lldp.yml"
table: "RouteTable"
host: '{{ inventory_hostname }}'
user: '{{ ADMUSER }}'
passwd: '{{ ADMPASS }}'
port: 830
register: response
- name: Print response
debug:
var: response
- copy: content="{{ your_json_feed }}" dest=/etc/ansible/file-1
On Wednesday, February 13, 2019 at 8:45:06 AM UTC-5, DM wrote:
>
> How do you write to a file the output of a yaml?
>
> If possible, how do you only write to a file specific info if?
>
> Thanks
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/a61598d0-736e-43e2-9b10-a07981c9e3cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.