v.1.0.0 bootstrap.yml; ansible-user on everry host

This commit is contained in:
2024-11-17 14:20:14 +01:00
parent cdc0cdae6a
commit 38bce638c5
4 changed files with 43 additions and 1 deletions

36
bootstrap.yml Normal file
View File

@@ -0,0 +1,36 @@
---
- hosts: all
become: true
pre_tasks:
- name: update respository index
tags: always
ansible.builtin.apt:
update_cache: true
- hosts: all
become: true
tasks:
- name: create ansible user with group
tags: always
ansible.builtin.user:
name: ansible
group: ansible
- name: add ssh key for ansible
tags: always
ansible.builtin.authorized_key:
user: ansible
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOclevKIKKnVEgkVXjszax/bTfaBT9yNNfy2in2ZZoyU ansible"
- name: add sudoers file for ansible
tags: always
ansible.builtin.copy:
src: sudoer_ansible
dest: /etc/sudoers.d/ansible
owner: root
group: root
mode: 0440