From 4d13e3c78f7a0a56438cdfe6ec47f09300ef2e43 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 15 Jun 2020 13:11:44 +0100 Subject: [PATCH] Move requirements files into ansible dir --- dev-requirements.txt => ansible/dev-requirements.txt | 0 requirements.txt => ansible/requirements.txt | 0 yamllint.yml => ansible/yamllint.yml | 6 +++--- scripts/ansible/lint.sh | 8 +++++--- scripts/ansible/setup.sh | 12 ++++++++---- 5 files changed, 16 insertions(+), 10 deletions(-) rename dev-requirements.txt => ansible/dev-requirements.txt (100%) rename requirements.txt => ansible/requirements.txt (100%) rename yamllint.yml => ansible/yamllint.yml (64%) diff --git a/dev-requirements.txt b/ansible/dev-requirements.txt similarity index 100% rename from dev-requirements.txt rename to ansible/dev-requirements.txt diff --git a/requirements.txt b/ansible/requirements.txt similarity index 100% rename from requirements.txt rename to ansible/requirements.txt diff --git a/yamllint.yml b/ansible/yamllint.yml similarity index 64% rename from yamllint.yml rename to ansible/yamllint.yml index 08a7701..9c03796 100644 --- a/yamllint.yml +++ b/ansible/yamllint.yml @@ -2,11 +2,11 @@ extends: default ignore: | galaxy_roles - ansible/group_vars/all/hosts.yml + group_vars/all/hosts.yml rules: - document-start: "disable" - truthy: "disable" + document-start: disable + truthy: disable quoted-strings: quote-type: double required: only-when-needed diff --git a/scripts/ansible/lint.sh b/scripts/ansible/lint.sh index 0cbfff6..7480e92 100755 --- a/scripts/ansible/lint.sh +++ b/scripts/ansible/lint.sh @@ -4,10 +4,12 @@ set -e PATH=${PWD}/env/bin:${PATH} +cd ansible/ + set -x -yamllint -sc yamllint.yml ansible/ +yamllint -sc yamllint.yml . -ansible-lint ansible/main.yml -p -c ansible/.ansible-lint +ansible-lint main.yml -p -c .ansible-lint --exclude galaxy_roles/ -cd ansible/ && ansible-playbook main.yml --syntax-check +ansible-playbook main.yml --syntax-check diff --git a/scripts/ansible/setup.sh b/scripts/ansible/setup.sh index 493c757..eeb0ba6 100755 --- a/scripts/ansible/setup.sh +++ b/scripts/ansible/setup.sh @@ -1,11 +1,15 @@ #!/usr/bin/env bash -set -ex +set -e + +PATH=${PWD}/env/bin:${PATH} + +set -x python -m venv env -env/bin/pip install -r dev-requirements.txt - cd ansible/ -../env/bin/ansible-galaxy install -r galaxy-requirements.yml +pip install -r dev-requirements.txt + +ansible-galaxy install -r galaxy-requirements.yml