Create users.yml

This commit is contained in:
BuildVirtual 2021-07-12 11:55:10 +01:00 committed by GitHub
parent 43c80b9710
commit f99f46ff25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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