Giter Club home page Giter Club logo

Comments (5)

stale avatar stale commented on July 4, 2024

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

from ansible-collection-mac.

stale avatar stale commented on July 4, 2024

This issue is no longer marked for closure.

from ansible-collection-mac.

karthicraghupathi avatar karthicraghupathi commented on July 4, 2024

I looked at #43 and see that it is closed so I'm adding my comments here. An alternative way to approach adding items via dockutil and avoid the 7 seconds wait between each change is to use the --no-restart option for all but the last item. I'm not sure when this option was added but it is present now.

If the task in the main playbook is modified to include extended loop information like this:

- name: Ensure required dock items exist.
  ansible.builtin.include_tasks: dock-add.yml
  loop: "{{ dockitems_persist }}"
  loop_control:
    extended: true
    extended_allitems: false
  tags: ['dock']

The task in the add playbook can be modified to take advantage of the ansible_loop.last variable like this:

- name: Ensure Dock item {{ item.name | default(item) }} exists.
  ansible.builtin.command: "dockutil --add '{{ item.path }}' --label '{{ item.name }}' {% if ansible_loop.last is sameas true %}--no-restart{% endif %}"
  when: dockitem_exists.rc >0 or
        dockitem_exists.rc == 0 and current_section == 'recent-apps'
  tags: ['dock']

I've not used ansible in a while so my syntax above could be incorrect. Please feel free to correct / improve the suggestion.

from ansible-collection-mac.

geerlingguy avatar geerlingguy commented on July 4, 2024

@karthicraghupathi - Oh... something like that could work, and would make the setup of the Dock a bit more robust (I hope). If someone can work on a PR implementing that change it could be good to go. I haven't had a chance to dig into that or any other little issues on this project in a couple months.

from ansible-collection-mac.

karthicraghupathi avatar karthicraghupathi commented on July 4, 2024

@geerlingguy Thank you for taking a look. I will look to submit a PR soon. Things are a bit hectic at work atm...

from ansible-collection-mac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.