From dce1616e9a36617467ba31044ca3daf998aac4d5 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Fri, 6 Dec 2019 16:40:42 +0100 Subject: [PATCH] Add ansible managed header. --- templates/README.md.j2 | 2 +- templates/ansible-lint.j2 | 13 +++++++++++++ templates/molecule.yml.j2 | 1 + templates/settings.yml.j2 | 1 + templates/tox.ini.j2 | 1 + templates/travis.yml.j2 | 1 + 6 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 templates/ansible-lint.j2 diff --git a/templates/README.md.j2 b/templates/README.md.j2 index 86f812b..e59ca79 100644 --- a/templates/README.md.j2 +++ b/templates/README.md.j2 @@ -12,7 +12,7 @@ Example Playbook This example is taken from `molecule/resources/playbook.yml` and is tested on each push, pull request and release. ```yaml -{{ example.content | b64decode | regex_replace('ansible-role-', galaxy_namespace) }}``` +{{ example.content | b64decode | regex_replace('ansible-role-', galaxy_namespace ~ '.') }}``` The machine you are running this on, may need to be prepared, I use this playbook to ensure everything is in place to let the role work. ```yaml diff --git a/templates/ansible-lint.j2 b/templates/ansible-lint.j2 new file mode 100644 index 0000000..4073642 --- /dev/null +++ b/templates/ansible-lint.j2 @@ -0,0 +1,13 @@ +{{ ansible_managed | comment }} +{% if versionymlstat.stat.exists or exceptionymlstat.stat.exists or preferencesymlstat.stat.exists %} +exclude_paths: +{% if versionymlstat.stat.exists %} + - ./meta/version.yml +{% endif %} +{% if exceptionymlstat.stat.exists %} + - ./meta/exception.yml +{% endif %} +{% if preferencesymlstat.stat.exists %} + - ./meta/preferences.yml +{% endif %} +{% endif %} diff --git a/templates/molecule.yml.j2 b/templates/molecule.yml.j2 index 46c9a07..b695f23 100644 --- a/templates/molecule.yml.j2 +++ b/templates/molecule.yml.j2 @@ -1,4 +1,5 @@ --- +{{ ansible_managed | comment }} dependency: name: galaxy options: diff --git a/templates/settings.yml.j2 b/templates/settings.yml.j2 index ab5030f..efd11f8 100644 --- a/templates/settings.yml.j2 +++ b/templates/settings.yml.j2 @@ -1,4 +1,5 @@ --- +{{ ansible_managed | comment }} repository: description: {{ meta.galaxy_info.description }} homepage: {{ author_website }} diff --git a/templates/tox.ini.j2 b/templates/tox.ini.j2 index 86cea95..a87baf1 100644 --- a/templates/tox.ini.j2 +++ b/templates/tox.ini.j2 @@ -1,3 +1,4 @@ +{{ ansible_managed | comment }} [tox] minversion = 3.7 {% if tox_versions is defined %} diff --git a/templates/travis.yml.j2 b/templates/travis.yml.j2 index 30af979..ac9a30b 100644 --- a/templates/travis.yml.j2 +++ b/templates/travis.yml.j2 @@ -1,4 +1,5 @@ --- +{{ ansible_managed | comment }} language: python python: