Open robertkarsai opened 1 year ago
This is a known issue and noted at the bottom of the README: https://github.com/pfsensible/core/blob/77349af3622aa98fb2cb67fc3daa75a4904c9846/README.md#L106
I have as yet found no way to replicate the pfSense XML format with the standard Python XML libraries. If you have a fix, it would be most welcome.
I haven't noticed that one at the bottom of the README, sorry man. Unfortunately I'm not much of a Python guy, however I've tried to workaround it with a new feature in pfsense+ 23.01 (https://docs.netgate.com/pfsense/en/latest/development/php-shell.html#upgradeconfig). This could have been a oneliner shell task at the end of my playbooks reverting all the CDATA and all, the problem is, that this upgradeconfig feature of the pfsense PHP shell doesn't seem touch the encoding of the config file.
Hi, I have a workaround for the XML encoding. If I put a task like this at the end of my pfsense playbooks, the XML encoding is changed back by pfsense native tools:
- name: Revert XML encoding
shell: pfSsh.php playback enablesshd
I don't think I want modules to rewrite the config automatically, but I added a simple pfsense_rewrite_config
task for people to use at the end of their plays like you did above.
Hello,
I've noticed that the pfsense config file XML encoding differs from the default pfSense XML encoding when I use pfsensible.core. Example (start of the config file right after a change over pfsensible):
`<?xml version='1.0' encoding='us-ascii'?>