<?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: Ansible Playbook NAT configuration R81.20 - couldn't resolve cp_mgmt_nat_rule in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227506#M809</link>
    <description>&lt;P&gt;Please open a TAC request for this&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2024 06:58:21 GMT</pubDate>
    <dc:creator>_Val_</dc:creator>
    <dc:date>2024-09-23T06:58:21Z</dc:date>
    <item>
      <title>Ansible Playbook NAT configuration R81.20 - couldn't resolve cp_mgmt_nat_rule</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227440#M808</link>
      <description>&lt;P&gt;Using check_point.mgmt 6.2.1 (current) in practicing my automation skills I learned in Tim's&amp;nbsp; CCAS class. Ansible 2.10 on WSL running Ubuntu 22.04&lt;/P&gt;&lt;P&gt;&lt;A href="https://galaxy.ansible.com/ui/repo/published/check_point/mgmt/content/module/cp_mgmt_nat_rule/?keywords=nat&amp;amp;version=6.2.1" target="_blank" rel="noopener"&gt;https://galaxy.ansible.com/ui/repo/published/check_point/mgmt/content/module/cp_mgmt_nat_rule/?keywords=nat&amp;amp;version=6.2.1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The playbook creates an access policy (package), creates the access rule, and publishes the changes successfully.&lt;/P&gt;&lt;P&gt;When I try to add a task to add a NAT rule I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR! couldn't resolve module/action 'cp_mgmt_nat_rule'. This oftent indicates a misspelling, missing collection, or incorrect module path.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is confusing because everything else in collection check_point.mgmt worked.&lt;/P&gt;&lt;P&gt;Here is the task I'm adding:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    - name: add a NAT rule
      cp_mgmt_nat_rule:
        package: Lab_Policy
        name: Outbound NAT
        enabled: true
        installed_on:
        - Policy Targets
        original_destination: All_Internet
        original_source: branch1_lan
        translated_source: branch1_outbound_nat
        method: hide
        position: top
        comments: outbound NAT
        state: present&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here is how I install my environment:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sudo apt install -y ansible python3-paramiko python3-pip&lt;/LI&gt;&lt;LI&gt;ansible-galaxy collection install community.general vyos.vyos check_point.mgmt check_point.gaia&lt;/LI&gt;&lt;LI&gt;python3 -m pip install XenAPI&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here is my complete process and how I build the lab using automation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/doritoes/NUC-Labs/blob/xcp-ng-improvement/XCP-ng/Appendix-Ansible.md" target="_blank" rel="noopener"&gt;https://github.com/doritoes/NUC-Labs/blob/xcp-ng-improvement/XCP-ng/Appendix-Ansible.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Anyone get the ansible working in&amp;nbsp;check_point.mgmt 6.2.1? Or seen the same issue and solved it?&lt;/P&gt;&lt;P&gt;I did refer to this example&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/checkpointsw-devsec/enterprise-automation-poc/blob/main/ansible/roles/chkp-nat-policy/tasks/objects/configure-policy-nat-rules.yml" target="_blank" rel="noopener"&gt;https://github.com/checkpointsw-devsec/enterprise-automation-poc/blob/main/ansible/roles/chkp-nat-policy/tasks/objects/configure-policy-nat-rules.yml&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Sep 2024 01:57:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227440#M808</guid>
      <dc:creator>nadmin</dc:creator>
      <dc:date>2024-09-21T01:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Playbook NAT configuration R81.20 - couldn't resolve cp_mgmt_nat_rule</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227506#M809</link>
      <description>&lt;P&gt;Please open a TAC request for this&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 06:58:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227506#M809</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2024-09-23T06:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Playbook NAT configuration R81.20 - couldn't resolve cp_mgmt_nat_rule</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227610#M810</link>
      <description>&lt;P&gt;The documentation for&amp;nbsp;cp_mgmt_nat_rule says:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Minimum version required is 1.7.1 and JHF with PMTR-88097.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;This corresponds to API version 1.7.1, which is R81.&lt;BR /&gt;The first JHF with PMTR-88097 is Take 82.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What version/JHF is your management?&lt;BR /&gt;If it's not at least the above version/JHF level, you can resolve the issue by upgrading.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 18:19:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227610#M810</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2024-09-23T18:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Playbook NAT configuration R81.20 - couldn't resolve cp_mgmt_nat_rule</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227648#M811</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks interesting... here is the link saying check_point.mgmt verison 6.2.1 is the latest&lt;/P&gt;&lt;P&gt;&lt;A href="https://galaxy.ansible.com/ui/repo/published/check_point/mgmt/content/module/cp_mgmt_nat_rule/?keywords=nat&amp;amp;version=6.2.1" target="_blank"&gt;https://galaxy.ansible.com/ui/repo/published/check_point/mgmt/content/module/cp_mgmt_nat_rule/?keywords=nat&amp;amp;version=6.2.1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;SMS:&lt;/P&gt;&lt;P&gt;fwm ver&lt;/P&gt;&lt;P&gt;This is Check Point Security Management Server R81.20 - Build 441 (Check_Point_R81.20_T634,iso)&lt;/P&gt;&lt;P&gt;I was able to use cpuse to download and install R81.20 JHF 84 even with a trial version.&lt;/P&gt;&lt;P&gt;I also manually updated ansible to 2.16.&lt;/P&gt;&lt;P&gt;Still have the issues&amp;nbsp;cp_mgmt_nat_rule and&amp;nbsp;cp_mgmt_access_section.&lt;/P&gt;&lt;P&gt;I can try my work diamond support team, but generally I get better help here on api/automation.&lt;/P&gt;&lt;P&gt;I will open an issue on github.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 23:48:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227648#M811</guid>
      <dc:creator>nadmin</dc:creator>
      <dc:date>2024-09-23T23:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Playbook NAT configuration R81.20 - couldn't resolve cp_mgmt_nat_rule</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227677#M812</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;looking at the code in your task it looks like you are using the collection that comes with the Ansible installation. Please make sure you are using the collection installed from galaxy by referencing to it like this.&lt;/P&gt;
&lt;P&gt;check_point.mgmt.cp_mgmt_nat_rule:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    - name: add a NAT rule
      check_point.mgmt.cp_mgmt_nat_rule:
        package: Lab_Policy
        name: Outbound NAT
        enabled: true
        installed_on:
        - Policy Targets
        original_destination: All_Internet
        original_source: branch1_lan
        translated_source: branch1_outbound_nat
        method: hide
        position: top
        comments: outbound NAT
        state: present&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 07:07:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227677#M812</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2024-09-24T07:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Playbook NAT configuration R81.20 - couldn't resolve cp_mgmt_nat_rule</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227941#M813</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/31"&gt;@Jim_Oqvist&lt;/a&gt;&amp;nbsp; and edengr on Github repo.&lt;/P&gt;&lt;P&gt;This is the correct solution. The documentation could be clearer.&lt;/P&gt;&lt;P&gt;Prepending every module with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;check_point.mgmt&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;works to resolve this issue.&lt;/P&gt;&lt;P&gt;examples:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;check_point.mgmt.cp_mgmt_package&lt;/LI&gt;&lt;LI&gt;check_point.mgmt.cp_mgmt_access_rule&lt;/LI&gt;&lt;LI&gt;check_point.mgmt.cp_mgmt_access_section&lt;/LI&gt;&lt;LI&gt;check_point.mgmt.cp_mgmt_publish&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is extra work, but eliminates the problem of your task using different repos for different tasks.&lt;/P&gt;&lt;P&gt;For those who experience my issue on Ubuntu 22.04:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;don't install the default ansible; install from the ppa to get a current version of Ansible&lt;/LI&gt;&lt;LI&gt;i got an older API version with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ansible-galaxy collection install check_point.mgmt; use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ansible-galaxy collection install --force check_point.mgmt; to get the latest version&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 25 Sep 2024 18:21:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/227941#M813</guid>
      <dc:creator>nadmin</dc:creator>
      <dc:date>2024-09-25T18:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Playbook NAT configuration R81.20 - couldn't resolve cp_mgmt_nat_rule</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/228050#M814</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/104236"&gt;@nadmin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;In a playbook, you can control the collections Ansible searches for modules and action plugins to execute.&lt;/P&gt;
&lt;P&gt;By adding&lt;/P&gt;
&lt;PRE id="codecell3"&gt;  &lt;SPAN class="nt"&gt;collections&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="p p-Indicator"&gt;-&lt;/SPAN&gt; check_point.mgmt&lt;/PRE&gt;
&lt;P&gt;You do not need to prepend every task with the collection name&lt;/P&gt;
&lt;P&gt;More details here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.ansible.com/ansible/latest/collections_guide/collections_using_playbooks.html#using-collections-in-playbooks" target="_self"&gt;https://docs.ansible.com/ansible/latest/collections_guide/collections_using_playbooks.html#using-collections-in-playbooks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 12:48:15 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Playbook-NAT-configuration-R81-20-couldn-t-resolve-cp/m-p/228050#M814</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2024-09-26T12:48:15Z</dc:date>
    </item>
  </channel>
</rss>

