Skip to content

Instantly share code, notes, and snippets.

@dcode
Last active March 18, 2019 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcode/4d957a8abea09be3a536bd47e7ffde5a to your computer and use it in GitHub Desktop.
Save dcode/4d957a8abea09be3a536bd47e7ffde5a to your computer and use it in GitHub Desktop.
---
# Mostly working, but weird cartesian products of groups
scenario:
name: single-node # optional
dependency:
name: galaxy
driver:
name: delegated
options:
managed: True
vmware:
network_name: VMNet
datastore: vmstore
datacenter: Datacenter
vcenter_address: vcenter
esxi_hostname: esxi
validate_certs: False
resource_pool: "Resources"
lint:
name: yamllint
platforms:
- name: "${MOLECULE_SCENARIO_NAME}-instance-1"
memory: 16384
cpu: 4
disk_size: 64
template_pattern: '^template-centos-7'
groups:
- rock
- web
- es_masters
- es_data
- es_ingest
- zookeeper
children:
- lighttpd
- sensors
- bro
- fsf
- kafka
- stenographer
- suricata
- suricata_update
- filebeat
- elasticsearch
- docket
- kibana
- logstash
provisioner:
name: ansible
log: True
become: True
env:
ANSIBLE_ROLES_PATH: "${MOLECULE_PROJECT_DIRECTORY}/roles"
options:
extra-vars:
rock_conf_dir: "${MOLECULE_EPHEMERAL_DIRECTORY}/etc"
rock_config: "${MOLECULE_EPHEMERAL_DIRECTORY}/etc/config"
rock_monifs: ["dummy0"]
rock_disable_offline_repo: True
rock_enable_testing: True
es_mem: 8
inventory:
group_vars:
elasticsearch:
node_master: false
node_data: false
node_ingest: false
es_masters:
node_master: true
es_data:
node_data: true
es_ingest:
node_ingest: true
lint:
name: ansible-lint
# config_options:
# defaults:
# roles_path: roles/
verifier:
name: testinfra
lint:
name: flake8
---
# the inventory in provisioner.inventory.hosts doesn't go anywhere
scenario:
name: single-node # optional
dependency:
name: galaxy
driver:
name: delegated
options:
managed: True
vmware:
network_name: VMNet
datastore: vmstore
datacenter: Datacenter
vcenter_address: vcenter
esxi_hostname: esxi
validate_certs: False
resource_pool: "Resources"
lint:
name: yamllint
platforms:
- name: instance-1
memory: 16384
cpu: 4
disk_size: 64
template_pattern: '^template-centos-7'
provisioner:
name: ansible
log: True
become: True
env:
ANSIBLE_ROLES_PATH: "${MOLECULE_PROJECT_DIRECTORY}/roles"
options:
extra-vars:
rock_conf_dir: "${MOLECULE_EPHEMERAL_DIRECTORY}/etc"
rock_config: "${MOLECULE_EPHEMERAL_DIRECTORY}/etc/config"
rock_monifs: ["dummy0"]
rock_disable_offline_repo: True
rock_enable_testing: True
inventory:
hosts:
all:
children:
rock:
hosts:
instance-1:
web:
hosts:
instance-1:
lighttpd:
children:
web:
sensors:
children:
rock:
bro:
children:
sensors:
fsf:
children:
sensors:
kafka:
children:
sensors:
stenographer:
children:
sensors:
suricata:
children:
sensors:
suricata_update:
children:
suricata:
filebeat:
children:
fsf:
suricata:
zookeeper:
hosts:
instance-1:
elasticsearch:
children:
es_masters:
es_data:
es_ingest:
vars:
node_master: false
node_data: false
node_ingest: false
es_masters:
vars:
node_master: true
hosts:
instance-1:
es_data:
vars:
node_data: true
hosts:
instance-1:
es_ingest:
vars:
node_ingest: true
hosts:
instance-1:
docket:
children:
web:
kibana:
children:
web:
logstash:
children:
sensors:
lint:
name: ansible-lint
# config_options:
# defaults:
# roles_path: roles/
verifier:
name: testinfra
lint:
name: flake8
---
# passing this as a link in the hosts inventory also didn't work
all:
children:
rock:
web:
lighttpd:
children:
web:
sensors:
children:
rock:
bro:
children:
sensors:
fsf:
children:
sensors:
kafka:
children:
sensors:
stenographer:
children:
sensors:
suricata:
children:
sensors:
suricata_update:
children:
suricata:
filebeat:
children:
fsf:
suricata:
zookeeper:
hosts:
instance-1:
elasticsearch:
children:
es_masters:
es_data:
es_ingest:
vars:
node_master: false
node_data: false
node_ingest: false
es_masters:
vars:
node_master: true
es_data:
vars:
node_data: true
es_ingest:
vars:
node_ingest: true
docket:
children:
web:
kibana:
children:
web:
logstash:
children:
sensors:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment