I'm having trouble getting some custom systemd service files installed and running. My state file is:
'{% if grains['host'].startswith('server1') or grains['host'].startswith('server2') %}
{% set DIR = 'myservicedir/files' %}
ensure_scripts:
file.directory:
- name: /root/scripts
- user: root
- group: root
- dir_mode: 700
- file_mode: 500
- recurse:
- user
- group
- mode
/root/scripts/start-python-flask.sh:
file.managed:
- source: salt://{{ DIR }}/start-python-flask.sh
/root/scripts/start-nessus-flask.sh:
file.managed:
- source: salt://{{ DIR }}/start-nessus-flask.sh
python.service:
file.managed:
- name: /etc/systemd/system/docker-python.service
- source: salt://{{ DIR }}/docker-python.service
- user: root
- group: root
- mode: 644
module.run:
- name: service.systemctl_reload
- onchanges:
- file: python.service
nessus.service:
file.managed:
- name: /etc/systemd/system/docker-nessus.service
- source: salt://{{ DIR }}/docker-nessus.service
- user: root
- group: root
- mode: 644
module.run:
- name: service.systemctl_reload
- onchanges:
- file: nessus.service
start_python:
service.running:
- name: docker-python
- enable: true
- watch:
- module: python.service
start_nessus:
service.running:
- name: docker-nessus
- enable: true
- watch:
- module: nessus.service
{% endif %}'
for the module.run, I get "No function provided." For the start service, I get "One or more requisite failed." Anyone have an idea what I might have wrong?
Also, how does one post code to the group such that it is highlighted as code? I can't seem to find that answer.