From 3aec975dc59435a343a1e03a222a93a1dfa46323 Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Sun, 29 Oct 2023 22:01:07 -0600 Subject: [PATCH] wip, users --- install.yml | 5 ----- users.yml | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) 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 -- 2.39.5