-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
74 lines (60 loc) · 2.69 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
pep8:
pycodestyle --first ./library/venafi_certificate.py
yamllint:
yamllint `git ls-files *.yml | grep -v ISSUE_TEMPLATE`
lint: yamllint pep8
ansible-lint -x 106,204,504 ./tasks/*
ansible-lint ./meta/*
ansible-lint ./defaults/*
ansible-molecule:
docker build ./tests --tag local-ansible-test
ANSIBLE_VAULT_PASSWORD_FILE=${PWD}/vault-password.txt molecule converge
#Testing ansible crypto modules for examples and compability checks
test-crypto-playbook:
ansible-playbook -i tests/inventory tests/original-ansible-crypto-playbook-example.yml
#test Ansible playbook with venafi certificate module
test-vcert-playbook-tpp:
# #have to copy library to test our module, otherwise test playbook will not
docker build ./tests --tag local-ansible-test
rm -rvf tests/library
cp -rv library tests/
ansible-playbook -i tests/inventory tests/venafi-playbook-example.yml \
--vault-password-file vault-password.txt \
--extra-vars "credentials_file=../tpp_credentials.yml docker_demo=true"
#test Ansible role with venafi_Certificate module
test-vcert-role-tpp:
# #have to copy library to test our module, otherwise test playbook will not
docker build ./tests --tag local-ansible-test
rm -rvf tests/library
cp -rv library tests/
ansible-playbook -i tests/inventory tests/venafi-role-playbook-example.yml \
--vault-password-file vault-password.txt \
--extra-vars "credentials_file=tpp_credentials.yml docker_demo=true"
test-vcert-role-cloud:
# #have to copy library to test our module, otherwise test playbook will not
docker build ./tests --tag local-ansible-test
rm -rvf tests/library
cp -rv library tests/
ansible-playbook -i tests/inventory tests/venafi-role-playbook-example.yml \
--vault-password-file vault-password.txt \
--extra-vars "credentials_file=cloud_credentials.yml docker_demo=true"
test-vcert-role-fake:
# #have to copy library to test our module, otherwise test playbook will not
docker build ./tests --tag local-ansible-test
rm -rvf tests/library
cp -rv library tests/
ansible-playbook -i tests/inventory tests/venafi-role-playbook-example.yml \
--vault-password-file vault-password.txt \
--extra-vars "credentials_file=fake_credentials.yml docker_demo=true"
#test module with python using json for args
test-python-module: test-python-module-fake test-python-module-tpp test-python-module-cloud
test-python-module-tpp:
python3 library/venafi_certificate.py venafi_certificate_tpp.json
test-python-module-fake:
python3 ./library/venafi_certificate.py venafi_certificate_fake.json
test-python-module-cloud:
python3 ./library/venafi_certificate.py venafi_certificate_cloud.json
unit-test:
rm -rvf tests/library
cp -rv library tests/
PYTHONPATH=./:$PYTHONPATH pytest tests/test_venafi_certificate.py