<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue with Ansible for FTD - Invalid Data Provided 'Type' in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021804#M499</link>
    <description>&lt;PRE&gt;&lt;SPAN class=""&gt;Hello, I have solved the error in the following way:&lt;BR /&gt;&lt;A href="https://github.com/CiscoDevNet/FTDAnsible/blob/master/module_utils/fdm_swagger_client.py" target="_blank" rel="noopener"&gt;https://github.com/CiscoDevNet/FTDAnsible/blob/master/module_utils/fdm_swagger_client.py&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;You have to replace this file with this code and within this code you also have to replace the following line:
from ansible.module_utils.network.ftd.common import HTTPMethod
By this line:
from ansible_collections.community.network.plugins.module_utils.network.ftd.common import HTTPMethod
With these two changes it already works, I hope it works for you, if you have questions you can write to me without problem&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Feb 2024 10:47:58 GMT</pubDate>
    <dc:creator>mtejerob</dc:creator>
    <dc:date>2024-02-21T10:47:58Z</dc:date>
    <item>
      <title>Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4923699#M461</link>
      <description>&lt;P&gt;Hello Cisco Community,&lt;/P&gt;
&lt;P&gt;I hope this post finds you well. I'm encountering an issue while using Ansible to manage my Cisco Firepower Threat Defense (FTD) firewall. Specifically, I'm trying to create a network object, but I keep running into the error message "Invalid data provided 'type'". I've tried troubleshooting this problem extensively and reviewed the post at &lt;A href="https://community.cisco.com/t5/network-security/ftd-ansible-module/td-p/4158369" target="_new"&gt;https://community.cisco.com/t5/network-security/ftd-ansible-module/td-p/4158369&lt;/A&gt;, but it didn't provide a solution.&lt;/P&gt;
&lt;P&gt;Here are the specifics of my environment:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Operating System: Ubuntu 22.04&lt;/LI&gt;
&lt;LI&gt;Ansible Version: 8.4.0&lt;/LI&gt;
&lt;LI&gt;Firepower Version: 7.3&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I've followed the documentation and examples provided by Cisco and Ansible, but I can't seem to get past this error. My playbook snippet looks something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;- name: Create Network Object
   community.network.ftd_configuration:
    operation: "addNetworkObject"
    data:
     name: "my-object"
     description: "some object descr."
     subtype: "HOST"
     value: "192.168.1.1"
     type: "networkobject"
   register_as: result
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I've also looked into the Ansible GitHub repository for the cisco.ftd module, and it does indeed seem abandonded. This could be a contributing factor to the issue, but I'm hopeful that there might be a workaround or a solution that others in the community have discovered.&lt;/P&gt;
&lt;P&gt;Has anyone encountered a similar problem with Ansible and FTD? If so, could you please share your insights or any possible workarounds? Any help or guidance would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;Thank you in advance for your assistance!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 21:54:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4923699#M461</guid>
      <dc:creator>an.balsby</dc:creator>
      <dc:date>2023-09-14T21:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4931884#M469</link>
      <description>&lt;P&gt;The fields look to be outdated.&amp;nbsp; The fields you need are:&lt;/P&gt;
&lt;P&gt;For Host&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"name": "OBJECT NAME",&lt;BR /&gt;"description": "SOME DESCRIPTION",&lt;BR /&gt;"value": "192.168.1.1",&lt;BR /&gt;"type": "Host"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;For Network&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"name": "NETWORK NAME",&lt;BR /&gt;"description": "SOME DESCRIPTOIN",&lt;BR /&gt;"value": "192.168.1.0/24",&lt;BR /&gt;"type": "Network"&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 08:29:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4931884#M469</guid>
      <dc:creator>Marius Gunnerud</dc:creator>
      <dc:date>2023-09-30T08:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4931912#M470</link>
      <description>&lt;P&gt;Hi Marius&lt;BR /&gt;I tried your suggestion, but it is still the same.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 11:23:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4931912#M470</guid>
      <dc:creator>an.balsby</dc:creator>
      <dc:date>2023-09-30T11:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4931947#M471</link>
      <description>&lt;P&gt;Is this an FTD managed by FMC or FDM?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 14:49:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4931947#M471</guid>
      <dc:creator>Marius Gunnerud</dc:creator>
      <dc:date>2023-09-30T14:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4932091#M472</link>
      <description>&lt;P&gt;This is managed by FDM.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 13:24:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4932091#M472</guid>
      <dc:creator>an.balsby</dc:creator>
      <dc:date>2023-10-01T13:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4937661#M473</link>
      <description>&lt;P&gt;The error message suggests that the value you're providing for the 'type' parameter is not valid. According to the Ansible documentation for the &lt;CODE&gt;ftd_configuration&lt;/CODE&gt; module, the valid values for the 'type' parameter are 'host', 'network', 'range', 'fqdn', 'country', 'port', 'protocol', 'url', 'wildcard', 'mac', 'user', 'usergroup', 'realm', 'securityzone', 'geolocation', 'attribute', and 'atp'.&lt;/P&gt;
&lt;P&gt;In your playbook snippet, you've set the 'type' parameter to 'networkobject', which is not a valid value. You should change it to one of the valid types mentioned above.&lt;/P&gt;
&lt;P&gt;Here's an updated version of your playbook snippet:&lt;/P&gt;
&lt;PRE class="language-yaml" tabindex="0"&gt;&lt;CODE&gt;- name: Create Network Object
  community.network.ftd_configuration:
    operation: "addNetworkObject"
    data:
      name: "my-object"
      description: "some object descr."
      subtype: "HOST"
      value: "192.168.1.1"
      type: "host"
  register_as: result
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please make sure to adjust the 'type' parameter to one of the valid values mentioned earlier. This should resolve the "Invalid data provided 'type'" error.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="test-id__field-value slds-form-element__static slds-grow word-break-ie11"&gt;If you find my reply solved your question or issue, kindly click the 'Accept as Solution' button and vote it as helpful.&lt;BR /&gt;&lt;BR /&gt;You can also learn more about Secure Firewall (formerly known as NGFW) through our live Ask the Experts (ATXs) session. Check out Cisco Network Security ATXs Resources [&lt;A href="https://community.cisco.com/t5/security-knowledge-base/cisco-network-security-ask-the-experts-resources/ta-p/4416493" target="_blank" rel="noopener"&gt;https://community.cisco.com/t5/security-knowledge-base/cisco-network-security-ask-the-experts-resources/ta-p/4416493&lt;/A&gt;] to view the latest schedule for upcoming sessions, as well as the useful references, e.g. online guides, FAQs.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 04:32:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4937661#M473</guid>
      <dc:creator>urathod</dc:creator>
      <dc:date>2023-10-11T04:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4938278#M475</link>
      <description>&lt;P&gt;Hi Urathod&lt;/P&gt;
&lt;P&gt;Thank you for trying to help.&lt;/P&gt;
&lt;P&gt;I Just tried to run your sample, but it does exactly the same. I attached a screenshot.&lt;/P&gt;
&lt;P&gt;I even tried running the exmple from the devnet, but that does the same: &lt;A href="https://developer.cisco.com/docs/ftd-ansible-api-v7-2/#!ftd_configuration/examples" target="_blank"&gt;https://developer.cisco.com/docs/ftd-ansible-api-v7-2/#!ftd_configuration/examples&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I looked at the Ansible doc here: &lt;A href="https://docs.ansible.com/ansible/latest/collections/community/network/ftd_configuration_module.html#ansible-collections-community-network-ftd-configuration-module" target="_blank"&gt;https://docs.ansible.com/ansible/latest/collections/community/network/ftd_configuration_module.html#ansible-collections-community-network-ftd-configuration-module&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;To me it looks like my initial playbook was correct. I am just not sure what is going on here...&lt;/P&gt;
&lt;P&gt;Did you have your suggestion working?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 19:41:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/4938278#M475</guid>
      <dc:creator>an.balsby</dc:creator>
      <dc:date>2023-10-11T19:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5018506#M495</link>
      <description>&lt;P&gt;Hey there, were you able to solve this problem? I ran into the same issue and it looks like the FTDAnsible included with even the latest version of Ansible is outdated and doesn't provide support for the type field. I was able to resolve this by replacing the fdm_swagger_client.py in my python distro with the newer version from &lt;A href="https://github.com/CiscoDevNet/FTDAnsible/blob/master/module_utils/fdm_swagger_client.py" target="_blank"&gt;https://github.com/CiscoDevNet/FTDAnsible/blob/master/module_utils/fdm_swagger_client.py&lt;/A&gt;. This may work for you by just doing that it did on one of my machines. On another of my machines with a newer version of Ansible I had to modify that file with the newer import on line 19. Essentially replacing the line with&lt;/P&gt;
&lt;DIV style="color: #cccccc; background-color: #1f1f1f; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;"&gt;
&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;ansible_collections&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;community&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;network&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;plugins&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;module_utils&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;network&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ftd&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;common&lt;/SPAN&gt; &lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;HTTPMethod&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;. Hope that helps!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 22:48:27 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5018506#M495</guid>
      <dc:creator>AdamOrdal</dc:creator>
      <dc:date>2024-02-14T22:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021709#M496</link>
      <description>&lt;P&gt;Hi AdamOrdal&lt;/P&gt;
&lt;P&gt;No i never got the Ansible scripts to work. I ended up stitching some Python together instead. It was a hassle to me, since i'm not a programmer, but i made it work.&lt;/P&gt;
&lt;P&gt;I did find the suggestion you mention here, but never got it to work. If you just made it work, i will try it again, because i really rather want to use Ansible.&lt;/P&gt;
&lt;P&gt;Thank you for the suggestion &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 07:49:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021709#M496</guid>
      <dc:creator>an.balsby</dc:creator>
      <dc:date>2024-02-21T07:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021784#M498</link>
      <description>&lt;P&gt;I'm literally having the same error, I don't understand what's happening and I can't find a solution anywhere...&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 10:20:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021784#M498</guid>
      <dc:creator>mtejerob</dc:creator>
      <dc:date>2024-02-21T10:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021804#M499</link>
      <description>&lt;PRE&gt;&lt;SPAN class=""&gt;Hello, I have solved the error in the following way:&lt;BR /&gt;&lt;A href="https://github.com/CiscoDevNet/FTDAnsible/blob/master/module_utils/fdm_swagger_client.py" target="_blank" rel="noopener"&gt;https://github.com/CiscoDevNet/FTDAnsible/blob/master/module_utils/fdm_swagger_client.py&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;You have to replace this file with this code and within this code you also have to replace the following line:
from ansible.module_utils.network.ftd.common import HTTPMethod
By this line:
from ansible_collections.community.network.plugins.module_utils.network.ftd.common import HTTPMethod
With these two changes it already works, I hope it works for you, if you have questions you can write to me without problem&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Feb 2024 10:47:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021804#M499</guid>
      <dc:creator>mtejerob</dc:creator>
      <dc:date>2024-02-21T10:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021832#M500</link>
      <description>&lt;P&gt;I have a feeling that the repos (or at least this code for FTD), has been abandoned. I tried reaching out via a bug report on GitHub, but no one ever responded.&lt;/P&gt;
&lt;P&gt;But if the solution here works, then atleast. that will work until next time Cisco changes the API.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 11:32:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5021832#M500</guid>
      <dc:creator>an.balsby</dc:creator>
      <dc:date>2024-02-21T11:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Ansible for FTD - Invalid Data Provided 'Type'</title>
      <link>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5051146#M505</link>
      <description>&lt;P&gt;This seems to happen due to the failure during data validation.&lt;BR /&gt;When you make 'add' or 'upsert' operation which works with 'PUT' or 'POST' api call, python module checks if the user input aligns with what FTD expected to see.( def validate_data in &lt;A href="https://github.com/CiscoDevNet/FTDAnsible/blob/master/module_utils/fdm_swagger_client.py#L343" target="_self"&gt;FTDAnsible / module_utils/fdm_swagger_client.py&lt;/A&gt; )&lt;BR /&gt;And to find what 'FTD expected to see' it makes an API call to "/apispec/ngfw.json".&lt;/P&gt;
&lt;P&gt;For an example of 'networkobject', it will try to find 'networkobject' from ngfw.json file and see what is expected value and compare it with what you provided in the Ansible playbook.&lt;/P&gt;
&lt;P&gt;The issue here is, in the ngfw.json file, I'm seeing unexpected value returned for some of attributes. Below is a snippet of ngfw.json where it relates to networkobject.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;"NetworkObject": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "subType": {
          "$ref": "#/definitions/NetworkObjectType"
        },
        "value": {
          "type": "string"
        },
        "isSystemDefined": {
          "type": "boolean"
        },
        "dnsResolution": {
          "$ref": "#/definitions/FQDNDNSResolution"
        },
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "default": "networkobject"
        }
      },
      "required": [
        "name",
        "subType",
        "type",
        "value"
      ]
    },&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From this result, we can see version, name and description value's type needs to be string, however we are seeing '$ref' instead of 'type' under subType, also '#/definitions/NetworkObjectType' instead of 'string'. This will cause an exception during data valiadation process.&lt;/P&gt;
&lt;P&gt;I wouldn't call this as Ansible module issue, but more of FTD providing unexpected value on&amp;nbsp;/apispec/ngfw.json api call.&lt;BR /&gt;I haven't tested on various versions so, the outcome might be different based on the version.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 03:53:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/issue-with-ansible-for-ftd-invalid-data-provided-type/m-p/5051146#M505</guid>
      <dc:creator>dankang</dc:creator>
      <dc:date>2024-03-27T03:53:02Z</dc:date>
    </item>
  </channel>
</rss>

