Host Setup, User Setup, SSH Configuration

This commit is contained in:
Bill Niblock 2025-06-23 13:10:20 -04:00
parent 78bf4efed1
commit 0402882891
5 changed files with 116 additions and 0 deletions

20
tasks/main.yml Normal file
View file

@ -0,0 +1,20 @@
# NibTech::Host::Tasks::main
# This role does host setup
# Role repository:
---
- name: Setup Users
ansible.builtin.include_tasks: users.yml
tags: ['users']
- name: Setup SSH
ansible.builtin.include_tasks: ssh.yml
tags: ['ssh']
- name: Setup Packages
ansible.builtin.include_tasks: packages.yml
tags: ['packages']
- name: Perform System Update
ansible.builtin.include_tasks: update.yml
tags: ['update']

18
tasks/ssh.yml Normal file
View file

@ -0,0 +1,18 @@
# NibTech::Host::Tasks::ssh
# This role does host setup
# This task configures SSH
# Role repository:
---
- name: Install SSH
ansible.builtin.package:
name: "openssh"
state: "present"
- name: Add Custom SSHD Configuration File
ansible.builtin.copy:
src: "nibtech-sshd.conf"
dest: "/etc/ssh/sshd_config.d/90-nibtech.conf"
owner: "root"
group: "root"
mode: "0600"

28
tasks/users.yml Normal file
View file

@ -0,0 +1,28 @@
# NibTech::Host::Tasks::users
# This role does host setup
# This task configures users, groups, and permissions
# Role repository:
---
- name: Configure Service Group
ansible.builtin.group:
name: "nibtech"
state: "present"
- name: Configure Ansible Deploy User
ansible.builtin.user:
name: "nibtech-deploy"
system: true
group: "nibtech"
shell: "/bin/bash"
create_home: true
home: "/opt/ansible"
- name: Configure NibTech Admin User
ansible.builtin.user:
name: "nibtech-admin"
append: true
groups: "['wheel','nibtech']"
shell: "/bin/bash"
create_home: true