From 13b73337fa97454c186b1b678c0baab22febe10a Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 10 Nov 2022 00:12:22 +0100 Subject: [PATCH] Initial commit --- .github/FUNDING.yml | 6 + .github/galaxy.svg | 351 ++++++++++++++++++++ .github/license.svg | 217 ++++++++++++ .github/workflows/ansible-linting-check.yml | 23 ++ .github/workflows/yamllint.yaml | 23 ++ .gitignore | 2 + .yamllint | 8 + LICENSE | 21 ++ README.md | 7 + defaults/main.yml | 3 + tasks/main.yml | 4 + tasks/versioncheck.yml | 45 +++ vars/main.yml | 4 + 13 files changed, 714 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/galaxy.svg create mode 100644 .github/license.svg create mode 100644 .github/workflows/ansible-linting-check.yml create mode 100644 .github/workflows/yamllint.yaml create mode 100644 .gitignore create mode 100644 .yamllint create mode 100644 LICENSE create mode 100644 README.md create mode 100644 defaults/main.yml create mode 100644 tasks/main.yml create mode 100644 tasks/versioncheck.yml create mode 100644 vars/main.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..8f96dfd --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,6 @@ +--- +# Feel free to add yourself if you maintain this repo +# or participate in a way that you have the feeling that you belong there ;-) + +github: [do1jlr] +liberapay: L3D diff --git a/.github/galaxy.svg b/.github/galaxy.svg new file mode 100644 index 0000000..80490fd --- /dev/null +++ b/.github/galaxy.svg @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.github/license.svg b/.github/license.svg new file mode 100644 index 0000000..4ab6d9a --- /dev/null +++ b/.github/license.svg @@ -0,0 +1,217 @@ + + + + + + image/svg+xml + + + + + + 3D <l3d@c3woc.de> + + + + + MIT License + + + + + + + + + + + + + + + + + + + + + + + + + + + MIT + MIT + + + license + license + + diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml new file mode 100644 index 0000000..150e908 --- /dev/null +++ b/.github/workflows/ansible-linting-check.yml @@ -0,0 +1,23 @@ +--- +name: Ansible Lint check + +# yamllint disable-line rule:truthy +on: + push: + branches: '*' + pull_request: + branches: '*' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: 'checkout git repo' + uses: actions/checkout@v3 + + - name: 'Lint Ansible Playbook' + uses: ansible/ansible-lint-action@v6 + with: + targets: "." diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml new file mode 100644 index 0000000..d744e9c --- /dev/null +++ b/.github/workflows/yamllint.yaml @@ -0,0 +1,23 @@ +--- +name: 'Yamllint GitHub Actions' + +# yamllint disable-line rule:truthy +on: + push: + branches: '*' + pull_request: + branches: '*' + +jobs: + yamllint: + name: 'Yamllint' + runs-on: ubuntu-latest + steps: + - name: 'checkout git repo' + uses: actions/checkout@v3 + + - name: 'Yamllint' + uses: karancode/yamllint-github-action@v2.0.0 + with: + yamllint_file_or_dir: '.' + yamllint_config_filepath: './.yamllint' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f93e3ae --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Ansible-Linting +.cache diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..cb32cb1 --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + # 150 chars should be enough, but don't fail if a line is longer + line-length: + max: 150 + level: warning diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..393d97b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 L3D + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..64970a9 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ + Ansible role EteBase - EteSync 2.0 Server Backend +=================================================== +Ansible role to Setup and Confugure Etebase - The Backend from EteSync 2.0 -> https://github.com/etesync/server + +``` +WORK IN PROGRESS!!! +``` diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..c8d9a89 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# should we do a version check? (recomended) +submodules_versioncheck: false diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..f188539 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- name: Run optional versionscheck + ansible.builtin.include_tasks: versioncheck.yml + when: submodules_versioncheck | bool diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml new file mode 100644 index 0000000..dd22a1a --- /dev/null +++ b/tasks/versioncheck.yml @@ -0,0 +1,45 @@ +--- +# Copyright (c) 2021 L3D +# this file is released with the MIT license. +# License: https://github.com/roles-ansible/ansible_role_template/blob/main/LICENSE +- name: Create directory for versionscheck + become: true + ansible.builtin.file: + path: '/etc/.ansible-version' + state: directory + mode: 0755 + when: submodules_versioncheck | bool + +- name: Check playbook version + become: true + ansible.builtin.slurp: + src: "/etc/.ansible-version/{{ playbook_version_path }}" + register: playbook_version + when: submodules_versioncheck | bool + ignore_errors: true + failed_when: false + +- name: Print remote role version + ansible.builtin.debug: + msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" + when: submodules_versioncheck | bool + +- name: Print locale role version + ansible.builtin.debug: + msg: "Local role version: '{{ playbook_version_number | string }}'." + when: submodules_versioncheck | bool + +- name: Check if your version is outdated + ansible.builtin.fail: + msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!" + when: + - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck | bool + +- name: Write new version to remote disk + become: true + ansible.builtin.copy: + content: "{{ playbook_version_number }}" + dest: "/etc/.ansible-version/{{ playbook_version_path }}" + mode: '0644' + when: submodules_versioncheck | bool + tags: skip_ansible_lint_template-instead-of-copy diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..bf4b0d9 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,4 @@ +--- +# versionscheck +playbook_version_number: 02 # should be a integer +playbook_version_path: 'role-.version'