Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change system accounts not on the user provided ignore-list items are not JSON serializable #125

Closed
krhubert opened this issue May 5, 2017 · 0 comments
Labels

Comments

@krhubert
Copy link
Contributor

krhubert commented May 5, 2017

Hi,

On some systems, I'm getting the error as below. For now I'm not seeing why this colud happen.

$ (ansible host) ansible --version
ansible 2.3.0.0
  python version = 3.5.2+ (default, Sep 22 2016, 12:18:14) [GCC 6.2.0 20160927]
$ (ansible host) lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.10
Release:	16.10
Codename:	yakkety
$ (provision host) lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial
TASK [os-hardening : remove always ignored system accounts from list] ***********************************************************************************************************************************************************************
task path: /root/ops/ansible/roles/os-hardening/tasks/user_accounts.yml:27
 [WARNING]: Failure using method (v2_runner_on_ok) in callback plugin (<ansible.plugins.callback.default.CallbackModule object at 0x7fe967f75898>): {'_apt', 'messagebus', 'dnsmasq', 'systemd-bus-proxy', 'systemd-timesync', 'mail',
'daemon', 'www-data', 'systemd-network', 'man', 'syslog', 'backup', 'uuidd', 'irc', 'proxy', 'systemd-resolve', 'ntp', 'uucp', 'lp', 'list', 'sys', 'gnats', 'pollinate', 'bin', 'news', 'lxd', 'games', 'sshd'} is not JSON serializable


TASK [os-hardening : change system accounts not on the user provided ignore-list] ***********************************************************************************************************************************************************
task path: /root/ops/ansible/roles/os-hardening/tasks/user_accounts.yml:32
The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/ansible/executor/task_executor.py", line 97, in run
    item_results = self._run_loop(items)
  File "/usr/local/lib/python3.5/dist-packages/ansible/executor/task_executor.py", line 290, in _run_loop
    res = self._execute(variables=task_vars)
  File "/usr/local/lib/python3.5/dist-packages/ansible/executor/task_executor.py", line 521, in _execute
    result = self._handler.run(task_vars=variables)
  File "/usr/local/lib/python3.5/dist-packages/ansible/plugins/action/normal.py", line 45, in run
    results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars, wrap_async=wrap_async))
  File "/usr/local/lib/python3.5/dist-packages/ansible/plugins/action/__init__.py", line 635, in _execute_module
    (module_style, shebang, module_data, module_path) = self._configure_module(module_name=module_name, module_args=module_args, task_vars=task_vars)
  File "/usr/local/lib/python3.5/dist-packages/ansible/plugins/action/__init__.py", line 160, in _configure_module
    task_vars=task_vars, module_compression=self._play_context.module_compression)
  File "/usr/local/lib/python3.5/dist-packages/ansible/executor/module_common.py", line 796, in modify_module
    (b_module_data, module_style, shebang) = _find_module_utils(module_name, b_module_data, module_path, module_args, task_vars, module_compression)
  File "/usr/local/lib/python3.5/dist-packages/ansible/executor/module_common.py", line 629, in _find_module_utils
    python_repred_params = repr(json.dumps(params))
  File "/usr/lib/python3.5/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.5/json/encoder.py", line 179, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: {'_apt', 'messagebus', 'dnsmasq', 'systemd-bus-proxy', 'systemd-timesync', 'mail', 'daemon', 'www-data', 'systemd-network', 'man', 'syslog', 'backup', 'uuidd', 'irc', 'proxy', 'systemd-resolve', 'ntp', 'uucp', 'lp', 'list', 'sys', 'gnats', 'pollinate', 'bin', 'news', 'lxd', 'games', 'sshd'} is not JSON serializable

fatal: [clap-instance-rh6g]: FAILED! => {
    "failed": true,
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}
@rndmh3ro rndmh3ro added the bug label May 5, 2017
rndmh3ro added a commit that referenced this issue Jul 24, 2020
Don't overwrite ssh_host_key_files if set manually
divialth pushed a commit to divialth/ansible-collection-hardening that referenced this issue Aug 3, 2022
divialth pushed a commit to divialth/ansible-collection-hardening that referenced this issue Aug 3, 2022
Don't overwrite ssh_host_key_files if set manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants