change ansible.cfg and inventory, so it works

This commit is contained in:
Your Name 2024-12-08 01:18:59 +01:00
parent 30ed190691
commit c9a139b593
3 changed files with 18 additions and 7 deletions

7
ansible.cfg Normal file
View file

@ -0,0 +1,7 @@
[defaults]
inventory = /root/ansible/inventory.ini
host_key_checking = False
private_key_file = /root/.ssh/id_ed25519
[inventory]
enable_plugins = yaml, ini

View file

@ -23,3 +23,4 @@ loadbalancer ansible_host=10.100.0.10
[lxc:vars]
ansible_user=root

View file

@ -29,6 +29,7 @@
- name: Create user "mhrebik"
ansible.builtin.user:
name: "mhrebik"
append: true
groups:
- sudo_passwordless
append: true
@ -37,14 +38,16 @@
- name: Create user matty
ansible.builtin.user:
name: "matty"
append: true
groups:
- sudo_passwordless
append: true
password: "$y$j9T$UC70HSbFYAg7I306Q204R.$Jfvjvhrw.UIPL9WI6pX7LdWvuvJS1VH3DJT6EFHQ/XB"
- name: Create user Kandertova
- name: Create user kandertova
ansible.builtin.user:
name: "mhrebik"
name: "kandertova"
append: true
groups:
- sudo_passwordless
append: true
@ -61,13 +64,13 @@
ansible.builtin.authorized_key:
user: mhrebik
key: "{{ item }}"
with_items: mhrebik_keys
with_items: "{{ mhrebik_keys }}"
- name: Add matty keys
ansible.builtin.authorized_key:
user: matty
key: "{{ item }}"
with_items: matty_keys
with_items: "{{ matty_keys }}"