From cfd05980682cae03e92e01b6885a11c2cad917fa Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 29 May 2021 16:44:07 +0200 Subject: [PATCH] fix: fix formatting --- .../molecule/requirements.yml | 4 +++- .../create.yml | 6 +++--- .../destroy.yml | 6 +++--- .../molecule.yml | 2 ++ .../tests/test_default.py | 6 ++---- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/requirements.yml b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/requirements.yml index 280de95..46da115 100644 --- a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/requirements.yml +++ b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/requirements.yml @@ -1,4 +1,6 @@ --- collections: - - name: https://gitea.rknet.org/ansible/xoxys.general/releases/download/v1.2.0/xoxys-general-1.2.0.tar.gz + - name: https://gitea.rknet.org/ansible/xoxys.general/releases/download/v2.1.1/xoxys-general-2.1.1.tar.gz - name: community.general + +roles: [] diff --git a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/create.yml b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/create.yml index d7e397a..3465917 100644 --- a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/create.yml +++ b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/create.yml @@ -1,4 +1,4 @@ -{% raw %} +{%- raw -%} --- - name: Create hosts: localhost @@ -104,7 +104,7 @@ content: | # Molecule managed - {{ instance_conf | to_json | from_json | to_yaml }} + {{ instance_conf | to_nice_yaml(indent=2) }} dest: "{{ molecule_instance_config }}" when: server.changed | bool @@ -119,4 +119,4 @@ - name: Wait for VM to settle down pause: seconds: 30 -{% endraw %} +{%- endraw -%} diff --git a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/destroy.yml b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/destroy.yml index c59c136..31b3b9b 100644 --- a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/destroy.yml +++ b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/destroy.yml @@ -1,4 +1,4 @@ -{% raw %} +{%- raw -%} --- - name: Destroy hosts: localhost @@ -74,7 +74,7 @@ content: | # Molecule managed - {{ instance_conf | to_json | from_json | to_yaml }} + {{ instance_conf | to_nice_yaml(indent=2) }} dest: "{{ molecule_instance_config }}" when: server.changed | bool -{% endraw %} +{%- endraw -%} diff --git a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/molecule.yml b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/molecule.yml index 4297ed2..4a9f631 100644 --- a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/molecule.yml +++ b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/molecule.yml @@ -3,6 +3,7 @@ dependency: name: galaxy options: role-file: molecule/requirements.yml + requirements-file: molecule/requirements.yml env: ANSIBLE_GALAXY_DISPLAY_PROGRESS: "false" driver: @@ -18,5 +19,6 @@ provisioner: env: ANSIBLE_FILTER_PLUGINS: ${ANSIBLE_FILTER_PLUGINS:-./plugins/filter} ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-./library} + log: False verifier: name: testinfra diff --git a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/tests/test_default.py b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/tests/test_default.py index 7339d3f..20e114b 100644 --- a/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/tests/test_default.py +++ b/{{cookiecutter.author}}.{{cookiecutter.role_name}}/molecule/{{cookiecutter.molecule_scenario|replace('-', '')}}/tests/test_default.py @@ -1,11 +1,9 @@ import os +import warnings import testinfra.utils.ansible_runner -import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - + os.environ["MOLECULE_INVENTORY_FILE"]).get_hosts("all")