This commit is contained in:
2026-01-12 14:01:56 +01:00
parent e656145b0f
commit 3fdbdc65da
10 changed files with 829 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@@ -0,0 +1,2 @@
---
# handlers file for setup_linux

View File

@@ -0,0 +1,3 @@
---
- include_tasks: system.yml
- include_tasks: ssh.yml

View File

@@ -0,0 +1,37 @@
- name: Ensure ts-admin user exists
ansible.builtin.user:
name: ts-admin
shell: /bin/bash
state: present
- name: Ensure .ssh directory exists for ts-admin
ansible.builtin.file:
path: /home/ts-admin/.ssh
state: directory
owner: ts-admin
group: ts-admin
mode: '0700'
- name: Add authorized keys for ts-admin
ansible.builtin.authorized_key:
user: ts-admin
state: present
key: "{{ item }}"
loop: "{{ ssh_public_keys }}"
when: ssh_public_keys is defined
- name: Ensure /etc/sudoers.d directory exists
ansible.builtin.file:
path: /etc/sudoers.d
state: directory
owner: root
group: root
mode: '0755'
- name: Allow ts-admin passwordless sudo
ansible.builtin.copy:
dest: /etc/sudoers.d/ts-admin
content: "ts-admin ALL=(ALL) NOPASSWD:ALL\n"
owner: root
group: root
mode: '0440'

View File

@@ -0,0 +1 @@
---

View File

@@ -0,0 +1,13 @@
---
# vars file for setup_linux
packages_present:
- ca-certificates
- curl
- vim
- unzip
- wget
- zip
ssh_public_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID+VHh9Q7Y/0dQgDqoHaQyf6EZjXqiBDg7FvQPrt5LSx Jan Forman"
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMdDJqGN9L5zkCoQPCOmOy3Rozf4CY+w3p1nf4Ztl4VD miko@Directwire"