-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.yaml
61 lines (54 loc) · 1.81 KB
/
site.yaml
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
---
- hosts: all
vars:
ansible_python_interpreter: /usr/bin/env python3
roles:
- prereqs
- hosts: chn_server
vars:
ansible_python_interpreter: /usr/bin/env python3
tasks:
- name: Include CHN Server role
include_role:
name: chn-server
- name: Extract Deploy key
shell: docker exec chnserver awk '/DEPLOY_KEY/' /opt/config.py | awk -F ' = ' '{print $2}' | sed -e "s/'//g"
register: chn_deploy_key_extract
changed_when: false
- name: Write deploy key to a local tempfile
ini_file:
path: "/tmp/chn-deploy.ini"
section: 'default'
option: 'deploy_key'
value: "{{ chn_deploy_key_extract.stdout }}"
delegate_to: localhost
- hosts: cowrie_server
vars:
ansible_python_interpreter: /usr/bin/env python3
tasks:
- name: Lookup deploy key
set_fact:
saved_chn_deploy_key: "{{ lookup('ini', 'deploy_key section=default file=/tmp/chn-deploy.ini' ) }}"
delegate_to: localhost
- name: Include Cowrie
include_role:
name: cowrie
vars:
chn_deploy_key: "{{ saved_chn_deploy_key }}"
hpfeeds_server: "{{ internal_chn_ip }}"
chn_server: "http://{{ internal_chn_ip }}"
- hosts: dionaea_server
vars:
ansible_python_interpreter: /usr/bin/env python3
tasks:
- name: Lookup deploy key
set_fact:
saved_chn_deploy_key: "{{ lookup('ini', 'deploy_key section=default file=/tmp/chn-deploy.ini' ) }}"
delegate_to: localhost
- name: Include Dionaea
include_role:
name: dionaea
vars:
chn_deploy_key: "{{ saved_chn_deploy_key }}"
chn_server: "http://{{ internal_chn_ip }}"
hpfeeds_server: "{{ internal_chn_ip }}"