prole/infrastructure/roles/local_user/tasks/main.yml
chrisfu 7b242e88f5 Persist k3s context rename and scrub service config paths
Update conf/service/prole.cfg to persist the k3s kube context as knoe.dev.prole.org and replace host-specific absolute paths with $HOME-based paths for portability.

Include all pending project changes: local_user role package and screenrc provisioning updates, plus tools/k3s-cluster-rename.sh and tests/etc/test_k3s_cluster_rename.sh.

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-28 11:23:19 -07:00

46 lines
1.2 KiB
YAML

---
- name: Install baseline Linux packages
ansible.builtin.package:
name: "{{ local_user_required_packages }}"
state: present
- name: Install k3s-specific packages
ansible.builtin.package:
name: "{{ local_user_k3s_packages }}"
state: present
when:
- local_user_k3s_packages | length > 0
- (k3s_host | default(false) | bool) or ('k3s_hosts' in group_names)
- name: Ensure kubeadm group exists
ansible.builtin.group:
name: "{{ k3s_kubeconfig_group | default('kubeadm') }}"
state: present
- name: Ensure local user pi exists
ansible.builtin.user:
name: pi
state: present
shell: /bin/bash
home: /home/pi
create_home: yes
groups: "{{ k3s_kubeconfig_group | default('kubeadm') }}"
append: true
- name: Ensure /home/pi directory exists and has correct ownership
ansible.builtin.file:
path: /home/pi
state: directory
owner: pi
group: pi
mode: '0755'
- name: Install default screen configuration
ansible.builtin.copy:
src: screenrc
dest: "{{ item.path }}"
owner: "{{ item.owner | default('root') }}"
group: "{{ item.group | default(item.owner | default('root')) }}"
mode: "{{ item.mode | default('0644') }}"
loop: "{{ local_user_screenrc_targets }}"