diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f8765e8e779768017178872d5417c7563c05713a..ac95d6238a1a57651dca7a7c1d826b68897e343a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,19 @@ +# Copyright 2018-2023 Chris Croome +# +# This file is part of the Webarchitects MariaDB Ansible role. +# +# The Webarchitects MariaDB Ansible role 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, either version 3 of the License, or (at your option) any later version. +# +# The Webarchitects MariaDB Ansible role 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 the Webarchitects MariaDB Ansible role. If not, see <https://www.gnu.org/licenses/>. --- -image: registry.git.coop/webarch/containers/images/ansible:0.23.0 +image: registry.git.coop/webarch/containers/images/ansible:0.24.0 variables: - PY_COLORS: "1" + ANSIBLE_DEFAULT_VERBOSITY: "2" + ANSIBLE_DIFF_ALWAYS: "1" ANSIBLE_FORCE_COLOR: "1" + PY_COLORS: "1" before_script: - chmod 700 $(pwd) stages: @@ -10,6 +21,5 @@ stages: lint: stage: lint script: - - molecule lint -# vim: syntax=yaml + - molecule converge ... diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60df15a7fdc915c2f85227326823af7aec1bd7db..cae5906c755ac5c738132a16b29075abd0f22251 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,18 @@ +# Copyright 2018-2023 Chris Croome +# +# This file is part of the Webarchitects MariaDB Ansible role. +# +# The Webarchitects MariaDB Ansible role 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, either version 3 of the License, or (at your option) any later version. +# +# The Webarchitects MariaDB Ansible role 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 the Webarchitects MariaDB Ansible role. If not, see <https://www.gnu.org/licenses/>. --- # https://yamllint.readthedocs.io/en/stable/integration.html # https://github.com/adrienverge/yamllint/tags repos: - repo: https://github.com/adrienverge/yamllint.git - rev: v1.31.0 + rev: v1.32.0 hooks: - id: yamllint ... diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml new file mode 100644 index 0000000000000000000000000000000000000000..37e48b76b0d0811890ddfcda45e8c0c6dfe1ce90 --- /dev/null +++ b/molecule/default/converge.yml @@ -0,0 +1,39 @@ +# Copyright 2018-2023 Chris Croome +# +# This file is part of the Webarchitects MariaDB Ansible role. +# +# The Webarchitects MariaDB Ansible role 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, either version 3 of the License, or (at your option) any later version. +# +# The Webarchitects MariaDB Ansible role 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 the Webarchitects MariaDB Ansible role. If not, see <https://www.gnu.org/licenses/>. +--- +- name: Lint + become: false + connection: local + gather_facts: false + hosts: + - localhost + tasks: + + - name: Check Jinja2 syntax + ansible.builtin.command: find -type f -name '*.j2' -exec ansiblej2lint.py {} + + check_mode: false + args: + chdir: ../.. + changed_when: false + + - name: YAML lint + ansible.builtin.command: yamllint -f colored -c .yamllint . + check_mode: false + args: + chdir: ../.. + changed_when: false + + - name: Ansible lint + ansible.builtin.command: ansible-lint -c .ansible-lint --force-color . + check_mode: false + args: + chdir: ../.. + changed_when: false +... diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index ce086fbd60760a174817a4f1ba92f046a1a21269..e7f64a48a6a0a0aaccf19fa449ba1ccb2ab742ee 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -1,16 +1,19 @@ +# Copyright 2018-2023 Chris Croome +# +# This file is part of the Webarchitects MariaDB Ansible role. +# +# The Webarchitects MariaDB Ansible role 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, either version 3 of the License, or (at your option) any later version. +# +# The Webarchitects MariaDB Ansible role 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 the Webarchitects MariaDB Ansible role. If not, see <https://www.gnu.org/licenses/>. --- dependency: name: galaxy platforms: - name: instance - image: registry.git.coop/webarch/containers/images/ansible:0.23.0 - pre_build_image: true provisioner: name: ansible -lint: | - set -e - find -type f -name '*.j2' -exec ansiblej2lint.py {} + - yamllint -f colored -c .yamllint . - ansible-lint -c .ansible-lint --force-color . -# vim: syntax=yaml +verifier: + name: ansible ... diff --git a/tasks/main.yml b/tasks/main.yml index e674f3bc72cac4b5a9485cf71b9b6eafbe9d7748..462725f1ab904a5065203e2a8bb4b32f63a9b56a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,6 +8,13 @@ # # You should have received a copy of the GNU General Public License along with the Webarchitects MariaDB Ansible role. If not, see <https://www.gnu.org/licenses/>. --- +- name: Skip the tasks in this role + ansible.builtin.debug: + msg: "The MariaDB role tasks are not being run since the mariadb variable is false." + when: not mariadb | bool + tags: + - mariadb + - name: MariaDB block: