mirror of
https://github.com/Expand-sys/kubernetes-rocky9
synced 2025-12-16 15:42:14 +11:00
Create users.yml
This commit is contained in:
parent
43c80b9710
commit
f99f46ff25
1 changed files with 17 additions and 0 deletions
17
ansible-deploy-k8s/users.yml
Normal file
17
ansible-deploy-k8s/users.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
- hosts: 'workers, masters'
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: create the kube user account
|
||||||
|
user: name=kube append=yes state=present createhome=yes shell=/bin/bash
|
||||||
|
|
||||||
|
- name: allow 'kube' to use sudo without needing a password
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/sudoers
|
||||||
|
line: 'kube ALL=(ALL) NOPASSWD: ALL'
|
||||||
|
validate: 'visudo -cf %s'
|
||||||
|
|
||||||
|
- name: set up authorized keys for the kube user
|
||||||
|
authorized_key: user=kube key="{{item}}"
|
||||||
|
with_file:
|
||||||
|
- ~/.ssh/id_rsa.pub
|
||||||
Loading…
Reference in a new issue