2017-02-27 4 views
0

私は、次の状態を持っている:私は私の状態ファイルを実行するとサービスがすでに有効になって、そして死んでされて

copy_over_systemd_service_files: 
    file.managed: 
    - name: /etc/systemd/system/consul-template.service 
    - source: salt://mesos/files/consul-template.service 
    - owner: consul 

start_up_consul-template_service: 
    service.running: 
    - name: consul-template 
    - enable: True 
    - restart: True 
    - require: 
     - file: copy_over_systemd_service_files 
    - watch: 
     - /etc/systemd/system/consul-template.service 

私は次のエラーを取得:

ID: start_up_consul-template_service 
Function: service.running 
    Name: consul-template 
    Result: False 
Comment: Service consul-template is already enabled, and is dead 
Started: 17:27:38.346659 
Duration: 2835.888 ms 
Changes: 

を私は何本かわかりません手段。私がやってみたいのは、コピーされたサービスを再起動することだけです。スタックトレースを振り返ってみると、Saltが実行されたことがわかります。systemctl is-enabled consult-template

答えて

1

私はものを複雑にしていたと思います。代わりに私はこれをやっている:

consul-template: 
    service.running: 
    - require: 
     - file: copy_over_systemd_service_files 
    - watch: 
     - /etc/systemd/system/consul-template.service 
関連する問題