Using openstack and ansible 2.10.8 to deploy and configure some pfsense 2.6.0 instances. It seems
self.module.run_command('/usr/local/bin/php', data=cmd) has .. added to the beginning of stdout causing JSONDecoder to throw an error when trying to parse the returned json string from php. I fixed this by changing the php function to the following.
def php(self, command):
""" Run a command in php and return the output """
cmd = '<?php\n'
cmd += command
cmd += '\n?>\n'
(dummy, stdout, stderr) = self.module.run_command('/usr/local/bin/php', data=cmd)
start_of_json = stdout.index('{')
end_of_json = stdout.rindex('}') + 1
# TODO: check stderr for errors
return json.loads(stdout[start_of_json:end_of_json])
Using openstack and ansible 2.10.8 to deploy and configure some pfsense 2.6.0 instances. It seems
self.module.run_command('/usr/local/bin/php', data=cmd)has..added to the beginning of stdout causing JSONDecoder to throw an error when trying to parse the returned json string from php. I fixed this by changing the php function to the following.