fractalcells / ansible-iocage

BSD 2-Clause "Simplified" License
36 stars 27 forks source link

iocage 1.0 added a column to `iocage list` -> `unable to parse` #9

Open slohse opened 5 years ago

slohse commented 5 years ago

iocage added the column 'Basejail' to the long-format list, which causes this plugin to fail with an unable to parse error. A fix is to change this line like this:

-                (_jid,_name,_boot,_state,_type,_release,_ip4,_ip6,_template) = l.split('\t')
+                (_jid,_name,_boot,_state,_type,_release,_ip4,_ip6,_template,_basejail) = l.split('\t')

But that of course breaks the plugin for older versions of iocage

berenddeboer commented 5 years ago

Get this on FreeNAS 11.2 which has iocage 1.0-ALPHA1:

fatal: [freenas.example.com]: FAILED! => {"changed": false, "msg": "unable to parse -\ttest\toff\tdown\tjail\t11.1-RELEASE-p6\tDHCP (not running)\t-\t-\n-\tunifi\ton\tdown\tjail\t11.1-RELEASE-p6\tDHCP (not running)\t-\t-\n"}
berenddeboer commented 5 years ago

The latest FreeNAS now says it has iocage Version FreeNAS 11.2-U4. That's a very odd version number.

Error:

The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_iocage_payload_eM6XuB/__main__.py", line 151, in _get_iocage_facts
    (_jid,_name,_boot,_state,_type,_release,_ip4,_ip6,_template,_basejail) = l.split('\t')

 [WARNING]: The value True (type bool) in a string field was converted to
u'True' (type string). If this does not look like what you expect, quote the
entire value to ensure it does not change.
xmj commented 3 years ago

presumably also not a problem any more

@berenddeboer could you please check with latest master?