From: Adam Shamblin Date: Mon, 30 Oct 2023 04:01:07 +0000 (-0600) Subject: wip, users X-Git-Url: https://git.vexinglabs.com/?a=commitdiff_plain;h=HEAD;p=k8s-cluster.git wip, users --- diff --git a/install.yml b/install.yml index b6d258b..294ac56 100644 --- a/install.yml +++ b/install.yml @@ -73,11 +73,6 @@ - docker-buildx-plugin - docker-compose-plugin - - name: Configure user - ansible.builtin.user: - name: cloud_user - groups: docker - - name: Create containerd config file ansible.builtin.shell: sed -i 's/disabled_plugins/#disabled_plugins/' /etc/containerd/config.toml diff --git a/users.yml b/users.yml index 7f61407..6aabd52 100644 --- a/users.yml +++ b/users.yml @@ -1,18 +1,25 @@ --- -- hosts: "workers, masters" +- hosts: "all" become: yes tasks: - name: Create the kube user account - user: name=kube append=yes state=present createhome=yes shell=/bin/bash + ansible.builtin.user: + name: kube + append: yes + state: present + createhome: yes + shell: /bin/bash + groups: docker - name: allow 'kube' to use sudo w/out a password - lineinfile: + ansible.builtin.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 + ansible.posix.authorized_key: + user: kube + key: "{{ lookup('file', '/home/signal9/.ssh/id_rsa.pub') }}" + state: present