Ansible role for jaeger

Hi Ansible gurus,
I was trying to create a role for running Jaeger executables as service. However I received this error when I was running my playbook. Could you please advice where did I do wrong?
fatal: [jaeger]: FAILED! => {“changed”: false, “msg”: “Service is in unknown state”, “status”: {}}

Another question is that there are 2 ansible executables that I wanted to run as service inside the unarchived binaries, how can I configure 2 services in one role?

Below is my config files:

  1. playbook.yml
  • name: jaeger deployment
    become: true
    hosts: jaeger
    vars:
    jaeger_ver: “1.23.0”
    jaeger_os: linux
    jaeger_arch: amd64
    jaeger_parent_install_dir: /home/ubuntu
    jaeger_install_dir: “{{ jaeger_parent_install_dir }}/jaeger-{{ jaeger_ver }}-{{ jaeger_os }}-{{ jaeger_arch }}”
    jaeger_services:
  • jaeger-collector
  • jaeger-query
    tasks:
  • name: copy the archive to jaeger server
    copy:
    src: /home/ubuntu/jaeger-{{ jaeger_ver }}-{{ jaeger_os }}-{{ jaeger_arch }}.tar.gz
    dest: /tmp/jaeger-{{ jaeger_ver }}-{{ jaeger_os }}-{{ jaeger_arch }}.tar.gz
    owner: zztalk
    group: root
    mode: 0644
  • name: unarchive the binary
    become: yes
    unarchive:
    remote_src: yes
    src: /tmp/jaeger-{{ jaeger_ver }}-{{ jaeger_os }}-{{ jaeger_arch }}.tar.gz
    dest: “{{ jaeger_parent_install_dir }}”
    creates: “{{ jaeger_install_dir }}”
  • name: recursively change ownership of a directory
    ansible.builtin.file:
    path: “{{ jaeger_install_dir }}”
    state: directory
    recurse: yes
    owner: zztalk
    group: root
    roles:
  • jaeger

This sounds like it’s a problem with the configuration of the software you’re using.
Ansible is irrelevant for this problem.
First make it work without ansible. Once that is done then automate the steps using ansible.

Regarding your use of roles and playbooks, I would recommend to ship all the relevant logic to the role so that your playbook just can just include that role.