From 744f1309bf0641e833a25419f07b1ec212858d5e Mon Sep 17 00:00:00 2001 From: Tomas Peterka Date: Sun, 10 Dec 2023 20:40:31 +0100 Subject: [PATCH] move example folder --- example-role/README.md | 7 +++++++ example-role/defaults/main.yml | 9 +++++++++ example-role/files/your-static-file.txt | 7 +++++++ {roles/lokal/example => example-role}/tasks/main.yml | 0 .../templates/compose.yml.j2 | 0 example-role/templates/service.conf.j2 | 12 ++++++++++++ roles/lokal/example/files/your-static-file.txt | 0 roles/lokal/example/templates/service.conf.j2 | 0 8 files changed, 35 insertions(+) create mode 100644 example-role/README.md create mode 100644 example-role/defaults/main.yml create mode 100644 example-role/files/your-static-file.txt rename {roles/lokal/example => example-role}/tasks/main.yml (100%) rename {roles/lokal/example => example-role}/templates/compose.yml.j2 (100%) create mode 100644 example-role/templates/service.conf.j2 delete mode 100644 roles/lokal/example/files/your-static-file.txt delete mode 100644 roles/lokal/example/templates/service.conf.j2 diff --git a/example-role/README.md b/example-role/README.md new file mode 100644 index 00000000..69a47063 --- /dev/null +++ b/example-role/README.md @@ -0,0 +1,7 @@ +# Example role + +Once you will need to add your own software into Lokal then you will +appreciate this folder. There is quite detailed [documentation](https://docs.lokal.network/) but it +is missing details on how to add your own roles. + + diff --git a/example-role/defaults/main.yml b/example-role/defaults/main.yml new file mode 100644 index 00000000..9638faa9 --- /dev/null +++ b/example-role/defaults/main.yml @@ -0,0 +1,9 @@ +version_yourapp: "13" + +# Security does not matter much here because all connections +# to the database are blocked from outside. To get a security +# breach, you would need to install the security thread yourself +mysql_user_yourapp: "your_app" +mysql_password_yourapp: "your_app" +mysql_database_yourapp: "your_app" + diff --git a/example-role/files/your-static-file.txt b/example-role/files/your-static-file.txt new file mode 100644 index 00000000..58b35b59 --- /dev/null +++ b/example-role/files/your-static-file.txt @@ -0,0 +1,7 @@ +This is just an example of a static file - can be a binary or anything +else that will get copied to the remote server and bound in a folder +into the docker container. Thus it will be accessible on predefined +path. This file will be copied with the {{ansible_user}} user and +priviledges. It will be mounted in the docker with {{uid}}:{{gid}} +permissions which are usually 1000:1000. We aim to run all containers +unpriviledged. \ No newline at end of file diff --git a/roles/lokal/example/tasks/main.yml b/example-role/tasks/main.yml similarity index 100% rename from roles/lokal/example/tasks/main.yml rename to example-role/tasks/main.yml diff --git a/roles/lokal/example/templates/compose.yml.j2 b/example-role/templates/compose.yml.j2 similarity index 100% rename from roles/lokal/example/templates/compose.yml.j2 rename to example-role/templates/compose.yml.j2 diff --git a/example-role/templates/service.conf.j2 b/example-role/templates/service.conf.j2 new file mode 100644 index 00000000..0367683c --- /dev/null +++ b/example-role/templates/service.conf.j2 @@ -0,0 +1,12 @@ +# This is an example config file for your example services +# It can have any format because you use jinja2 templates + +# Available variables are composed from following files: +# - roles/lokal/defaults/main.yml +# - roles//defaults/main.yml +# - hosts/.yml + +HOST: {{domain}} + +MY_COSTOM_VARIABLE: 5 +HELLO: "world" \ No newline at end of file diff --git a/roles/lokal/example/files/your-static-file.txt b/roles/lokal/example/files/your-static-file.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/roles/lokal/example/templates/service.conf.j2 b/roles/lokal/example/templates/service.conf.j2 deleted file mode 100644 index e69de29b..00000000