theforeman / foreman-ansible-modules

Ansible modules for interacting with the Foreman API and various plugin APIs such as Katello
GNU General Public License v3.0
149 stars 166 forks source link

katello_sync - call() got an unexpected keyword argument 'data' #578

Closed gforster closed 5 years ago

gforster commented 5 years ago
SUMMARY

when using the katello_sync module, getting the error: Error while performing sync on repositories: call() got an unexpected keyword argument 'data'

ISSUE TYPE
ANSIBLE VERSION
ansible 2.8.5
  config file = /home/gforster/ansible-playbooks/ansible.cfg
  configured module search path = [u'/home/gforster/ansible-playbooks/foreman-ansible-modules/plugins/modules']
  ansible python module location = /app/python/lib/python2.7/site-packages/ansible
  executable location = /app/python/bin/ansible
  python version = 2.7.14 (default, Jan  9 2018, 13:40:53) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
KATELLO/FOREMAN VERSION
tfm-rubygem-katello-3.10.0.46-1.el7sat.noarch
foreman-1.20.1.34-1.el7sat.noarch
APYPIE VERSION
Version: 0.0.2
STEPS TO REPRODUCE
---
- hosts: localhost
  connection: local

  vars:
    satellite_username: admin
    satellite_password: "{{ lnxsat_admin_pass }}"

  tasks:

  - name: VARS | include necessary vars
    include_vars: "{{ item }}"
    with_items:
    - vault_vars/lnxsat-admin.vault.yml

  - name: "Sync repository"
    katello_sync:
      username: "{{ satellite_username }}"
      password: "{{ satellite_password }}"
      server_url: "{{ satellite_url }}"
      repository: "Red Hat Ansible Engine 2.7 RPMs for Red Hat Enterprise Linux 7 Server x86_64"
      product: "Red Hat Ansible Engine"
      organization: "Default"
      validate_certs: false
EXPECTED RESULTS

The repository would be synced.

ACTUAL RESULTS
30028 1573040605.72320: _low_level_execute_command() done: rc=1, stdout=
{"msg": "Error while performing sync on repositories: call() got an unexpected keyword argument 'data'", "failed": true, "exception": "WARNING: The below traceback may *not* be related to the actual failure.\n  File \"/tmp/ansible_katello_sync_payload_PjYfn7/ansible_katello_sync_payload.zip/ansible/module_utils/foreman_helper.py\", line 512, in resource_action\n    result = self.foremanapi.resource(resource).call(action, resource_payload, options=options, data=data, files=files)\n", "invocation": {"module_args": {"username": "admin", "product": "Red Hat Ansible Engine", "repository": "Red Hat Ansible Engine 2.7 RPMs for Red Hat Enterprise Linux 7 Server x86_64", "synchronous": true, "server_url": "https://lnxsat.obfuscated.com", "organization": "Default", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "validate_certs": false}}}
, stderr=/app/python/lib/python2.7/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
/app/python/lib/python2.7/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
/app/python/lib/python2.7/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
/app/python/lib/python2.7/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
 30028 1573040605.72431: done with _execute_module (katello_sync, {'_ansible_version': '2.8.5', '_ansible_check_mode': False, '_ansible_module_name': u'katello_sync', '_ansible_debug': True, '_ansible_shell_executable': u'/bin/sh', u'username': u'admin', u'product': u'Red Hat Ansible Engine', '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p'], u'repository': u'Red Hat Ansible Engine 2.7 RPMs for Red Hat Enterprise Linux 7 Server x86_64', '_ansible_syslog_facility': u'LOG_USER', '_ansible_keep_remote_files': False, u'server_url': u'https://lnxsat.obfuscated.com', '_ansible_socket': None, '_ansible_string_conversion_action': u'warn', u'password': u'obfuscated', '_ansible_no_log': False, '_ansible_verbosity': 0, '_ansible_diff': True, '_ansible_remote_tmp': u'~/.ansible/tmp', u'organization': u'Default', '_ansible_tmpdir': None, u'validate_certs': False})
 30028 1573040605.72444: handler run complete
 30028 1573040605.72457: attempt loop complete, returning result
 30028 1573040605.72467: _execute() done
 30028 1573040605.72470: dumping result to json
 30028 1573040605.72475: done dumping result, returning
 30028 1573040605.72490: done running TaskExecutor() for localhost/TASK: Sync repository [005056b9-128f-37fa-1a7a-00000000062e]
 30028 1573040605.72510: sending task result for task 005056b9-128f-37fa-1a7a-00000000062e
 30028 1573040605.72561: done sending task result for task 005056b9-128f-37fa-1a7a-00000000062e
 30028 1573040605.72568: WORKER PROCESS EXITING
 30010 1573040605.72752: marking localhost as failed
 30010 1573040605.72768: marking host localhost failed, current state: HOST STATE: block=2, task=2, rescue=0, always=0, run_state=ITERATING_TASKS, fail_state=FAILED_NONE, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False
 30010 1573040605.72776: ^ failed state is now: HOST STATE: block=2, task=2, rescue=0, always=0, run_state=ITERATING_COMPLETE, fail_state=FAILED_TASKS, pending_setup=False, tasks child state? (None), rescue child state? (None), always child state? (None), did rescue? False, did start at task? False
 30010 1573040605.72780: getting the next task for host localhost
 30010 1573040605.72783: host localhost is done iterating, returning
An exception occurred during task execution. To see the full traceback, use -vvv. The error was:     result = self.foremanapi.resource(resource).call(action, resource_payload, options=options, data=data, files=files)
fatal: [localhost]: FAILED! => {
    "changed": false
}

MSG:

Error while performing sync on repositories: call() got an unexpected keyword argument 'data'
 30010 1573040605.72858: no more pending results, returning what we have
gforster commented 5 years ago

It looks like this is successful when using the nailgun branch

evgeni commented 5 years ago

your apipie is too old

gforster commented 5 years ago

That’ll do it. Thanks