name: Change Password on Partition
connection: httpapi
hosts: velos-partition[0]
collections:
f5networks.f5os
any_errors_fatal: true
vars:
ansible_user: "admin"
ansible_httpapi_password: "admin" # This is the default password for admin user on a partition
ansible_network_os: "f5networks.f5os.f5os"
ansible_httpapi_use_ssl: true
ansible_httpapi_use_proxy: false
ansible_httpapi_validate_certs: "no"
ansible_httpapi_port: 8888
ansible_command_timeout: 1800
persistent_log_messages: true
tasks:
name: pause for 30 seconds
pause:
seconds: 30
name: Change password on Demo partition
velos_partition_change_password:
user_name: "admin"
old_password: "old_password" # for the very first time this will probably be admin
new_password: "new_password"
The above task to change VELOS default parition and password fails.
Running F5OS_C 1.3.1
TASK [Change password on Demo partition] *****
task path: /Users/s.siddharth/test_with_anthony.yaml:66
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
<10.144.140.123> ESTABLISH LOCAL CONNECTION FOR USER: s.siddharth
<10.144.140.123> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh"&& mkdir "echo /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471" && echo ansible-tmp-1681852065.169584-76905-51035245995471="echo /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471" ) && sleep 0'
Using module file /Users/s.siddharth/.ansible/collections/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py
<10.144.140.123> PUT /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/tmp4lg34du2 TO /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py
<10.144.140.123> EXEC /bin/sh -c 'chmod u+x /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/ /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py && sleep 0'
<10.144.140.123> EXEC /bin/sh -c '/usr/local/Cellar/ansible/7.3.0/libexec/bin/python3.11 /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py && sleep 0'
<10.144.140.123> EXEC /bin/sh -c 'rm -f -r /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 107, in
ansiballz_main()
File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 99, in ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.f5networks.f5os.plugins.modules.velos_partition_change_password', init_globals=dict(module_fqn='ansible_collections.f5networks.f5os.plugins.modules.velos_partition_change_password', modlib_path=modlib_path),
File "", line 226, in run_module
File "", line 98, in run_module_code
File "", line 88, in run_code
File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 227, in
File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 220, in main
File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 171, in exec_module
File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 183, in execute
File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 191, in change_password_on_device
File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/moduleutils/client.py", line 26, in wrap
File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/moduleutils/client.py", line 53, in post
File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible/module_utils/connection.py", line 200, in rpc
ansible.module_utils.connection.ConnectionError: {'ietf-restconf:errors': {'error': [{'error-type': 'application', 'error-tag': 'access-denied', 'error-message': 'access denied'}]}}
fatal: [velos-partition-1]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 107, in \n ansiballz_main()\n File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 99, in ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.f5networks.f5os.plugins.modules.velos_partition_change_password', init_globals=dict(module_fqn='ansible_collections.f5networks.f5os.plugins.modules.velos_partition_change_password', modlib_path=modlib_path),\n File "", line 226, in run_module\n File "", line 98, in run_module_code\n File "", line 88, in run_code\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 227, in \n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 220, in main\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 171, in exec_module\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 183, in execute\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 191, in change_password_on_device\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/moduleutils/client.py", line 26, in wrap\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/moduleutils/client.py", line 53, in post\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible/module_utils/connection.py", line 200, in rpc\nansible.module_utils.connection.ConnectionError: {'ietf-restconf:errors': {'error': [{'error-type': 'application', 'error-tag': 'access-denied', 'error-message': 'access denied'}]}}\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
COMPONENT NAME
Environment
ANSIBLE VERSION
F5OS VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
name: Change Password on Partition connection: httpapi hosts: velos-partition[0] collections: f5networks.f5os any_errors_fatal: true vars: ansible_user: "admin" ansible_httpapi_password: "admin" # This is the default password for admin user on a partition ansible_network_os: "f5networks.f5os.f5os" ansible_httpapi_use_ssl: true ansible_httpapi_use_proxy: false ansible_httpapi_validate_certs: "no" ansible_httpapi_port: 8888 ansible_command_timeout: 1800 persistent_log_messages: true
tasks:
name: pause for 30 seconds pause: seconds: 30
name: Change password on Demo partition velos_partition_change_password: user_name: "admin" old_password: "old_password" # for the very first time this will probably be admin new_password: "new_password" The above task to change VELOS default parition and password fails. Running F5OS_C 1.3.1 TASK [Change password on Demo partition] ***** task path: /Users/s.siddharth/test_with_anthony.yaml:66 redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi <10.144.140.123> ESTABLISH LOCAL CONNECTION FOR USER: s.siddharth <10.144.140.123> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh"&& mkdir "echo /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471" && echo ansible-tmp-1681852065.169584-76905-51035245995471="echo /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471" ) && sleep 0' Using module file /Users/s.siddharth/.ansible/collections/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py <10.144.140.123> PUT /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/tmp4lg34du2 TO /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py <10.144.140.123> EXEC /bin/sh -c 'chmod u+x /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/ /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py && sleep 0' <10.144.140.123> EXEC /bin/sh -c '/usr/local/Cellar/ansible/7.3.0/libexec/bin/python3.11 /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py && sleep 0' <10.144.140.123> EXEC /bin/sh -c 'rm -f -r /Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/ > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 107, in ansiballz_main() File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 99, in ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 47, in invoke_module runpy.run_module(mod_name='ansible_collections.f5networks.f5os.plugins.modules.velos_partition_change_password', init_globals=dict(module_fqn='ansible_collections.f5networks.f5os.plugins.modules.velos_partition_change_password', modlib_path=modlib_path), File "", line 226, in run_module File "", line 98, in run_module_code File "", line 88, in run_code File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 227, in File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 220, in main File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 171, in exec_module File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 183, in execute File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 191, in change_password_on_device File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/moduleutils/client.py", line 26, in wrap File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/moduleutils/client.py", line 53, in post File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible/module_utils/connection.py", line 200, in rpc ansible.module_utils.connection.ConnectionError: {'ietf-restconf:errors': {'error': [{'error-type': 'application', 'error-tag': 'access-denied', 'error-message': 'access denied'}]}} fatal: [velos-partition-1]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 107, in \n ansiballz_main()\n File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 99, in ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/Users/s.siddharth/.ansible/tmp/ansible-local-76468r18chvoh/ansible-tmp-1681852065.169584-76905-51035245995471/AnsiballZ_velos_partition_change_password.py", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.f5networks.f5os.plugins.modules.velos_partition_change_password', init_globals=dict(module_fqn='ansible_collections.f5networks.f5os.plugins.modules.velos_partition_change_password', modlib_path=modlib_path),\n File "", line 226, in run_module\n File "", line 98, in run_module_code\n File "", line 88, in run_code\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 227, in \n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 220, in main\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 171, in exec_module\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 183, in execute\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/velos_partition_change_password.py", line 191, in change_password_on_device\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/moduleutils/client.py", line 26, in wrap\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible_collections/f5networks/f5os/plugins/moduleutils/client.py", line 53, in post\n File "/var/folders/9/zghqq6sx605cjnm2m35v8k0r0000gp/T/ansible_velos_partition_change_password_payload_hbyzb5ru/ansible_velos_partition_change_password_payload.zip/ansible/module_utils/connection.py", line 200, in rpc\nansible.module_utils.connection.ConnectionError: {'ietf-restconf:errors': {'error': [{'error-type': 'application', 'error-tag': 'access-denied', 'error-message': 'access denied'}]}}\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 }
EXPECTED RESULTS
ACTUAL RESULTS