Srop nginx playbook

60 views
Skip to first unread message

rebecca acheampong

unread,
May 5, 2021, 9:31:19 AM5/5/21
to Ansible Project
I am writing a playbook to stop nginx on a remote host (ubuntu). Please I appreciate your help as usual. Thank you

I get this timeout error:

TASK [nginx.service] ***********************************************************
fatal: [my_vm_01]: FAILED! => {"changed": false, "msg": "Unable to stop service nginx.service: Failed to stop nginx.service: Connection timed out\nSee system logs and 'systemctl status nginx.service' for details.\n"}

Remote host syslog information:

May  5 16:23:37 cyber01-virtual-machine systemd[1]: Started Session 26 of user cyber01.
May  5 16:23:39 cyber01-virtual-machine python3[6573]: ansible-setup Invoked with gather_subset=['!all'] filter=ansible_service_mgr gather_timeout=10 fact_path=/etc/ansible/facts.d
May  5 16:23:40 cyber01-virtual-machine python3[6590]: ansible-systemd Invoked with name=nginx.service state=stopped daemon_reload=False daemon_reexec=False no_block=False enabled=None force=None masked=None user=None scope=None


Playbook:
---
- hosts: localhost
  become: true
  vars_files:
    - var_service.yml
  tasks:
    - vmware_guest:
        hostname: "{{ VMWARE_HOST }}"
        username: "{{ VMWARE_USER }}"
        password: "{{ VMWARE_PASSWORD }}"
        validate_certs: no
        folder: /ha-datacenter/vm/
        name: my_vm_01
- hosts: my_vm_01
  gather_facts: no
  remote_user: "{{ remote_user_name }}"
  vars:
   - remote_user_name: cyber01
  tasks:
    - name: nginx.service
      service:
         name: nginx.service
         state: stopped




The Vandyy Vines

unread,
May 5, 2021, 9:34:24 AM5/5/21
to : Ansible Project
Hello,

Can you stop the nginx manually... On remote server and see if that is yhe problem and not ansible..

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6cacd41c-b16f-4c18-97ba-47a3c9d00964n%40googlegroups.com.

rebecca acheampong

unread,
May 5, 2021, 9:48:42 AM5/5/21
to Ansible Project
You are right. I cannot stop it manually. I am trying to solve that. Thank you

Stefan Hornburg (Racke)

unread,
May 5, 2021, 10:41:04 AM5/5/21
to ansible...@googlegroups.com
On 5/5/21 3:34 PM, The Vandyy Vines wrote:
> Hello,
>
> Can you stop the nginx manually... On remote server and see if that is yhe problem and not ansible..

Yes, that's good idea. In some cases I got a similar error message, but the service was actually stopped.
Don't know if Ansible uses a different timeout than systemd itself.

Regards
Racke

>,
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> <https://groups.google.com/d/msgid/ansible-project/6cacd41c-b16f-4c18-97ba-47a3c9d00964n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CALJDb0mWOeUDQ6eKwFsLPn4nVutLevRYpE%2B_5sVSf8zpr1qing%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CALJDb0mWOeUDQ6eKwFsLPn4nVutLevRYpE%2B_5sVSf8zpr1qing%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

OpenPGP_signature

The Vandyy Vines

unread,
May 5, 2021, 11:50:19 AM5/5/21
to : Ansible Project
Reply all
Reply to author
Forward
0 new messages