debops icon indicating copy to clipboard operation
debops copied to clipboard

Initial run of rsyslog playbook fails

Open jo-krk opened this issue 1 year ago • 3 comments

Hi,

Initial run of rsyslog playbook fails against (target) freshly created Ubuntu 24.04 (server edition) with such error:

TASK [debops.debops.rsyslog : Create required system user] *******************************************************
task path: /home/ansible/.ansible/collections/ansible_collections/debops/debops/roles/rsyslog/tasks/main.yml:52
fatal: [vm-test]: FAILED! => {"changed": false, "msg": "usermod: user syslog is currently used by process 638\n", "name": "syslog", "rc": 8}

More verbose output:

fatal: [vm-test]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "append": true,
            "authorization": null,
            "comment": null,
            "create_home": false,
            "createhome": false,
            "expires": null,
            "force": false,
            "generate_ssh_key": null,
            "group": "syslog",
            "groups": [
                ""
            ],
            "hidden": null,
            "home": "/home/syslog",
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "syslog",
            "non_unique": false,
            "password": null,
            "password_expire_max": null,
            "password_expire_min": null,
            "password_expire_warn": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": "/bin/false",
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on vm-test",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": true,
            "uid": null,
            "umask": null,
            "update_password": "always"
        }
    },
    "msg": "usermod: user syslog is currently used by process 638\n",
    "name": "syslog",
    "rc": 8
}

Workaround is to stop syslog.socket temporary (which triggers rsyslog.service which starts PID 638 mentioned in usermod error message) via systemctl and then run rsyslog playbook which then succeeds and changes something via this particular task. After that, additional runs of rsyslog playbook succeed without any workarounds (there are no changes detected anymore during this task), so it's only initial run that is affected.

Thanks!

Ansible controller:

  • Ubuntu 22.04 (server edition)
  • ansible-core 2.16.6
  • ansible 9.5.1
  • Debops 3.1.0 (installed via ansible-galaxy)

Target VM (vm-test):

  • Ubuntu 24.04 (server edition)

jo-krk avatar May 27 '24 10:05 jo-krk

Good to know there is a workaround! I had configured rsyslog__unprivileged: False for newer 24.04 servers to get around this same issue, but was hoping to come back to it at some point to re-enable things. Neither option is great though since it breaks that first site install.

nathanpalmer avatar May 29 '24 14:05 nathanpalmer

So, Debops is still incompatible with Ubuntu 24.04?

mathieumd avatar Oct 14 '24 13:10 mathieumd

Just tried it on a fresh Ubuntu 24.04 VM, yes it still fails.

TASK [debops.debops.rsyslog : Create required system user] **************************************************************************************************************************
fatal: [xxx]: FAILED! => changed=false 
  msg: |-
    usermod: user syslog is currently used by process 7376
  name: syslog
  rc: 8

749 avatar Feb 28 '25 21:02 749