commit ce54cf1f4c0927a7f195b1df0a6f95b33f87ded7 Author: Jake Howard Date: Sun Dec 8 11:58:43 2019 +0000 Init ansible workflow diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..17d7028 --- /dev/null +++ b/.gitignore @@ -0,0 +1,114 @@ + +# Created by https://www.gitignore.io/api/python,ansible +# Edit at https://www.gitignore.io/?templates=python,ansible + +### Ansible ### +*.retry + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# End of https://www.gitignore.io/api/python,ansible +env/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..2b4e5f6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Infrastructure diff --git a/ansible/.ansible-lint b/ansible/.ansible-lint new file mode 100644 index 0000000..7782652 --- /dev/null +++ b/ansible/.ansible-lint @@ -0,0 +1,4 @@ +skip_list: + - 305 + - 401 + - 301 diff --git a/ansible/hosts b/ansible/hosts new file mode 100644 index 0000000..e69de29 diff --git a/ansible/main.yml b/ansible/main.yml new file mode 100644 index 0000000..e69de29 diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..ad8c82e --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,3 @@ +-r requirements.txt +ansible-lint==4.2.0 +yamllint==1.19.0 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b2810f7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +ansible==2.9.2 diff --git a/scripts/ansible.sh b/scripts/ansible.sh new file mode 100755 index 0000000..d20015d --- /dev/null +++ b/scripts/ansible.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +PATH=env/bin:${PATH} + +ansible-playbook -i ansible/hosts ansible/main.yml diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 0000000..7808c43 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e + +PATH=env/bin:${PATH} + +set -x + +yamllint -sc yamllint.yml yamllint.yml ansible/ + +ansible-lint ansible/main.yml -p -c ansible/.ansible-lint + +ansible-playbook -i ansible/hosts ansible/main.yml --syntax-check diff --git a/yamllint.yml b/yamllint.yml new file mode 100644 index 0000000..aa6adf7 --- /dev/null +++ b/yamllint.yml @@ -0,0 +1,6 @@ +extends: default + +rules: + document-start: "disable" + line-length: + max: 150