Reputation: 21
I want to start a service on systemd service, but I have got an error, i don't understant how to resolved it
- name: Start service
systemd:
name: "{{ item }}"
state: started
enabled: yes
daemon_reload: yes
with_items:
- a.service
I have got thies error :
failed: [host] (item=a.service) => {"ansible_loop_var": "item", "changed": false, "item": "a.service", "msg": "Could not find the requested service a.service: host"}
Upvotes: 0
Views: 1329
Reputation: 449
The problem here is that you don't use your variable as an jinja2.
Ansible Doc - using-variables-with-jinja2
You shall use your variable as "{{ a.service }}"
I.e.
with_items:
- "{{ a.service }}"
Upvotes: 1