executor: systemctl_service
input:
  unit_command: ""
  service: ""
  sudo: ""
steps:
- type: exec
  script: '{{.input.sudo}} systemctl {{.input.unit_command}} {{.input.service}}'
  vars:
    status_lines:
      from: result.systemout

- type: exec
  script: echo -n '{{.status_lines}}' | sed -nr 's/.*(Loaded.*Memory).*/\1/p'
  vars:
   first_lines:
     from: result.systemout

output:
  service_systemout: "{{.result.systemout}}"
  service_first_lines: "{{.first_lines}}"
