Play is skipped in playbook

24 views
Skip to first unread message

John Welby

unread,
Apr 27, 2023, 12:22:12 PM4/27/23
to Ansible Project
Team;

I am trying to 'stop' and 'mask' packagekit because it appears it is causing yum locks and blocking the playbook from executing instance patching.  Below is at the top of the playbook:

---
- name: stop and mask packagekit
  hosts: jwelby_sandbox
  remote_user: ec2-user
  become: True
  become_method: sudo
  
  ansible.builtin.shell:
  cmd: systemctl stop packagekit
  systemctl mask packagekit


Thanks!

John

Alex Wanderley

unread,
Apr 27, 2023, 12:34:28 PM4/27/23
to ansible...@googlegroups.com
Hello,

Whenever possible, use Ansible modules instead of shell/command.

Take a look at Ansible's "systemd" module. It will help you doing both the stop and masking in a single task.

Alex

--
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/e16884de-0b9c-4211-8cd2-281436216ca5n%40googlegroups.com.


--

 

Edmonton_sig_RGB_S.jpg

Alex Wanderley

Application and Infrastructure Analyst II
Server Solutions & Automation

Financial and Corporate Services | Open City and Technology  

 

780-496-4156  Office

780-819-0273  Mobile

 

City of Edmonton

Century Place, 19th Floor

9803 102A Avenue NW

Edmonton AB, T5J 3A3

 

All information contained in this email post is proprietary to the City of Edmonton, confidential and intended only for the addressed recipient. If you have received this post in error, please disregard the contents, inform the sender of the misdirection, and remove it from your system. The copying, dissemination or distribution of this email, if misdirected, is strictly prohibited.


The contents of this message and any attachment(s) are confidential, proprietary to the City of Edmonton, and are intended only for the addressed recipient. If you have received this in error, please disregard the contents, inform the sender of the misdirection, and remove it from your system. The copying, dissemination, or distribution of this message, if misdirected, is strictly prohibited.

John Welby

unread,
Apr 27, 2023, 6:11:59 PM4/27/23
to ansible...@googlegroups.com
Thank you Alex!

Got it working now.

Cheers,

John

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/e-zSqiUJlG0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADp8UUQdcvW2mhLGBpbjOuBPQa408wcx-H0WhoGbM5srYajkOg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages