Last active
January 15, 2021 13:52
-
-
Save geerlingguy/19aace82f94b2d07a0dfb23db7345a57 to your computer and use it in GitHub Desktop.
Revisions
-
geerlingguy revised this gist
Feb 24, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,7 @@ exit 1 export LINT_STRING="lint: | set -e yamllint . ansible-lint" -
geerlingguy created this gist
Feb 21, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ #!/bin/bash # # Update things to be compatible with Molecule 3.0. # # This script is NOT idempotent, and should never be run again. exit 1 export LINT_STRING="lint: | yamllint . ansible-lint" # Loop through all directories starting with "geerlingguy". for dir in ./geerlingguy*/ do # cd into role directory. cd "$dir" # Change string `pip install molecule` to `pip install molecule yamllint ansible-lint` in .travis.yml sed -i '' 's/pip install molecule docker/pip install molecule yamllint ansible-lint docker/g' .travis.yml # Change and remove strings in molecule.yml sed -i '' '/[ ][ ]name: yamllint/d' molecule/default/molecule.yml sed -i '' '/[ ][ ]options:/d' molecule/default/molecule.yml sed -i '' '/[ ][ ][ ][ ]config-file:.*/d' molecule/default/molecule.yml sed -i '' 's/-playbook.yml/-converge.yml/g' molecule/default/molecule.yml sed -i '' '/[ ][ ]lint:/d' molecule/default/molecule.yml sed -i '' '/[ ][ ][ ][ ]name: ansible-lint/d' molecule/default/molecule.yml sed -i '' '/verifier:/d' molecule/default/molecule.yml sed -i '' '/[ ][ ]name: testinfra/d' molecule/default/molecule.yml sed -i '' '/[ ][ ][ ][ ]name: flake8/d' molecule/default/molecule.yml # Update lint block in molecule.yml file. perl -i -pe 's/lint:/$ENV{"LINT_STRING"}/g' molecule/default/molecule.yml # Move file `molecule/default/yaml-lint.yml` to `.yamllint` (if exists). if [ -f molecule/default/yaml-lint.yml ]; then mv molecule/default/yaml-lint.yml .yamllint fi # Move file `molecule/default/playbook.yml` to `molecule/default/converge.yml` (if exists). if [ -f molecule/default/playbook.yml ]; then mv molecule/default/playbook.yml molecule/default/converge.yml fi # cd back to parent directory. cd .. done