Archive for the 'Sysadmin' Category

Quick tip: Add multiple users with multiple public SSH keys with Ansible

Wednesday, May 30th, 2018

Because it took me a while to figure out how to do it cleanly, here’s my solution for adding multiple users with multiple public SSH keys on a server, using Ansible:

in login-vars.yml

- login: "user1"
  pass_hash: "$6$G1Q........"
    - "ssh-rsa AAAAB3N.....yBd1 user1@first-key"
    - "ssh-rsa AAAAB3N.....eWDp user1@second-key"
- login: "user2"
  pass_hash: "$6$G1A........"
    - "ssh-rsa AAAAB3N.....yCDd1 user2@first-key"
    - "ssh-rsa AAAAB3N.....eaop user2@second-key"

in roles/setup-users/main.yml

- name: configure user accounts
    name={{ item.login }} 
    password={{ item.pass_hash }}
  become: yes
    - "{{ shell_users }}"

- name: Add users public keys
    user={{ item.login }}
    key="{% for key in item.pubkeys %}{{ key ~ "\n" }}{% endfor %}"
  become: yes
    - "{{ shell_users }}"

HP Laserjet P3005: fuser disassembly and gear kit replacement

Friday, January 23rd, 2015

Here’s how to disassemble the fuser on an HP LaserJet P3005 printer, and replace the gear kit (which is a part that fails often, reference CB414-67923). First remove the sliding plastic part at the back of the printer, then remove these two screws :


Then remove the big plastic panel, bottom first so it disengages at the top.

Lift these two little tabs so you pull the part they’re attached on towards you, and remove it:


Remove the screw holding the next panel in place (then remove it by putting the cable at the left away, and be careful not to break the clip at the right). I don’t think this is necessary, in reality. I did it because I didn’t know where I was going.


Then unplug the fuser cables (the cover on the power panel comes off with no screws) :



And unscrew the four screws :


You can then pull the fuser away and reach the gears. From left to right, the first one has a plastic tab keeping it in place, which you can pull with a little screwdriver. The second one is free when you remove the first. The third one is freed by the fourth, which is held in place by a weird little plastic piece. The sizes of the pieces are rather close but not identical, watch out for that. More details on this part of the procedure.


news for few, stuff no-one cares about