<?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: Cannot change GAiA admin password via ansible/API in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235372#M820</link>
    <description>&lt;P&gt;That's on the gateway, so using the GAiA API, not the mgmt API...&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2024 15:59:12 GMT</pubDate>
    <dc:creator>cm</dc:creator>
    <dc:date>2024-12-11T15:59:12Z</dc:date>
    <item>
      <title>Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235348#M817</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to automate initial configuration of GAiA gateways and I have an issue when trying to change the password for "admin", like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  - name: set admin user password hash
    check_point.gaia.cp_gaia_user:
      name: admin
      password_hash: $6$xxxxx
      must_change_password: False&lt;/LI-CODE&gt;&lt;P&gt;When I try this, I get an error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Checkpoint device returned error 400 with message {'code': 'err_validation_failed', 'errors': 'Cannot change this attribute of user admin', 'msg': 'Validation Error'}&lt;/LI-CODE&gt;&lt;P&gt;This also happens when I use "password" instead of "password_hash", and it is limited to the "admin" user. I am accessing the API as a separate user "apiuser" because I thought maybe the password of the accessing user cannot be changed, but that's not the issue.&lt;/P&gt;&lt;P&gt;This is on R81.20 JHF89/API level 1.7&lt;/P&gt;&lt;P&gt;So, how do I change that password via the API and ansible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 14:17:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235348#M817</guid>
      <dc:creator>cm</dc:creator>
      <dc:date>2024-12-11T14:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235368#M818</link>
      <description>&lt;P&gt;Is this management or gateway?&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 15:46:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235368#M818</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-12-11T15:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235369#M819</link>
      <description>&lt;P&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/?#clish/set-user~v2%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/?#clish/set-user~v2%20&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 15:51:52 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235369#M819</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-12-11T15:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235372#M820</link>
      <description>&lt;P&gt;That's on the gateway, so using the GAiA API, not the mgmt API...&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 15:59:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235372#M820</guid>
      <dc:creator>cm</dc:creator>
      <dc:date>2024-12-11T15:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235373#M821</link>
      <description>&lt;P&gt;Hm, that link I sent is gaia cli.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/?#clish/set-user~v1.7%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/?#clish/set-user~v1.7%20&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 16:02:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235373#M821</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-12-11T16:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235379#M822</link>
      <description>&lt;P&gt;I don't think so. That's just the management API as called from clish, not the GAiA API which is a different beast. The link you posted affects the user objects in the SMC, not the GAiA users...&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:03:55 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235379#M822</guid>
      <dc:creator>cm</dc:creator>
      <dc:date>2024-12-11T17:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235382#M823</link>
      <description>&lt;P&gt;Maybe below?&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#web/set-user~v1.8%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#web/set-user~v1.8%20&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:55:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235382#M823</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-12-11T17:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235392#M824</link>
      <description>&lt;P&gt;Just to confirm, you can change other users passwords using this playbook, but not the admin user?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 21:03:55 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235392#M824</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2024-12-11T21:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235393#M825</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;it seems to be a bug in the ansible collection.&lt;/P&gt;
&lt;P&gt;it is possible to change the admin password using the set-user api call directly (&lt;A href="https://sc1.checkpoint.com/documents/latest/GaiaAPIs/index.html#cli/set-user~v1.7%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/GaiaAPIs/index.html#cli/set-user~v1.7%20&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;It also seems like this is only triggered when trying to change the password of the user "admin" if you crate a new user for example called test it works as expected.&lt;/P&gt;
&lt;P&gt;This is reproducible with this playbook&amp;nbsp;&lt;A href="https://github.com/checkpointsw-devsec/chkp-api-examples/blob/master/Ansible/Gaia/cp_gaia_user.yml" target="_blank"&gt;https://github.com/checkpointsw-devsec/chkp-api-examples/blob/master/Ansible/Gaia/cp_gaia_user.yml&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you open a issue here:&amp;nbsp;&lt;A href="https://github.com/CheckPointSW/CheckPointAnsibleGAIACollection" target="_blank"&gt;https://github.com/CheckPointSW/CheckPointAnsibleGAIACollection&lt;/A&gt;&amp;nbsp;or if you open a service request with TAC to get it solved.&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 21:07:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235393#M825</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2024-12-11T21:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235424#M826</link>
      <description>&lt;P&gt;Hi PhoneBoy,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes that is correct, the error message is only presented when you try to change the user "admin" se below result using this playbook:&amp;nbsp;&lt;A href="https://github.com/checkpointsw-devsec/chkp-api-examples/blob/master/Ansible/Gaia/cp_gaia_user.yml" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/checkpointsw-devsec/chkp-api-examples/blob/master/Ansible/Gaia/cp_gaia_user.yml&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TASK [Set password for the test user] ***************************************************************************************************************************************************************************************************************************************
changed: [192.168.233.51] =&amp;gt; {
    "changed": true,
    "invocation": {
        "module_args": {
            "allow_access_using": [
                "CLI",
                "Web-UI"
            ],
            "homedir": null,
            "must_change_password": null,
            "name": "test",
            "password": null,
            "password_hash": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "primary_system_group_id": 100,
            "real_name": "test user",
            "roles": null,
            "secondary_system_groups": null,
            "shell": "cli",
            "state": "present",
            "uid": null,
            "unlock": null
        }
    },
    "user": {
        "allow_access_using": [],
        "homedir": "/home/test",
        "locked": "",
        "must_change_password": "",
        "name": "test",
        "primary_system_group_id": 100,
        "real_name": "test user",
        "requires_two_factor_authentication": false,
        "roles": [],
        "secondary_system_groups": [],
        "shell": "cli",
        "uid": 0
    }
}

TASK [print test user settings] *********************************************************************************************************************************************************************************************************************************************
ok: [192.168.233.51] =&amp;gt; {
    "msg": {
        "changed": true,
        "failed": false,
        "user": {
            "allow_access_using": [],
            "homedir": "/home/test",
            "locked": "",
            "must_change_password": "",
            "name": "test",
            "primary_system_group_id": 100,
            "real_name": "test user",
            "requires_two_factor_authentication": false,
            "roles": [],
            "secondary_system_groups": [],
            "shell": "cli",
            "uid": 0
        },
        "warnings": [
            "Module did not set no_log for must_change_password"
        ]
    }
}

TASK [Set password for the admin user] **************************************************************************************************************************************************************************************************************************************
fatal: [192.168.233.51]: FAILED! =&amp;gt; {
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_access_using": [
                "CLI",
                "Web-UI"
            ],
            "homedir": null,
            "must_change_password": null,
            "name": "admin",
            "password": null,
            "password_hash": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "primary_system_group_id": 100,
            "real_name": null,
            "roles": null,
            "secondary_system_groups": null,
            "shell": "cli",
            "state": "present",
            "uid": null,
            "unlock": null
        }
    },
    "msg": "Checkpoint device returned error 400 with message {'code': 'err_validation_failed', 'errors': 'Cannot change this attribute of user admin', 'msg': 'Validation Error'}"
}
PLAY RECAP ******************************************************************************************************************************************************************************************************************************************************************
192.168.233.51             : ok=5    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0 &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 08:00:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235424#M826</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2024-12-12T08:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235442#M827</link>
      <description>&lt;P&gt;Thanks for confirming that the problem is not on my side. I'll proceed with a TAC case...&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 09:14:09 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235442#M827</guid>
      <dc:creator>cm</dc:creator>
      <dc:date>2024-12-12T09:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change GAiA admin password via ansible/API</title>
      <link>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235447#M828</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have informed the relevant R&amp;amp;D owner and have also reported this as an issue on Github here:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/CheckPointSW/CheckPointAnsibleGAIACollection/issues/49" target="_self"&gt;There is a bug in the ansible module: cp_gaia_user - Failing to change password-hash of user with name "admin"&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 09:30:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Cannot-change-GAiA-admin-password-via-ansible-API/m-p/235447#M828</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2024-12-12T09:30:31Z</dc:date>
    </item>
  </channel>
</rss>

