1
サービスが実行中か停止中かを保存しようとしています。次のログインを適用しました。AnerveでLinuxサービスのサービス状態を保存する
---
- hosts: all
vars:
myName: Nikunj
result: ""
tasks:
- name: Initialize empty Started and Stopped list of strings
set_fact:
started: []
stopped: []
- name: Saving context of the VM
shell: service tomcat status
ignore_errors: true
register: result
when: ' "running" in "{{result.stdout}}" '
set_fact:
started : "{{ started }} + ['tomcat']"
- debug:
msg: "{{started}}"
シェルコマンドはここで私には間違っています。
分割された 'shell'と' set_fact'タスク –