<?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: Create a firewall rule within specific access section in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Create-a-firewall-rule-within-specific-access-section/m-p/217160#M796</link>
    <description>&lt;P&gt;If you want to add a new access rule under a specific section title, you need to use the 'relative_position' parameter.&lt;/P&gt;
&lt;P&gt;Here is an example if you want to create a rule at the top of the section named "Automated Rules".&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    - name: "Demo - Add Standard Access Rule at top of section title"
      check_point.mgmt.cp_mgmt_access_rule:
        layer: "Access Rules Network"
        name: Test_Rule1
        state: present
        relative_position:
          top: "Automated Rules"
        service: SMTP
        source: Any
        action: Accept
        auto_publish_session: true
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2024 17:49:56 GMT</pubDate>
    <dc:creator>Erik_Lagzdins</dc:creator>
    <dc:date>2024-06-11T17:49:56Z</dc:date>
    <item>
      <title>Create a firewall rule within specific access section</title>
      <link>https://community.checkpoint.com/t5/Ansible/Create-a-firewall-rule-within-specific-access-section/m-p/217075#M795</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I am currently developing a playbook to automate rule creation on checkpoint.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;But for now the rule is made at the very bottom/top of the list of rules and I want to make the rule on the specific access section.&lt;/SPAN&gt;&lt;/SPAN&gt; i'm using new module from ansible&lt;BR /&gt;&lt;BR /&gt;here is my code:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class=""&gt;- name: create access-rule if not present&lt;BR /&gt;check_point.mgmt.cp_mgmt_access_rule:&lt;BR /&gt;&amp;nbsp; layer: "{{ cp_layer }}"&lt;BR /&gt;&amp;nbsp; name: "{{ cp_access_rule_name }}"&lt;BR /&gt;&amp;nbsp; service:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - "{{ cp_service_tcp_name }}"&lt;BR /&gt;&amp;nbsp; action: "{{ cp_access_rule_action }}"&lt;BR /&gt;&amp;nbsp; comments: create automatic by ansible&lt;BR /&gt;&amp;nbsp; source:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - "{{ cp_access_rule_source }}"&lt;BR /&gt;&amp;nbsp; destination:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - "{{ cp_access_rule_destination }}"&lt;BR /&gt;&amp;nbsp; enabled: true&lt;BR /&gt;&amp;nbsp; search_entire_rulebase: true&lt;BR /&gt;&amp;nbsp; track:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: log&lt;BR /&gt;&amp;nbsp; position: bottom&lt;BR /&gt;&amp;nbsp; state: present&lt;BR /&gt;&amp;nbsp; register: create_access_rule&lt;BR /&gt;ignore_errors: true&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Is there any insight i can achieve to create rule on specific access section?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;thanks in advance&lt;/DIV&gt;&lt;DIV class=""&gt;regards&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Jun 2024 04:12:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Create-a-firewall-rule-within-specific-access-section/m-p/217075#M795</guid>
      <dc:creator>dirBow</dc:creator>
      <dc:date>2024-06-11T04:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a firewall rule within specific access section</title>
      <link>https://community.checkpoint.com/t5/Ansible/Create-a-firewall-rule-within-specific-access-section/m-p/217160#M796</link>
      <description>&lt;P&gt;If you want to add a new access rule under a specific section title, you need to use the 'relative_position' parameter.&lt;/P&gt;
&lt;P&gt;Here is an example if you want to create a rule at the top of the section named "Automated Rules".&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    - name: "Demo - Add Standard Access Rule at top of section title"
      check_point.mgmt.cp_mgmt_access_rule:
        layer: "Access Rules Network"
        name: Test_Rule1
        state: present
        relative_position:
          top: "Automated Rules"
        service: SMTP
        source: Any
        action: Accept
        auto_publish_session: true
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 17:49:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Create-a-firewall-rule-within-specific-access-section/m-p/217160#M796</guid>
      <dc:creator>Erik_Lagzdins</dc:creator>
      <dc:date>2024-06-11T17:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a firewall rule within specific access section</title>
      <link>https://community.checkpoint.com/t5/Ansible/Create-a-firewall-rule-within-specific-access-section/m-p/217672#M797</link>
      <description>&lt;P&gt;hi erik,&lt;BR /&gt;&lt;BR /&gt;sorry for the late reply.&lt;BR /&gt;&lt;BR /&gt;i have tested relative_position and it works. thanks for your help&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 19:19:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Create-a-firewall-rule-within-specific-access-section/m-p/217672#M797</guid>
      <dc:creator>dirBow</dc:creator>
      <dc:date>2024-06-16T19:19:24Z</dc:date>
    </item>
  </channel>
</rss>

