Skip to content

Commit

Permalink
fix lint ci issue
Browse files Browse the repository at this point in the history
  • Loading branch information
audgirka committed Aug 2, 2023
1 parent 2510322 commit 880ced6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
test/gce/scenarios/linux/molecule.yml yaml[line-length]
test/gce/scenarios/windows/molecule.yml yaml[line-length]
test/roles/ec2plugin/molecule/default/create.yml no-handler

test/roles/vagrantplugin/molecule/default/destroy.yml yaml[octal-values]
test/roles/vagrantplugin/molecule/default/create.yml yaml[octal-values]
test/roles/podmanplugin/molecule/default/destroy.yml yaml[octal-values]
test/roles/podmanplugin/molecule/default/create.yml yaml[octal-values]
test/roles/gceplugin/molecule/default/destroy.yml yaml[octal-values]
test/roles/gceplugin/molecule/default/create.yml yaml[octal-values]
test/roles/ec2plugin/molecule/default/destroy.yml yaml[octal-values]
test/roles/ec2plugin/molecule/default/create.yml yaml[octal-values]
test/roles/dockerplugin/molecule/default/destroy.yml yaml[octal-values]
test/roles/dockerplugin/molecule/default/create.yml yaml[octal-values]
test/roles/containersplugin/molecule/default/destroy.yml yaml[octal-values]
test/roles/containersplugin/molecule/default/create.yml yaml[octal-values]
test/roles/azureplugin/molecule/default/create.yml yaml[octal-values]
test/roles/azureplugin/molecule/default/destroy.yml yaml[octal-values]
11 changes: 8 additions & 3 deletions tools/generate-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@ while IFS='' read -r line; do DRIVER_NAMES+=("$line"); done < <(python "tools/ex

cd test/roles
for DRIVER_NAME in "${DRIVER_NAMES[@]}"; do
molecule init role roles."${DRIVER_NAME}"plugin --driver-name="${DRIVER_NAME}"
ansible-galaxy role init "${DRIVER_NAME}"plugin
cd "${DRIVER_NAME}"plugin
ansible localhost -o -m lineinfile -a 'path=meta/main.yml line=" namespace: roles" insertafter=" author: your name"'
molecule init scenario --driver-name="${DRIVER_NAME}"
sed \
-e 's!author:.*!author: molecule-plugins!g' \
-e 's!namespace:.*!namespace: roles!g' \
-e 's!company:.*!company: ansible-community!g' \
-e 's!min_ansible_version:.*!min_ansible_version: "2.1"!g' \
-e 's!license:.*!license: MIT!g' \
-i "${DRIVER_NAME}"plugin/meta/main.yml
-i meta/main.yml
# Not sure if the issue is in molecule or ansible-lint or pre-commit ansible-lint hook
# As a workaround, kill the offending files.
rm -rf "${DRIVER_NAME}"plugin/tests
rm -rf tests
cd ..
done

exit 0

0 comments on commit 880ced6

Please sign in to comment.