diff --git a/.ansible/skeleton/default/README.md.j2 b/.ansible/skeleton/default/README.md.j2 new file mode 100644 index 0000000..18083ed --- /dev/null +++ b/.ansible/skeleton/default/README.md.j2 @@ -0,0 +1,33 @@ +{{ role_name }} +========= + +This will setup {{ role_name }}. + +Requirements +------------ + +~ADJUST~ You will need to have docker, docker-compose and traefik installed or declared as dependencies with their respective roles. + +~ADJUST~ **This role assumes that you have setup traefik with an endpoint called `websecure`.** + +Role Variables +-------------- + +**Please look at the [defaults/main.yml](defaults/main.yml) for all available variables and their description.** + +**Note: Lines that are commented out via `#` are usually still valid/used variables, but they are not defined by default, so they might enable a feature, when uncommenting/defining them!** + +### Global variables, that are used: + +- ~ADJUST~ `proxy_network`: Defined by the local traefik installation, this is the shared proxy network used by traefik to reach the containers. (optional) +- ~ADJUST~ `proxy_hiddenservice`: Defined by the local traefik installation, this is used to generate the alt-svc header for the alternative Tor domain. (optional) + +Dependencies +------------ + +- None + +License +------- + +GPL-3.0-only diff --git a/.ansible/skeleton/default/defaults/main.yml.j2 b/.ansible/skeleton/default/defaults/main.yml.j2 new file mode 100644 index 0000000..1544002 --- /dev/null +++ b/.ansible/skeleton/default/defaults/main.yml.j2 @@ -0,0 +1,18 @@ +--- +# Default variables for the {{ role_name }} role + +# Infrastructure +# Ansible instructions to deploy the infrastructure +# Copyright (C) 2021 Saibotk +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . diff --git a/.ansible/skeleton/default/handlers/main.yml.j2 b/.ansible/skeleton/default/handlers/main.yml.j2 new file mode 100644 index 0000000..27e89a3 --- /dev/null +++ b/.ansible/skeleton/default/handlers/main.yml.j2 @@ -0,0 +1,18 @@ +--- +# Handlers file for the {{ role_name }} role + +# Infrastructure +# Ansible instructions to deploy the infrastructure +# Copyright (C) 2021 Saibotk +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . diff --git a/.ansible/skeleton/default/meta/main.yml.j2 b/.ansible/skeleton/default/meta/main.yml.j2 new file mode 100644 index 0000000..9167b81 --- /dev/null +++ b/.ansible/skeleton/default/meta/main.yml.j2 @@ -0,0 +1,14 @@ +galaxy_info: + author: saibotk + description: Setup {{ role_name }}. + license: GPL-3.0-only + min_ansible_version: 2.9 + + platforms: + - name: CentOS + versions: + - 7 + + galaxy_tags: [] + +dependencies: [] diff --git a/.ansible/skeleton/default/tasks/main.yml.j2 b/.ansible/skeleton/default/tasks/main.yml.j2 new file mode 100644 index 0000000..252501b --- /dev/null +++ b/.ansible/skeleton/default/tasks/main.yml.j2 @@ -0,0 +1,18 @@ +--- +# Tasks file for the {{ role_name }} role + +# Infrastructure +# Ansible instructions to deploy the infrastructure +# Copyright (C) 2021 Saibotk +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . diff --git a/.ansible/skeleton/default/templates/.gitkeep b/.ansible/skeleton/default/templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index ad628d6..a0eed1c 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,16 @@ Run with your local (test) inventory: ansible-playbook -i test.inventory PLAYBOOK.yml ``` +## Create new roles + +When creating new roles, you can set up an initial folder structure with ansible-galaxy and the default skeleton folder structures defined in [.ansible/skeleton](.ansible/skeleton). +For more information check out the Ansible documentation [here](https://docs.ansible.com/ansible/devel/galaxy/dev_guide.html#using-a-custom-role-skeleton) + +``` +cd roles +ansible-galaxy init ROLE_NAME +``` + ## License This repository is licensed under GPL-3 and many roles are derived from the awesome [infrastructure](https://git.shivering-isles.com/shivering-isles/infrastructure) repository published by [Sheogorath](https://shivering-isles.com). diff --git a/ansible.cfg b/ansible.cfg index 706a6aa..c31720e 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -9,3 +9,7 @@ scp_if_ssh = true [privilege_escalation] become_ask_pass = false + +[galaxy] +role_skeleton = ./.ansible/skeleton/default +role_skeleton_ignore = ^.git$,^.*/.git_keep$