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 On Thu, Apr 27, 2023 at 10:22 AM John Welby <marzett...@gmail.com> wrote: > 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 > > -- > 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-project+unsubscr...@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 > <https://groups.google.com/d/msgid/ansible-project/e16884de-0b9c-4211-8cd2-281436216ca5n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- [image: 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.* -- 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-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADp8UUQdcvW2mhLGBpbjOuBPQa408wcx-H0WhoGbM5srYajkOg%40mail.gmail.com.