Re: [ansible-project] Multiple commands output in a single file

2021-05-31 Thread Djay wadhwa
Hi Pushp,

Script worked but desired outcome not achieved. still getting output of 
only 1st command ( show ip name-servers) in the file.

- name: Check Ip routes
  hosts: routers  
  gather_facts: false
  connection: local

  vars:
cli:
  username: "{{ hdn_user_rw }}"
  password: "{{ hdn_pass_rw }}"
 
  tasks:
 
   
- name: Name servers  
  ios_command: 
authorize: yes
provider: "{{ cli }}"
commands: 
  - show ip name-servers
  - show run | in ntp
  - show run | in host
  - show run | in address ipv4 
  - show run | in logging host
  register: print_output

#- name: save output to a file
  #copy: content="{{ print_output.stdout[0] }}" 
dest="/opt/ansible/dev/Dheeraj/verf/adnan/Log/{{ inventory_hostname }}.txt"
  
- name: save output to a file
  lineinfile:
create: yes
line: "{{item}}"
path: /opt/ansible/dev/Dheeraj/verf/adnan/Log/{{ inventory_hostname 
}}.txt
  with_items: "{{ print_output.stdout[0] }}"
   

On Tuesday, June 1, 2021 at 11:19:13 AM UTC+10 rajthecomputerguy wrote:

> There is a indentation error in your playbook
>
>   - name: save output to a file
>   lineinfile:
> create: yes
> line: "{{item}}"
> path: /opt/ansible/dev/Dheeraj/verf/adnan/Log/{{ 
> inventory_hostname }}.txt
> with_items: "{{ print_output.stdout[1] }}"
>  
> On Tue, Jun 1, 2021 at 5:19 AM Djay wadhwa  wrote:
>
>> Hi Pushpraj,
>>
>> I am getting the error below if i try to run this with lineinfile as per 
>> suggestion.
>>
>> Please see my playbook as attached. Appreciate your help
>>
>> ---
>> - name: Routers data
>>   hosts: routers  
>>   gather_facts: false
>>   connection: local
>>
>>   vars:
>> cli:
>>   username: "{{ hdn_user_rw }}"
>>   password: "{{ hdn_pass_rw }}"
>>  
>>   tasks:
>>
>> - name: Name servers  
>>   ios_command: 
>> authorize: yes
>> provider: "{{ cli }}"
>> commands: 
>>   - show ip name-servers
>>   - show ip interface brief
>>   - show run | in host 
>>   
>>   register: print_output
>>
>>  
>> - name: save output to a file
>>   lineinfile:
>> create: yes
>> line: "{{item}}"
>> path: /opt/ansible/dev/Dheeraj/verf/adnan/Log/{{ 
>> inventory_hostname }}.txt
>> with_items: "{{ print_output.stdout[1] }}"
>>
>>
>> =
>>
>> TASK [save output to a file] 
>> ***
>> fatal: [SURRDEN-NRT001]: FAILED! => {
>> "changed": false
>> }
>>
>> MSG:
>>
>> Unsupported parameters for (lineinfile) module: with_items Supported 
>> parameters include: 
>> attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
>> fatal: [POWHHSP-NRT002]: FAILED! => {
>> "changed": false
>> }
>>
>> MSG:
>>
>> Unsupported parameters for (lineinfile) module: with_items Supported 
>> parameters include: 
>> attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
>> fatal: [ROCKDEN-NRT001]: FAILED! => {
>> "changed": false
>> }
>>
>> MSG:
>>
>> Unsupported parameters for (lineinfile) module: with_items Supported 
>> parameters include: 
>> attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
>> to retry, use: --limit @/opt/ansible/dev/Dheeraj/Splunk.retry
>>
>>
>>
>>
>> On Tuesday, June 1, 2021 at 1:29:44 AM UTC+10 rajthecomputerguy wrote:
>>
>>> Can you try this
>>>
>>> Use this to write several strings into a file:
>>>
>>> - name: save output to a file
>>>
>>>
>>>   lineinfile:
>>> create: yes
>>> line: "{{item}}"
>>> path: ./output/{{ inventory_hostname }}.txt
>>>   with_items: "{{ print_output.stdout[1] }}"
>>>
>>>
>>> On Mon, May 31, 2021 at 11:28 AM Djay wadhwa  wrote:
>>>
 Hi All


 I have this ansible code where i need output of all these commands in 
 one file, however, all i am getting is either output of first command or 
 second command if i change the following to 0,1,2 however ansible is not 
 appending/writing all outputs into a single file.


 Appreciate if there is a method which members could suggest to make it 
 work.


 "{{ print_output.stdout[1] }}


 - name: 

Re: [ansible-project] Multiple commands output in a single file

2021-05-31 Thread Rajthecomputerguy
There is a indentation error in your playbook

  - name: save output to a file
  lineinfile:
create: yes
line: "{{item}}"
path: /opt/ansible/dev/Dheeraj/verf/adnan/Log/{{ inventory_hostname
}}.txt
with_items: "{{ print_output.stdout[1] }}"


On Tue, Jun 1, 2021 at 5:19 AM Djay wadhwa  wrote:

> Hi Pushpraj,
>
> I am getting the error below if i try to run this with lineinfile as per
> suggestion.
>
> Please see my playbook as attached. Appreciate your help
>
> ---
> - name: Routers data
>   hosts: routers
>   gather_facts: false
>   connection: local
>
>   vars:
> cli:
>   username: "{{ hdn_user_rw }}"
>   password: "{{ hdn_pass_rw }}"
>
>   tasks:
>
> - name: Name servers
>   ios_command:
> authorize: yes
> provider: "{{ cli }}"
> commands:
>   - show ip name-servers
>   - show ip interface brief
>   - show run | in host
>
>   register: print_output
>
>
> - name: save output to a file
>   lineinfile:
> create: yes
> line: "{{item}}"
> path: /opt/ansible/dev/Dheeraj/verf/adnan/Log/{{
> inventory_hostname }}.txt
> with_items: "{{ print_output.stdout[1] }}"
>
>
> =
>
> TASK [save output to a file]
> ***
> fatal: [SURRDEN-NRT001]: FAILED! => {
> "changed": false
> }
>
> MSG:
>
> Unsupported parameters for (lineinfile) module: with_items Supported
> parameters include:
> attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
> fatal: [POWHHSP-NRT002]: FAILED! => {
> "changed": false
> }
>
> MSG:
>
> Unsupported parameters for (lineinfile) module: with_items Supported
> parameters include:
> attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
> fatal: [ROCKDEN-NRT001]: FAILED! => {
> "changed": false
> }
>
> MSG:
>
> Unsupported parameters for (lineinfile) module: with_items Supported
> parameters include:
> attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
> to retry, use: --limit @/opt/ansible/dev/Dheeraj/Splunk.retry
>
>
>
>
> On Tuesday, June 1, 2021 at 1:29:44 AM UTC+10 rajthecomputerguy wrote:
>
>> Can you try this
>>
>> Use this to write several strings into a file:
>>
>> - name: save output to a file
>>
>>
>>   lineinfile:
>> create: yes
>> line: "{{item}}"
>> path: ./output/{{ inventory_hostname }}.txt
>>   with_items: "{{ print_output.stdout[1] }}"
>>
>>
>> On Mon, May 31, 2021 at 11:28 AM Djay wadhwa  wrote:
>>
>>> Hi All
>>>
>>>
>>> I have this ansible code where i need output of all these commands in
>>> one file, however, all i am getting is either output of first command or
>>> second command if i change the following to 0,1,2 however ansible is not
>>> appending/writing all outputs into a single file.
>>>
>>>
>>> Appreciate if there is a method which members could suggest to make it
>>> work.
>>>
>>>
>>> "{{ print_output.stdout[1] }}
>>>
>>>
>>> - name: Name servers
>>>
>>> ios_command:
>>>
>>> authorize: yes
>>>
>>> provider: "{{ cli }}"
>>>
>>> commands:
>>>
>>> - show ip name-servers
>>>
>>> - show ip int brief
>>>
>>> - show logging | in host
>>>
>>> register: print_output
>>>
>>> - name: save output to a file
>>>
>>> copy: content="{{ print_output.stdout[1] }}"
>>> dest="/opt/ansible/dev/Dheeraj/verf/adnan/NTP/{{ inventory_hostname }}.txt"
>>>
>>> --
>>> 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/60f51826-3f20-4421-97ed-1e79724c8473n%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>>
>> Thanks,
>>
>> Pushparaj G
>>
>> --
> 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
> 

Re: [ansible-project] Multiple commands output in a single file

2021-05-31 Thread Djay wadhwa
Hi Pushpraj,

I am getting the error below if i try to run this with lineinfile as per 
suggestion.

Please see my playbook as attached. Appreciate your help

---
- name: Routers data
  hosts: routers  
  gather_facts: false
  connection: local

  vars:
cli:
  username: "{{ hdn_user_rw }}"
  password: "{{ hdn_pass_rw }}"
 
  tasks:

- name: Name servers  
  ios_command: 
authorize: yes
provider: "{{ cli }}"
commands: 
  - show ip name-servers
  - show ip interface brief
  - show run | in host 
  
  register: print_output

 
- name: save output to a file
  lineinfile:
create: yes
line: "{{item}}"
path: /opt/ansible/dev/Dheeraj/verf/adnan/Log/{{ inventory_hostname 
}}.txt
with_items: "{{ print_output.stdout[1] }}"

=

TASK [save output to a file] 
***
fatal: [SURRDEN-NRT001]: FAILED! => {
"changed": false
}

MSG:

Unsupported parameters for (lineinfile) module: with_items Supported 
parameters include: 
attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
fatal: [POWHHSP-NRT002]: FAILED! => {
"changed": false
}

MSG:

Unsupported parameters for (lineinfile) module: with_items Supported 
parameters include: 
attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
fatal: [ROCKDEN-NRT001]: FAILED! => {
"changed": false
}

MSG:

Unsupported parameters for (lineinfile) module: with_items Supported 
parameters include: 
attributes,backrefs,backup,content,create,delimiter,directory_mode,follow,force,group,insertafter,insertbefore,line,mode,owner,path,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate
to retry, use: --limit @/opt/ansible/dev/Dheeraj/Splunk.retry




On Tuesday, June 1, 2021 at 1:29:44 AM UTC+10 rajthecomputerguy wrote:

> Can you try this
>
> Use this to write several strings into a file:
>
> - name: save output to a file
>
>
>   lineinfile:
> create: yes
> line: "{{item}}"
> path: ./output/{{ inventory_hostname }}.txt
>   with_items: "{{ print_output.stdout[1] }}"
>
>
> On Mon, May 31, 2021 at 11:28 AM Djay wadhwa  wrote:
>
>> Hi All
>>
>>
>> I have this ansible code where i need output of all these commands in one 
>> file, however, all i am getting is either output of first command or second 
>> command if i change the following to 0,1,2 however ansible is not 
>> appending/writing all outputs into a single file.
>>
>>
>> Appreciate if there is a method which members could suggest to make it 
>> work.
>>
>>
>> "{{ print_output.stdout[1] }}
>>
>>
>> - name: Name servers
>>
>> ios_command:
>>
>> authorize: yes
>>
>> provider: "{{ cli }}"
>>
>> commands:
>>
>> - show ip name-servers
>>
>> - show ip int brief
>>
>> - show logging | in host
>>
>> register: print_output
>>
>> - name: save output to a file
>>
>> copy: content="{{ print_output.stdout[1] }}" 
>> dest="/opt/ansible/dev/Dheeraj/verf/adnan/NTP/{{ inventory_hostname }}.txt"
>>
>> -- 
>> 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/60f51826-3f20-4421-97ed-1e79724c8473n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
>
> Thanks,
>
> Pushparaj G
>
>

-- 
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/93146581-f3b0-4bf4-8625-011b5c5a8d59n%40googlegroups.com.


Re: [ansible-project] How To Get Hostname, OS and Version From Ansible Facts In A List Format?

2021-05-31 Thread Stefan Hornburg (Racke)
On 31.05.21 15:33, 'Marcus Hayhurst' via Ansible Project wrote:
> Hello everyone,
> 
> I'm attempting to get a list of information of all my machines to send
> in an email:
> 
> *Hostname - OS (and) Version *
> 
> so essentially:
> 
> *{{ ansible_hostname }} - {{ ansible_distribution }} {{
> ansible_distribution_version }}* 
> 
> I tried something like this but it does not work:
> 
> - name: SET FACT FOR ANSIBLE FACTS
>   set_fact:
>     machine_os: "{{ ansible_facts }}"
> #
> #
> - name: DISTRIBUTION AND MAJOR VERSION
>   debug:
>     msg: "{% for os in machine_os %}{{ os.ansible_hostname }} - {{
> os.ansible_distribution }} {{ os.ansible_distribution_version }}{%
> endfor %}"
> 
> 
> Would anyone know how I could generate this list of information for all
> my machines to send via email?

Please give this a try:

- name: Collect information on all machines
  set_fact:
machine_info: |
  {% for host in ansible_play_hosts %}
  {{ hostvars[host]['ansible_hostname'] }} - {{ 
hostvars[host]['ansible_distribution'] }} {{ 
hostvars[host]['ansible_distribution_version'] }}
  {% endfor %}
  run_once: yes

Regards
Racke

> 
> -- 
> 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/721bdb5c-c602-48aa-a3bc-f23b65b2f73en%40googlegroups.com
> .


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.

-- 
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/a708ce34-edb3-23b7-df56-45801570de49%40linuxia.de.


Re: [ansible-project] Multiple commands output in a single file

2021-05-31 Thread Rajthecomputerguy
Can you try this

Use this to write several strings into a file:

- name: save output to a file
  lineinfile:
create: yes
line: "{{item}}"
path: ./output/{{ inventory_hostname }}.txt
  with_items: "{{ print_output.stdout[1] }}"


On Mon, May 31, 2021 at 11:28 AM Djay wadhwa  wrote:

> Hi All
>
>
> I have this ansible code where i need output of all these commands in one
> file, however, all i am getting is either output of first command or second
> command if i change the following to 0,1,2 however ansible is not
> appending/writing all outputs into a single file.
>
>
> Appreciate if there is a method which members could suggest to make it
> work.
>
>
> "{{ print_output.stdout[1] }}
>
>
> - name: Name servers
>
> ios_command:
>
> authorize: yes
>
> provider: "{{ cli }}"
>
> commands:
>
> - show ip name-servers
>
> - show ip int brief
>
> - show logging | in host
>
> register: print_output
>
> - name: save output to a file
>
> copy: content="{{ print_output.stdout[1] }}"
> dest="/opt/ansible/dev/Dheeraj/verf/adnan/NTP/{{ inventory_hostname }}.txt"
>
> --
> 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/60f51826-3f20-4421-97ed-1e79724c8473n%40googlegroups.com
> 
> .
>


-- 

Thanks,

Pushparaj G

-- 
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/CAE5Yv1TRcXzK-fQWFxw4UxOje3gCGMTwgHBOxBDvJL0mFAjR%2BQ%40mail.gmail.com.


Re: [ansible-project] Re: Handling Prompt in Cisco IOS_CONFIG module

2021-05-31 Thread Rajthecomputerguy
Yes, ios_config does not support prompting, Can you disable prompting and
re-enable once a task is done?

On Mon, May 31, 2021 at 4:55 PM R.B. Kumar  wrote:

> I got the answer from another forum. It is just a workaround only using
> cli_command module
>
> I read ansible 2.7 dont support prompt in ios_config.
> We need to user ios_command with loop as below
>
> - name: delete_crypto_map
>cli_command:
>command: "{{ item }}"
> prompt:
> - "Are you sure you want to do this"
> answer: 'yes'
> loop:
>  - config t
>  -  no crypto pki trustpoint CTA
>
>
>
> On Monday, May 31, 2021 at 3:40:07 PM UTC+5:30 R.B. Kumar wrote:
>
>> Can anybody have requirement similar to this? I tried with cli_command,
>> ios_command too..
>>
>> On Monday, May 31, 2021 at 2:15:09 AM UTC+5:30 R.B. Kumar wrote:
>>
>>> Hello All -  Using Ansible v2.7
>>> I am tying to execute Cisco IOS commands that prompts to type Y/N.
>>> Looks like the *Prompt: *is not available in *ios_config *module. For
>>> example
>>>
>>> - name: delete_crypto_map
>>>ios_config:
>>>lines:
>>>  - no crypto pki trustpoint CTA
>>>  - yes
>>> The above script doesnt work as the logs shows connection error: *timeout
>>> value 10 seconds reached while trying to send command*
>>> Looks like the after executing the command  *no crypto pki trustpoint
>>> CTA* the *Y/N *is prompted by the ansible is not sending Y to the prompt
>>>
>>> The *prompt: *works for *ios_commands: *module but doesnt work on
>>> *ios_config: *
>>>
>>> Do you have any experience on this kind of requirement or thoughts
>>> please?
>>>
>>>
>>>
>>> --
> 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/30ad8d60-c2e1-43b4-98a6-22b866f8907an%40googlegroups.com
> 
> .
>


-- 

Thanks,

Pushparaj G

-- 
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/CAE5Yv1R%2BhqSeYzr-wgB%3D98H-9NNFBDbFGoAMA1CP3U0UvuOEvQ%40mail.gmail.com.


Re: [ansible-project] How To Get Hostname, OS and Version From Ansible Facts In A List Format?

2021-05-31 Thread Rajthecomputerguy
Can you show me the error message?

On Mon, May 31, 2021 at 7:03 PM 'Marcus Hayhurst' via Ansible Project <
ansible-project@googlegroups.com> wrote:

> Hello everyone,
>
> I'm attempting to get a list of information of all my machines to send in
> an email:
>
> *Hostname - OS (and) Version *
>
> so essentially:
>
> *{{ ansible_hostname }} - {{ ansible_distribution }} {{
> ansible_distribution_version }}*
>
> I tried something like this but it does not work:
>
> - name: SET FACT FOR ANSIBLE FACTS
>   set_fact:
> machine_os: "{{ ansible_facts }}"
> #
> #
> - name: DISTRIBUTION AND MAJOR VERSION
>   debug:
> msg: "{% for os in machine_os %}{{ os.ansible_hostname }} - {{
> os.ansible_distribution }} {{ os.ansible_distribution_version }}{% endfor
> %}"
>
>
> Would anyone know how I could generate this list of information for all my
> machines to send via email?
>
> --
> 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/721bdb5c-c602-48aa-a3bc-f23b65b2f73en%40googlegroups.com
> 
> .
>


-- 

Thanks,

Pushparaj G

-- 
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/CAE5Yv1R%2Bh6t7K56hPiCeY3u%2BGTufBF1B7PrwzLG7SAtYNwk%3D8w%40mail.gmail.com.


[ansible-project] How To Get Hostname, OS and Version From Ansible Facts In A List Format?

2021-05-31 Thread 'Marcus Hayhurst' via Ansible Project
Hello everyone,

I'm attempting to get a list of information of all my machines to send in 
an email:

*Hostname - OS (and) Version *

so essentially:

*{{ ansible_hostname }} - {{ ansible_distribution }} {{ 
ansible_distribution_version }}* 

I tried something like this but it does not work:

- name: SET FACT FOR ANSIBLE FACTS
  set_fact:
machine_os: "{{ ansible_facts }}"
#
#
- name: DISTRIBUTION AND MAJOR VERSION
  debug:
msg: "{% for os in machine_os %}{{ os.ansible_hostname }} - {{ 
os.ansible_distribution }} {{ os.ansible_distribution_version }}{% endfor 
%}"


Would anyone know how I could generate this list of information for all my 
machines to send via email?

-- 
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/721bdb5c-c602-48aa-a3bc-f23b65b2f73en%40googlegroups.com.


[ansible-project] Juniper rule-sets

2021-05-31 Thread Mauricio Tavares
  For those who are using the juniper playbooks, is it me or the
only way to create/edit rule-sets in ansible is to, for instance, have
a template of the relevant session (or the entire config) and replace
it as needed?

-- 
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/CAHEKYV4AXaC_ZATuQj19uUSV%3DGC1faerZU-REh_Fw6eJTrdKdQ%40mail.gmail.com.


[ansible-project] Re: Handling Prompt in Cisco IOS_CONFIG module

2021-05-31 Thread R.B. Kumar
I got the answer from another forum. It is just a workaround only using 
cli_command module

I read ansible 2.7 dont support prompt in ios_config. 
We need to user ios_command with loop as below

- name: delete_crypto_map
   cli_command:
   command: "{{ item }}"
prompt:
- "Are you sure you want to do this"
answer: 'yes'
loop:
 - config t 
 -  no crypto pki trustpoint CTA



On Monday, May 31, 2021 at 3:40:07 PM UTC+5:30 R.B. Kumar wrote:

> Can anybody have requirement similar to this? I tried with cli_command, 
> ios_command too.. 
>
> On Monday, May 31, 2021 at 2:15:09 AM UTC+5:30 R.B. Kumar wrote:
>
>> Hello All -  Using Ansible v2.7  
>> I am tying to execute Cisco IOS commands that prompts to type Y/N.  Looks 
>> like the *Prompt: *is not available in *ios_config *module. For example
>>
>> - name: delete_crypto_map
>>ios_config:
>>lines:
>>  - no crypto pki trustpoint CTA
>>  - yes
>> The above script doesnt work as the logs shows connection error: *timeout 
>> value 10 seconds reached while trying to send command*
>> Looks like the after executing the command  *no crypto pki trustpoint 
>> CTA* the *Y/N *is prompted by the ansible is not sending Y to the prompt
>>
>> The *prompt: *works for *ios_commands: *module but doesnt work on 
>> *ios_config: *
>>
>> Do you have any experience on this kind of requirement or thoughts please?
>>
>>
>>
>>

-- 
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/30ad8d60-c2e1-43b4-98a6-22b866f8907an%40googlegroups.com.


[ansible-project] Re: Handling Prompt in Cisco IOS_CONFIG module

2021-05-31 Thread R.B. Kumar
Can anybody have requirement similar to this? I tried with cli_command, 
ios_command too.. 

On Monday, May 31, 2021 at 2:15:09 AM UTC+5:30 R.B. Kumar wrote:

> Hello All -  Using Ansible v2.7  
> I am tying to execute Cisco IOS commands that prompts to type Y/N.  Looks 
> like the *Prompt: *is not available in *ios_config *module. For example
>
> - name: delete_crypto_map
>ios_config:
>lines:
>  - no crypto pki trustpoint CTA
>  - yes
> The above script doesnt work as the logs shows connection error: *timeout 
> value 10 seconds reached while trying to send command*
> Looks like the after executing the command  *no crypto pki trustpoint CTA* 
> the *Y/N *is prompted by the ansible is not sending Y to the prompt
>
> The *prompt: *works for *ios_commands: *module but doesnt work on 
> *ios_config: *
>
> Do you have any experience on this kind of requirement or thoughts please?
>
>
>
>

-- 
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/6dd4bdc0-8a86-4780-a078-63d102289b32n%40googlegroups.com.


[ansible-project] exe installation trough ansible

2021-05-31 Thread Shyju Krishnan
 Dear Team,

How to install the .exe package through Ansible. MSI is working fine

looking for your valuable comments

-- 
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_iPsJXXpu%2BOFZDoLua-jb5A931B4XoPZqSYwnoExmb4gWXQ%40mail.gmail.com.