ansible: remove raspbian default user "pi"

Add a new subtask that deletes Raspbian's default user "pi" with
UID=1000, so we can use the UID for the jenkins user. When the ansible
playbook is running, root access via ssh is already configured, so we
don't need the user "pi" anymore.

Related: OS#5055
Change-Id: If0cee6d35016c487eca02752625732dd03fad350
This commit is contained in:
Oliver Smith 2021-03-08 17:14:53 +01:00
parent 13e705f1ff
commit 796fd16b30
1 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,15 @@
include_tasks: debian.yml
when: ansible_distribution == 'Debian'
# Raspbian default user "pi" has uid=1000, which we need for the jenkins user.
# When the ansible playbook is running, root access via ssh is already
# configured, so we don't need the user "pi" anymore.
- name: delete raspbian default user
user:
name: "pi"
remove: true
state: absent
- name: add user jenkins
user:
name: "{{ jenkins_user }}"