Moe network monitor services and provisioning

pull/747/head
Kieran Prasch 2019-02-12 14:39:00 -08:00 committed by Kieran R. Prasch
parent ad5da13cd9
commit c7fc036bd3
2 changed files with 7 additions and 4 deletions

View File

@ -8,6 +8,9 @@
raw: sudo apt -y update && sudo apt install -y python2.7-minimal python2.7-setuptools
- include_vars: "{{ lookup('env', 'ANSIBLE_VARIABLES') }}"
vars:
networks_file: "{{ lookup('file', '../../networks.json') | from_json }}"
tasks:
- name: "Install System Dependencies"
become: yes
@ -48,7 +51,6 @@
shell: 'iptables -A INPUT -p tcp -m conntrack --dport {{ moe_http_port }} --ctstate NEW,ESTABLISHED -j ACCEPT'
vars:
moe_http_port: 12500
teacher: "{{ hostvars[groups['tag_Role_' + lookup('env', 'NUCYPHER_NETWORK_NAME') + '_ursulas'][1]] }}"
- name: "Render Moe's Node Service"
become: yes
@ -60,8 +62,9 @@
vars:
virtualenv_path: '/home/ubuntu/venv'
nucypher_network_domain: "{{ lookup('env', 'NUCYPHER_NETWORK_NAME') }}"
teacher_uri: "{{ networks_file[lookup('env', 'NUCYPHER_NETWORK_NAME')][0] }}"
- name: "Enable and Start Ursula Service"
- name: "Enable and Start Moes's Monitoring"
become: yes
become_flags: "-H -S"
systemd:
@ -69,4 +72,4 @@
no_block: yes
enabled: yes
state: restarted
name: "ursula_node"
name: "moe_monitor"

View File

@ -4,7 +4,7 @@ Description="Run 'Moe', A NuCypher Network Monitor."
[Service]
User=ubuntu
Type=simple
ExecStart={{ virtualenv_path }}/bin/nucypher moe --network {{ nucypher_network_domain }} --teacher-uri {{ teacher_checksum_address }}@https://{{ teacher_rest_host }}:{{ teacher_rest_port }}
ExecStart={{ virtualenv_path }}/bin/nucypher moe --network {{ nucypher_network_domain }} --teacher-uri {{ teacher_uri }}
[Install]
WantedBy=multi-user.target