-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iosxr_banner module issue #77
Comments
Yeah, I'm seeing this, too. What happens is the banner string is converted to If I change the {0!r} on line 132 in the module to just {0}, and then make sure my banner has delimiters for the first and last characters (e.g., I used '@' as I didn't use '@' anywhere else in my banner), then it works in both network_cli and netconf modes. |
Thanks a lot, it worked. Only concern content doesn't reflect in format, it comes in a single row. Any idea how to set it? Where I am looking something line1 |
No problem, looks fine now :) |
@sbanswar can you post how you got the multiline working? |
The solution in my PR preserved the multiple lines in my tests provided I used the correct YAML '|' character to avoid folding. Was the PR code not working for you? |
I tried
and it is single line |
My code now requires a delimiter character. So if you're using the PR code, try putting a @ at the beginning and end of the banner text. |
I forgot that, and then was using the non updated version, Its working as expected now. |
I am having issues with the banner module as well.
The error for 3 is "timeout value 30 seconds reached while trying to send command" and increasing the timeout does not help. It's not an issue of the command taking too long to complete. Here are examples for 3:
|
If you use the latest code in Git, you'll need to use your own delimiter, but the banner should work. Pull the latest code, and then try something like:
|
That does work, thank you for that. Unfortunately it's not 100% compatible with the NXOS banner module. There, I am able to make a play like so:
Where banner_motd is a pre-loaded variable via these declarations:
And the contents of banner_motd.txt is just a standard text file with line breaks and some special characters. Much more scalable to re-use same banner file across different OS vendors like that. So if anyone was curious at taking another stab at improving this module, may just want to more or less copy what has been done for the Cisco NXOS banner module. |
Good day, See that this issue has not been done anything with for a while. Like @refriedjello I've done it the way he has done both for cisco.ios and cisco.nxos. Got it working for cisco.iosxr by doing this: - name: configuration_cisco.iosxr.iosxr | Set motd banner.
cisco.iosxr.iosxr_banner:
banner: motd
text: |
#
{{ lookup('file', 'banner.cfg') }}
#
state: present Instead of this: - name: configuration_cisco.iosxr.iosxr | Set motd banner.
cisco.iosxr.iosxr_banner:
banner: motd
text: "{{ lookup('file', 'banner.cfg') }}"
state: present
notify: Save ios. Would be nice if the delimiter character was incorporated in the module. Another problem with the module is that banner exec is not a viable method even though it does exist on iosxr: RP/0/RSP0/CPU0:ASR9901(config)#banner ?
LINE c banner-text c, where 'c' is a delimiting character
exec Set EXEC process creation banner
incoming Set incoming terminal line banner
login Set login banner
motd Set Message of the Day banner
prompt-timeout Set Message for login authentication timeout
slip-ppp Set Message for SLIP/PPP
Could someone look into this? |
The playbbok get timeout with multiple lines but if have only 2 lines it works, any pointer how to fix even increasing timeout doesn't make any different.
Have tried both Login & Motd options
Ansible Version - 2.8.4
name: Testing Cisco ASR9006
hosts: HOSTNAME
gather_facts: no
connection: netwotk_cli
tasks:
name: Configure the Login banner
iosxr_banner:
banner: login
text: |
line 1
line 2
line 3
state: present
@rohitthakur2590 rohitthakur2590 self-assigned this on Jul 1
@rohitthakur2590
Contributor
rohitthakur2590 commented on Jul 8
@sbanswar could you try with latest release as It works fine, following are the examples to configure timers
export ANSIBLE_PERSISTENT_CONNECT_TIMEOUT=60
[persistent_connection]
command_timeout = 100
connect_timeout = 100
connect_retry_timeout = 100
https://docs.ansible.com/ansible/latest/reference_appendices/config.html
@rohitthakur2590 rohitthakur2590 closed this on Jul 8
@sbanswar
Author
sbanswar commented 9 days ago
Hi Rohit,
What version are you suggesting , using 2.8.4? Tried with shared timers, still same error.
@sbanswar
Author
sbanswar commented 7 days ago
In addition, I don't think it's an issue with timeout, looks module doesn't able to understand the end of line hence throwing timeout error.
The text was updated successfully, but these errors were encountered: