Initial commit

This commit is contained in:
nemunaire 2023-03-17 06:51:58 +01:00
commit dfa0e72d5f
3 changed files with 43 additions and 0 deletions

18
meta/main.yml Normal file
View File

@ -0,0 +1,18 @@
---
dependencies: []
galaxy_info:
role_name: teach-adlin
author: 'Pierre-Olivier Mercier <nemunaire+iac@nemunai.re>'
description: Prepare things for the AdLin course at EPITA
license: GPL-3.0-or-later
min_ansible_version: 2.9
platforms:
- name: Alpine
versions:
- all
- name: Debian
versions:
- all
galaxy_tags: []

23
tasks/main.yml Normal file
View File

@ -0,0 +1,23 @@
---
- name: Create user for software deployment
ansible.builtin.user:
name: srs-deploy
home: /var/www/nemunai.re/srs
create_home: false
password: '*'
state: present
- name: Ensure srs-deploy home exists
file:
path: "/var/www/nemunai.re/{{ item }}"
owner: root
state: directory
loop:
- srs
- adlin
- name: Define authorized key for srs-deploy
ansible.posix.authorized_key:
user: srs-deploy
state: present
key: "{{ ssh_key_srs_deploy }}"

2
vars/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
ssh_key_srs_deploy: 'no-agent-forwarding,no-port-forwarding,no-pty,no-X11-forwarding,from="192.168.0.*,82.64.31.248,82.64.151.41,2a01:e0a:518:83?:*" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKp9v6Tktuw5Frym+RF14ahHGrdlM4bXuVhrAxWYUgy deploy-key-drone'