init
This commit is contained in:
38
roles/setup_linux/README.md
Normal file
38
roles/setup_linux/README.md
Normal 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).
|
||||
2
roles/setup_linux/handlers/main.yml
Normal file
2
roles/setup_linux/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for setup_linux
|
||||
3
roles/setup_linux/tasks/main.yml
Normal file
3
roles/setup_linux/tasks/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- include_tasks: system.yml
|
||||
- include_tasks: ssh.yml
|
||||
37
roles/setup_linux/tasks/ssh.yml
Normal file
37
roles/setup_linux/tasks/ssh.yml
Normal 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'
|
||||
1
roles/setup_linux/tasks/system.yml
Normal file
1
roles/setup_linux/tasks/system.yml
Normal file
@@ -0,0 +1 @@
|
||||
---
|
||||
13
roles/setup_linux/vars/main.yml
Normal file
13
roles/setup_linux/vars/main.yml
Normal 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"
|
||||
Reference in New Issue
Block a user