#na_ontap_login_messages always show as being changed

1 messages · Page 1 of 1 (latest)

iron oriole
#

I'm setting the login banner on my OnTap clusters using the na_ontap_login_messages module, but every time it runs, Ansible shows that it is changed, even though nothing has changed. I'm guessing this is because I have line returns (\n) in the message, because when I do a very short test message, it no longer reports it as being changed every time it's run.

Is there any way to prevent this from showing as changed every time?

upper plover
#

let me check what could be going on .

Code wise the only way we would do that is if what was stored and returned by ONTAP was not match what you were inputing. I'll need to check if ONTAP is stripping off the \n when the variable is saved on the system.

upper plover
#

@iron oriole could you give us an example of one of the long message your seting (like how it looks in the playbook)

iron oriole
#

This is what the variable looks like in Ansible. I have to put it all into one line, otherwise the formatting gets all goofy and I get extra spaces (from the actual carriage returns):

banner: "\n***********************************************\nWARNING WARNING WARNING WARNING WARNING\n***********************************************\nThis system is for use of authorized users only.\n\nIndividuals using this computer system without authority, or in excess\nof their normal authority, are subject to having all of their\nactivities on this system monitored and recorded by system management.\n\nIn the course of monitoring individuals improperly using this system,\nor in the course of system maintenance, the activities of authorized\nusers may also be monitored.\n\nAnyone using this system expressly consents to such monitoring and is\nadvised that if such monitoring reveals possible evidence of criminal\nactivity, system personnel may provide the evidence of such monitoring\nto law enforcement officials.\n\n"

If I make it:
banner: "Hi"

It works fine. So, not sure if it's the \n that is causing it, or the length of the message?

night sage
#

yes this is not idempotent

#

identified the issue, we are currently removing any spaces, new lines at the end of motd_message, banner in current configuration before checking for modify.