updated inventory and started setup_key playbook

This commit is contained in:
Ibrahim Mkusa 2024-10-03 17:41:45 -04:00
parent a6802413e5
commit 7ff34396c7
2 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,8 @@ doc ansible_user=pollen
[local]
proxmox ansible_user=root
pihole ansible_user=pollen
bastion ansible_user=mango
debianV ansible_user=ansible
[windows]
bane ansible_user=ansible ansible_connection=winrm ansible_winrm_transport=basic ansible_port=5985 ansible_winrm_server_cert_validation=ignore

18
playbooks/setup_keys.yml Normal file
View File

@ -0,0 +1,18 @@
---
- name: Sets up access to managed nodes on the control node
hosts: all
become: yes
gather_facts: true
tasks:
- name: create ansible user on managed nodes
ansible.builtin.user:
name: ansible
shell: /bin/bash
groups: sudo
append: yes
- name: set authorized key for ansible user
ansible.posix.authorized_key:
user: ansible
state: present
key: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/id_rsa.pub') }}"