From f4d2dbc7245154cd77db51bbfde1430bd1fefce3 Mon Sep 17 00:00:00 2001 From: Gorden Date: Fri, 5 Feb 2021 10:46:20 +0100 Subject: [PATCH] added readme --- roles/cael.init/readme.md | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 roles/cael.init/readme.md diff --git a/roles/cael.init/readme.md b/roles/cael.init/readme.md new file mode 100644 index 0000000..cce24d0 --- /dev/null +++ b/roles/cael.init/readme.md @@ -0,0 +1,52 @@ +# Initial Server Setup on Debian based systems + +This role will execute a initial server setup for debian based systems. A number of containers will be created with the options specified in the `vars/defaults.yml` variable file. + +## Settings +- `create_user`: the name of the remote sudo user to create. +- `copy_local_key`: path to a local SSH public key that will be copied as authorized key for the new user. By default, it copies the key from the current system user running Ansible. +- `sys_packages`: array with list of packages that should be installed. + + +## Running this Role + +Quick Steps: + +### 1. Create a playbook +```shell +nano /etc/ansible/playbooks/setup-playbook.yml +``` +Drop the following in that playbook file: +```yml +#playbooks/setup-playbook.yml +--- +- hosts: all + become: true + + roles: + - cael.init +``` + +### 2. Customize Options + +```shell +nano vars/default.yml +``` + +```yml +#vars/default.yml +--- +create_user: sammy +copy_local_key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}" +sys_packages: [ 'curl', 'vim', 'git', 'ufw'] +``` + +### 3. IMPORTANT STEP - ssh-copy-id +```commmand +ssh-copy-id user@targethost +``` + +### 4. Run the Playbook +```command +ansible-playbook -l [target] -i [inventory file] -u [remote user] playbook.yml +```