sdarwin / Ansible-VNC

GNU General Public License v2.0
34 stars 11 forks source link

Quickstart issue #24

Open mmichau opened 1 year ago

mmichau commented 1 year ago

Hi I tried to install everything using a Quickstart method but Ansible failed on the task:

TASK [sdarwin.vnc : Create .vnc dirs] ****************************************** failed: [127.0.0.1] (item={'username': 'ubuntu', 'usergroup': 'ubuntu', 'vnc_num': 1, 'vnc_default_password': 'mypassword'}) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "root", "item": {"usergroup": "ubuntu", "username": "ubuntu", "vnc_default_password": "mypassword", "vnc_num": 1}, "mode": "0755", "msg": "chown failed: failed to look up user ubuntu", "owner": "root", "path": "/home/ubuntu/.vnc", "size": 2, "state": "directory", "uid": 0}

How to manage this error? Is it something to change in the code or in my system?

sdarwin commented 1 year ago

Hi mmichau, nice to hear from you.
As when reporting any bug you should provide some information about your system. What is the operating system and version? Please copy-paste the results of cat /etc/os-release

mmichau commented 1 year ago

cat /etc/os-release PRETTY_NAME="Ubuntu 22.04.3 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.3 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

sdarwin commented 1 year ago

Thanks. Next, please describe the server you are installing on. For example

Is it a new server with nothing on it, or has it been in production for a long time? If you log in, which users are present?

ls -al /home

I suspect the user ubuntu isn't there. In that case, you can't run the quickstart exactly as-is. But you may use this ansible role like any regular ansible role. Define the variable vnc_users within host_vars or group_vars, or even modify the playbook. The following is an example but change the user to match the user you will be using:

vnc_users:
  - username: 'ubuntu'
    usergroup: 'ubuntu'     # usergroup is optional. Defaults to username.
    #port 5901 is 1
    vnc_num: 1
    vnc_default_password: mypassword
mmichau commented 1 year ago

An old PC with a fresh install of Ubuntu. There is only one user created for me during the installation.

command ls -al /home gives two users, mine and ubuntu (not created by me)

sdarwin commented 1 year ago

I would be curious to find out what's going on. But anyway, for now, try setting vnc_users: with your own user account instead of ubuntu.