# Ansible role for jaeger

**URL:** <https://forum.ansible.com/t/ansible-role-for-jaeger/35471>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [July 7, 2021, 5:43pm UTC](https://forum.ansible.com/t/ansible-role-for-jaeger/35471 "2021-07-07T17:43:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhang\_Zhao](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@Zhang\_Zhao](https://forum.ansible.com/u/Zhang_Zhao)\
**Post date:** [July 7, 2021, 5:43pm UTC](https://forum.ansible.com/t/ansible-role-for-jaeger/35471/1 "2021-07-07T17:43:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 7, 2021, 7:23pm UTC](https://forum.ansible.com/t/ansible-role-for-jaeger/35471/2 "2021-07-07T19:23:48Z")

</div>

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.
