Code Monkey home page Code Monkey logo

Comments (1)

freemanjp avatar freemanjp commented on July 17, 2024

Thanks for the feedback.

I admit this breaks the rule that all role variables should have a unique name (e.g. prefixed with the role name), but I'd argue user specific configuration is a special case. All the GantSign roles (and many other third party roles) put user specific configuration under users to allow you to group the user specific configuration: e.g.

- hosts: all
  vars:
    users:
      - username: example1
        oh_my_zsh:
          theme: robbyrussell
          plugins:
            - git
        another_ansible_role1: config1
        another_ansible_role2: config2
  roles:
    - role: gantsign.oh-my-zsh
    - role: another_ansible_role1
    - role: another_ansible_role2

The role specific configuration is still under a separate namespaces (oh_my_zsh for this role).

If this causes you a problem put the configuration directly under the role and then it won't clash with any other roles:

- hosts: all
  roles:
    - role: gantsign.oh-my-zsh
      users:
        - username: example1
          oh_my_zsh:
            theme: robbyrussell
            plugins:
              - git

Changing users to oh_my_zsh_users would prevent us grouping user specific configuration (as in the first example above) but not improve over putting the configuration under the role (as in the second example).

I expect the following would work if you need to define the user specific configuration outside the role under a different name:

- hosts: all
  vars:
    oh_my_zsh_users:
      - username: example1
        oh_my_zsh:
          theme: robbyrussell
          plugins:
            - git
  roles:
    - role: gantsign.oh-my-zsh
      users: '{{ oh_my_zsh_users }}'

I'd also be concerned about breaking backwards compatibility and consistency with other GantSign roles.

Does the above explanation resolve your concerns or is there a another problem I haven't seen?

from ansible-role-oh-my-zsh.

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.