From da1511e2e48c27255300b01fe9df431d3744ba69 Mon Sep 17 00:00:00 2001 From: Ansible Roles <> Date: Sat, 24 Jun 2023 15:44:22 +0000 Subject: [PATCH] Initial commit --- .ansible-lint | 8 +++++++ .gitignore | 3 +++ .yamllint | 40 ++++++++++++++++++++++++++++++++ LICENSE | 20 ++++++++++++++++ README.md | 43 +++++++++++++++++++++++++++++++++++ defaults/main.yml | 2 ++ files/.gitkeep | 0 handlers/main.yml | 2 ++ meta/main.yml | 25 ++++++++++++++++++++ molecule/default/converge.yml | 7 ++++++ molecule/default/molecule.yml | 37 ++++++++++++++++++++++++++++++ molecule/default/verify.yml | 19 ++++++++++++++++ tasks/main.yml | 2 ++ templates/.gitkeep | 0 vars/main.yml | 2 ++ 15 files changed, 210 insertions(+) create mode 100644 .ansible-lint 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 files/.gitkeep create mode 100644 handlers/main.yml create mode 100644 meta/main.yml create mode 100644 molecule/default/converge.yml create mode 100644 molecule/default/molecule.yml create mode 100644 molecule/default/verify.yml create mode 100644 tasks/main.yml create mode 100644 templates/.gitkeep create mode 100644 vars/main.yml diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..0d93798 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,8 @@ +--- +warn_list: + - experimental # all rules tagged as experimental + - yaml # violations reported by yamllint + - meta-no-info + +skip_list: + - jinja[spacing] # Rule that looks inside jinja2 templates. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bccf235 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# ignore molecule/testinfra pycache +**/__pycache__ +.vscode \ No newline at end of file diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..24fdec5 --- /dev/null +++ b/.yamllint @@ -0,0 +1,40 @@ +--- +# Based on ansible-lint config +extends: default + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + colons: + max-spaces-after: -1 + level: error + commas: + max-spaces-after: -1 + level: error + comments: enable + comments-indentation: disable + document-start: enable + empty-lines: + max: 3 + level: error + hyphens: + level: error + indentation: enable + key-duplicates: enable + line-length: + max: 80 + level: warning + new-line-at-end-of-file: enable + new-lines: + type: unix + trailing-spaces: enable + truthy: + allowed-values: + - 'true' + - 'false' + - 'yes' + - 'no' diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c9a37e5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2017 Bertrand Lanson + +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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1ba1191 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +deploy_gitea_runner +========= + +A brief description of the role goes here. + +Requirements +------------ + +None. + +Role Variables +-------------- +Available variables are listed below, along with default values. A sample file for the default values is available in `default/deploy_gitea_runner.yml.sample` in case you need it for any `group_vars` or `host_vars` configuration. + +```yaml +your_defaults_here: default_value # by default, set to default_value +``` +A quick description of the variable, what it does, and how to use it. + +Dependencies +------------ + +None. + +Example Playbook +---------------- + +```yaml +# calling the role inside a playbook with either the default or group_vars/host_vars +- hosts: servers + roles: + - ednxzu.deploy_gitea_runner +``` + +License +------- + +MIT / BSD + +Author Information +------------------ + +This role was created by Bertrand Lanson in 2023. \ No newline at end of file diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..b625f4f --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for deploy_gitea_runner diff --git a/files/.gitkeep b/files/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..9856457 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for deploy_gitea_runner diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..28e0f94 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,25 @@ +--- +# meta file for deploy_adguard +galaxy_info: + namespace: 'ednxzu' + role_name: 'deploy_gitea_runner' + author: 'Bertrand Lanson' + description: '' + license: 'license (BSD, MIT)' + min_ansible_version: '2.10' + platforms: + - name: Ubuntu + versions: + - focal + - jammy + - name: Debian + versions: + - bullseye + galaxy_tags: + - 'ubuntu' + - 'debian' + - 'adguard' + - 'adblock' + - 'docker' + +dependencies: [] diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml new file mode 100644 index 0000000..ea9f7d8 --- /dev/null +++ b/molecule/default/converge.yml @@ -0,0 +1,7 @@ +--- +- name: Converge + hosts: all + tasks: + - name: "Include ednxzu.deploy_gitea_runner" + ansible.builtin.include_role: + name: "ednxzu.deploy_gitea_runner" diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml new file mode 100644 index 0000000..49efc7f --- /dev/null +++ b/molecule/default/molecule.yml @@ -0,0 +1,37 @@ +--- +dependency: + name: galaxy + options: + requirements-file: ./requirements.yml +driver: + name: docker +platforms: + - name: instance + image: geerlingguy/docker-${MOLECULE_TEST_OS}-ansible + command: "" + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup + cgroupns_mode: host + privileged: true + pre_build_image: true +provisioner: + name: ansible + config_options: + defaults: + remote_tmp: /tmp/.ansible +verifier: + name: ansible +scenario: + name: default + test_sequence: + - dependency + - cleanup + - destroy + - syntax + - create + - prepare + - converge + - idempotence + - verify + - cleanup + - destroy diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml new file mode 100644 index 0000000..bf52da2 --- /dev/null +++ b/molecule/default/verify.yml @@ -0,0 +1,19 @@ +--- +- name: Verify + hosts: all + gather_facts: false + tasks: + - name: "Test: file /etc/hosts" + block: + - name: "Stat file /etc/hosts" + ansible.builtin.stat: + path: "/etc/hosts" + register: stat_etc_hosts + + - name: "Verify file /etc/hosts" + ansible.builtin.assert: + that: + - stat_etc_hosts.stat.exists + - stat_etc_hosts.stat.isreg + - stat_etc_hosts.stat.pw_name == 'root' + - stat_etc_hosts.stat.gr_name == 'root' diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..7aa1552 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# task/main file for deploy_gitea_runner diff --git a/templates/.gitkeep b/templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..72d482f --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for deploy_gitea_runner