Upload files to "playbooks"

This commit is contained in:
2026-10-10 14:30:30 +00:00
parent 9b621b7143
commit 6fc9e66ecd
4 changed files with 51 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
- name: setting up user
hosts: server
become: true
tasks:
- name: creating user
ansible.builtin.user:
name: user
create_home: yes
shell: /bin/bash
- name: making .ssh directory
ansible.builtin.file:
path: /home/user/.ssh
owner: user
group: user
state: directory
- ansible.posix.authorized_key:
user: user
key: "{{ lookup('file', '/path/2/key.pub') }}"
state: present