I
I
Iceforest2021-03-31 09:36:09
Ansible
Iceforest, 2021-03-31 09:36:09

How to solve the problem could not find the requested service nginx:host when running task in ansible role?

Good afternoon, I wrote a role to run an application on the Reactjs server, all tasks are launched, except for one.
here are two tasks, the first task is successful, the second gives an error could not find the requested service nginx:host

- name: Ensure nginx is not installed
  apt:
    name: nginx
    state: absent

- name: Ensure that Nginx is stopped
  ansible.builtin.systemd:
    name: nginx
    state: stopped


60641852424ee193934753.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Iceforest, 2021-03-31
@Iceforest

error in assignment

M
MaxKozlov, 2021-03-31
@MaxKozlov

So you demolished it with the first team, why stop something already?

P
Puma Thailand, 2021-03-31
@opium

So you put it first and then stop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question