possible solution for ansible variables access and improving Pipefile

This commit is contained in:
Rshad Zhran 2019-08-22 13:07:39 +02:00
parent defd2ab2f8
commit 675e2c5c88
5 changed files with 54 additions and 9 deletions

13
Pipfile
View File

@ -14,12 +14,13 @@ molecule = "==2.20.2"
python_version = "2.7"
[scripts]
test ="molecule test --destroy=never"
worker ="molecule test -s worker --destroy=never"
agent ="molecule test -s wazuh-agent --destroy=never"
elasticsearch ="molecule test -s elasticsearch --destroy=never"
kibana ="molecule test -s kibana --destroy=never"
test ="molecule test --destroy=never --platform _PLATFORM_"
worker ="molecule test -s worker --destroy=never --platform _PLATFORM_"
agent ="molecule test -s wazuh-agent --destroy=never --platform _PLATFORM_"
elasticsearch ="molecule test -s elasticsearch --destroy=never --platform _PLATFORM_"
kibana ="molecule test -s kibana --destroy=never --platform _PLATFORM_"
# Destroy all the existing containers ' Created by Molecule '
# Destroy all the existing containers ' Molecule instances '
destroy_elasticsearch ="molecule destroy -s elasticsearch"
destroy_worker ="molecule destroy -s worker"
destroy ="molecule destroy"

26
Pipfile.template Normal file
View File

@ -0,0 +1,26 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
docker-py = "*"
ansible = "==2.7.13"
molecule = "==2.20.2"
[dev-packages]
[requires]
python_version = "2.7"
[scripts]
test ="molecule test --destroy=never"
worker ="molecule test -s worker --destroy=never"
agent ="molecule test -s wazuh-agent --destroy=never"
elasticsearch ="molecule test -s elasticsearch --destroy=never"
kibana ="molecule test -s kibana --destroy=never"
# Destroy all the existing containers ' Created by Molecule '
destroy_elasticsearch ="molecule destroy -s elasticsearch"
destroy_worker ="molecule destroy -s worker"
destroy ="molecule destroy"

View File

@ -2,6 +2,8 @@
- name: Converge
hosts: all
roles:
- role: wazuh/ansible-wazuh-manager
- { role: wazuh/ansible-wazuh-manager,
wazuh_manager_config[cluster][disable]: 'no',
}
- { role: wazuh/ansible-filebeat, filebeat_output_elasticsearch_hosts: 'elasticsearch:9200' }

View File

@ -9,7 +9,7 @@ lint:
config-data:
ignore: .virtualenv
platforms:
- name: elasticsearch
- name: worker
image: solita/ubuntu-systemd:bionic
command: /sbin/init
ulimits:
@ -54,6 +54,22 @@ provisioner:
lint:
name: ansible-lint
enabled: true
scenario:
name: worker
test_sequence:
- lint
- dependency
- cleanup
- destroy
- syntax
- create
- prepare
- converge
#- idempotence
- side_effect
- verify
- cleanup
- destroy
verifier:
name: testinfra
lint:

View File

@ -1,5 +1,5 @@
#!/bin/bash
#sudo pipenv run elasticsearch
sudo pipenv run elasticsearch
sudo pipenv run test
sudo pipenv run worker