guillaumewatteeux / ansible-centreon

Ansible modules for CLAPI REST (Centreon API)
GNU General Public License v3.0
10 stars 12 forks source link

AttributeError: 'Commands' object has no attribute 'exist' #19

Open martialt opened 4 years ago

martialt commented 4 years ago

Hi,

I tried to create a task with 'centreon_command' and I got this error. With:

Task:

- name: Add Command to Centreon
  centreon_command:
  url: "{{ centreon_url }}"
  username: "{{ centreon_user }}"
  password: " {{ centreon_pass }}"
  name: vSphere-DRS-Rules
  type: check
  line: |
    toto

The full traceback is: Traceback (most recent call last): File "/home/user/.ansible/tmp/ansible-tmp-1578315014.3784451-129959563462035/AnsiballZ_centreon_command.py", line 102, in _ansiballz_main() File "/home/user/.ansible/tmp/ansible-tmp-1578315014.3784451-129959563462035/AnsiballZ_centreon_command.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/user/.ansible/tmp/ansible-tmp-1578315014.3784451-129959563462035/AnsiballZ_centreon_command.py", line 40, in invoke_module runpy.run_module(mod_name='ansible.modules.centreon_command', init_globals=None, run_name='main', alter_sys=True) File "/usr/lib64/python3.6/runpy.py", line 205, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/tmp/ansible_centreon_command_payload_0vgxgoeh/ansible_centreon_command_payload.zip/ansible/modules/centreon_command.py", line 188, in File "/tmp/ansible_centreon_command_payload_0vgxgoeh/ansible_centreon_command_payload.zip/ansible/modules/centreon_command.py", line 135, in main AttributeError: 'Commands' object has no attribute 'exist'

fatal: [servername.domain -> localhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/user/.ansible/tmp/ansible-tmp-1578315014.3784451-129959563462035/AnsiballZ_centreon_command.py\", line 102, in \n _ansiballz_main()\n File \"/home/user/.ansible/tmp/ansible-tmp-1578315014.3784451-129959563462035/AnsiballZ_centreon_command.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/user/.ansible/tmp/ansible-tmp-1578315014.3784451-129959563462035/AnsiballZ_centreon_command.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.centreon_command', init_globals=None, run_name='main', alter_sys=True)\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_centreon_command_payload_0vgxgoeh/ansible_centreon_command_payload.zip/ansible/modules/centreon_command.py\", line 188, in \n File \"/tmp/ansible_centreon_command_payload_0vgxgoeh/ansible_centreon_command_payload.zip/ansible/modules/centreon_command.py\", line 135, in main\nAttributeError: 'Commands' object has no attribute 'exist'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 }