<?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: Run a script with Ansible on R80.40 in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/118994#M542</link>
    <description>&lt;P&gt;Thanks for replying, however changing the script had no effect over the errors I get. I'm using "save config" more like a test command, however no matter what I try, even the simplest script,&amp;nbsp; ( "ls -l /" or "clish -c 'show configuration'") fails. In summary, I have not been able to run successfully any script using this Ansible module.&lt;/P&gt;</description>
    <pubDate>Thu, 20 May 2021 21:34:50 GMT</pubDate>
    <dc:creator>GermanP</dc:creator>
    <dc:date>2021-05-20T21:34:50Z</dc:date>
    <item>
      <title>Run a script with Ansible on R80.40</title>
      <link>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/118976#M539</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to run a script on a Firewall running R80.40 from an Ansible playbook, however I'm getting errors. What I did is this:&lt;/P&gt;&lt;P&gt;- I created a test playbook:&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;- name: Check Point test&lt;BR /&gt;&amp;nbsp; hosts: all&lt;BR /&gt;&amp;nbsp; connection: httpapi&lt;BR /&gt;&amp;nbsp; tasks:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - name: Save configuration&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cp_mgmt_run_script:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; script_name: "Save configuration"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; script: clish -c "save config"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wait_for_task: no&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; targets:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - Standalone-Ansible&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run this playbook, I get the following output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PLAY [Check Point test] ****************************************************************************************************************************************************************************&lt;/P&gt;&lt;P&gt;TASK [Gathering Facts] *********************************************************************************************************************************************************************************************&lt;BR /&gt;ok: [10.0.18.84]&lt;/P&gt;&lt;P&gt;TASK [Save configuration] ******************************************************************************************************************************************************************************************&lt;BR /&gt;changed: [10.0.18.84]&lt;/P&gt;&lt;P&gt;PLAY RECAP *********************************************************************************************************************************************************************************************************&lt;BR /&gt;10.0.18.84 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, it seems to work, right? well, not really. If I log into the Check Point Smart Console, I see that the task is still "running" with a 10% completion. And it never finishes or even progresses, I've let it run for two days.&lt;/P&gt;&lt;P&gt;Now, if I change the playbook, specifically this option:&lt;/P&gt;&lt;P&gt;wait_for_task: no&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;wait_for_task: yes&lt;/P&gt;&lt;P&gt;then I get the following output:&lt;/P&gt;&lt;P&gt;PLAY [Check Point test] ****************************************************************************************************************************************************************************&lt;/P&gt;&lt;P&gt;TASK [Gathering Facts] *********************************************************************************************************************************************************************************************&lt;BR /&gt;ok: [10.0.18.84]&lt;/P&gt;&lt;P&gt;TASK [Save configuration] ******************************************************************************************************************************************************************************************&lt;BR /&gt;fatal: [10.0.18.84]: FAILED! =&amp;gt; {"changed": false, "msg": {"code": "generic_err_invalid_parameter", "message": "ERROR: Failed to handle asynchronous tasks as synchronous, tasks result is undefined.\nInvalid parameter for [task-id]. Invalid value"}}&lt;/P&gt;&lt;P&gt;PLAY RECAP *********************************************************************************************************************************************************************************************************&lt;BR /&gt;10.0.18.84 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, it failed, right? well, the Check Point Smart Console says that the task completed successfully, but since Ansible receives an error, the playbook stops.&lt;/P&gt;&lt;P&gt;Now: how do I solve this? it seems no matter what I do, I get an error somewhere and the script does not work. Thanks in advance for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 20:54:47 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/118976#M539</guid>
      <dc:creator>GermanP</dc:creator>
      <dc:date>2021-05-20T20:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Run a script with Ansible on R80.40</title>
      <link>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/118992#M540</link>
      <description>&lt;P&gt;You might try changing the script to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;clish -c "save config"; exit&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Of course, I'd be curious what other things you're trying to do that requires a save config.&lt;BR /&gt;Tagging&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/41271"&gt;@Or_Soffer&lt;/a&gt;&amp;nbsp;also.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 21:28:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/118992#M540</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-05-20T21:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Run a script with Ansible on R80.40</title>
      <link>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/118994#M542</link>
      <description>&lt;P&gt;Thanks for replying, however changing the script had no effect over the errors I get. I'm using "save config" more like a test command, however no matter what I try, even the simplest script,&amp;nbsp; ( "ls -l /" or "clish -c 'show configuration'") fails. In summary, I have not been able to run successfully any script using this Ansible module.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 21:34:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/118994#M542</guid>
      <dc:creator>GermanP</dc:creator>
      <dc:date>2021-05-20T21:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Run a script with Ansible on R80.40</title>
      <link>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/119266#M544</link>
      <description>&lt;P&gt;Hi guys, any other ideas on this issue are welcome. I am inclined to think this is some kind of bug, but it seems strange to me that nobody seems to have reported it. Thanks for any help.&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 17:35:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Run-a-script-with-Ansible-on-R80-40/m-p/119266#M544</guid>
      <dc:creator>GermanP</dc:creator>
      <dc:date>2021-05-24T17:35:58Z</dc:date>
    </item>
  </channel>
</rss>

