add ansible nodes management
This commit is contained in:
@@ -0,0 +1 @@
|
||||
private.yaml
|
||||
@@ -0,0 +1 @@
|
||||
private.yaml
|
||||
@@ -0,0 +1,4 @@
|
||||
[all]
|
||||
casa
|
||||
casa-mini-minion-01
|
||||
casa-minion-01
|
||||
@@ -0,0 +1,23 @@
|
||||
# requirements, on device running ansible
|
||||
# ansible-galaxy collection install ansible.posix
|
||||
# python3 -m pip show passlib
|
||||
|
||||
- name: Setup System
|
||||
hosts:
|
||||
- ???
|
||||
become: true
|
||||
tasks:
|
||||
- name: Add ansible user
|
||||
ansible.builtin.user:
|
||||
password: "{{ ansible_new_user_password | password_hash('sha512') }}"
|
||||
name: "{{ ansible_new_user }}"
|
||||
groups: sudo
|
||||
shell: /bin/bash
|
||||
create_home: yes
|
||||
state: present
|
||||
|
||||
- name: Add SSH authorized key
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ ansible_new_user }}"
|
||||
key: "{{ lookup('file', '~/.ssh/id_ed25519.pub') }}"
|
||||
state: present
|
||||
@@ -0,0 +1,4 @@
|
||||
collections:
|
||||
- name: mylimbo.globals
|
||||
source: ssh://git@git.limbosolutions.com:2222/myLimbo/ansible.collection.globals.git
|
||||
type: git
|
||||
Reference in New Issue
Block a user