FAQ
Hi Guys,

After weeks of reading I'm finally putting it all together!

One issue I'm stumped on and not sure if it's possible or if I'm taking the
wrong approach is to try to reuse formula's in multiple environments
without getting this error:

Detected conflicting IDs, SLS IDs need to be globally unique.

Snippet of my config:

# /etc/salt/master:
file_roots:
   base:
     - /srv/salt
   dev:
     - /srv/salt/env/dev
     - /srv/salt

pillar_roots:
   base:
     - /srv/salt/pillar
   dev:
     - /srv/salt/pillar/env/dev
     - /srv/salt/pillar


# /srv/salt/top.sls

base:
   '*':
     - base.groups
     - formula.users

dev:
   '*-dev':
     - env.dev
     - env.dev.groups
     - formula.users


I'm trying to reuse the users formula
(https://github.com/saltstack-formulas/users-formula) which allows me to
list users in the pillar, the goal is to apply the base users to all
machines and then add additional users for each environment (in this case
the dev environment). Without that final line ("formula.users") under the
dev pillar environment it works as expected, but when I add that line I was
hoping it would read the file: /srv/salt/pillar/env/dev/users/init.sls

# /srv/salt/pillar/env/dev/users/init.sls:

users:
   dev-test-user:
     fullname: ss testing

But I get the error mentioned earlier.

Any ideas?

Thanks


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Dave Chappelle at Sep 29, 2014 at 7:49 pm
    I should add that I have the formula in the base:

    /srv/salt/formula/users
    On Monday, 29 September 2014 20:48:09 UTC+1, Dave Chappelle wrote:

    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple environments
    without getting this error:

    Detected conflicting IDs, SLS IDs need to be globally unique.

    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    - /srv/salt
    dev:
    - /srv/salt/env/dev
    - /srv/salt

    pillar_roots:
    base:
    - /srv/salt/pillar
    dev:
    - /srv/salt/pillar/env/dev
    - /srv/salt/pillar


    # /srv/salt/top.sls

    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users


    I'm trying to reuse the users formula (
    https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this case
    the dev environment). Without that final line ("formula.users") under the
    dev pillar environment it works as expected, but when I add that line I was
    hoping it would read the file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:

    users:
    dev-test-user:
    fullname: ss testing

    But I get the error mentioned earlier.

    Any ideas?

    Thanks

    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Arnold Bechtoldt at Sep 29, 2014 at 8:11 pm
    Without further testing I guess you

    1) should not use the base env for states at all when you have non-base envs
    2) should not reuse the same directory in more than one env


    Fixing these may resolve your issue (or may not, sorry).


    --
    Arnold Bechtoldt

    Karlsruhe, Germany
    On 29.09.14 21:48, Dave Chappelle wrote:
    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple environments
    without getting this error:

    Detectedconflicting IDs,SLS IDsneed to be globally unique.
    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    -/srv/salt
    dev:
    -/srv/salt/env/dev
    -/srv/salt

    pillar_roots:
    base:
    -/srv/salt/pillar
    dev:
    -/srv/salt/pillar/env/dev
    -/srv/salt/pillar

    # /srv/salt/top.sls
    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users

    I'm trying to reuse the users formula
    (https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this
    case the dev environment). Without that final line ("formula.users")
    under the dev pillar environment it works as expected, but when I add
    that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:
    users:
    dev-test-user:
    fullname: ss testing
    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to the Google
    Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to salt-users+unsubscribe@googlegroups.com
    For more options, visit https://groups.google.com/d/optout.
  • Dave Chappelle at Sep 29, 2014 at 8:34 pm
    Was hoping to be able to reuse formula's and also apply global (base)
    aswell as additional environment settings.

    I tried copying the users formula folder to the dev environment and
    amending the paths but got the same error, I thought from the docs that it
    would prioritise the one found in the first root path in the list for the
    environment and only if it doesn't find it use the next one in the list, it
    seems like it's combining all the file / pillar roots.
    On Monday, 29 September 2014 21:11:26 UTC+1, Arnold Bechtoldt wrote:

    Without further testing I guess you

    1) should not use the base env for states at all when you have non-base
    envs
    2) should not reuse the same directory in more than one env


    Fixing these may resolve your issue (or may not, sorry).


    --
    Arnold Bechtoldt

    Karlsruhe, Germany
    On 29.09.14 21:48, Dave Chappelle wrote:
    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple environments
    without getting this error:

    Detectedconflicting IDs,SLS IDsneed to be globally unique.
    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    -/srv/salt
    dev:
    -/srv/salt/env/dev
    -/srv/salt

    pillar_roots:
    base:
    -/srv/salt/pillar
    dev:
    -/srv/salt/pillar/env/dev
    -/srv/salt/pillar

    # /srv/salt/top.sls
    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users

    I'm trying to reuse the users formula
    (https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this
    case the dev environment). Without that final line ("formula.users")
    under the dev pillar environment it works as expected, but when I add
    that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:
    users:
    dev-test-user:
    fullname: ss testing
    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to the Google
    Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to salt-users+...@googlegroups.com <javascript:>
    <mailto:salt-users+unsubscribe@googlegroups.com <javascript:>>.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Alex-solidfire at Sep 29, 2014 at 9:37 pm
    Try separating everything so that every pillar folder has a unique top file
    and the same for the environment roots. You shouldn't need to include both
    paths when you define the dev pillar. All pillars that match your
    minion-id in the top files should be available.

    You can have states with the same name in different environments that
    include eachother, they also should have their own top files.

    # Example base state to be included by devops
    /saltfs/base/nginx/init.sls
    base-nginx-pkg:
         cmd.run:
             - name: echo 'installing nginx...'
         pkg:
             - installed
             - pkgs:
                 - nginx


    # Example devops state that includes base state
    /saltfs/devops/nginx/init.sls
    include:
         - base: nginx
    devops-nginx-done:
         cmd.run:
             - name: echo 'nginx finished installing...'
             - require:
                 - pkg: base-nginx-pkg


    On Monday, September 29, 2014 2:34:31 PM UTC-6, Dave Chappelle wrote:

    Was hoping to be able to reuse formula's and also apply global (base)
    aswell as additional environment settings.

    I tried copying the users formula folder to the dev environment and
    amending the paths but got the same error, I thought from the docs that it
    would prioritise the one found in the first root path in the list for the
    environment and only if it doesn't find it use the next one in the list, it
    seems like it's combining all the file / pillar roots.
    On Monday, 29 September 2014 21:11:26 UTC+1, Arnold Bechtoldt wrote:

    Without further testing I guess you

    1) should not use the base env for states at all when you have non-base
    envs
    2) should not reuse the same directory in more than one env


    Fixing these may resolve your issue (or may not, sorry).


    --
    Arnold Bechtoldt

    Karlsruhe, Germany
    On 29.09.14 21:48, Dave Chappelle wrote:
    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple
    environments
    without getting this error:

    Detectedconflicting IDs,SLS IDsneed to be globally unique.
    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    -/srv/salt
    dev:
    -/srv/salt/env/dev
    -/srv/salt

    pillar_roots:
    base:
    -/srv/salt/pillar
    dev:
    -/srv/salt/pillar/env/dev
    -/srv/salt/pillar

    # /srv/salt/top.sls
    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users

    I'm trying to reuse the users formula
    (https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this
    case the dev environment). Without that final line ("formula.users")
    under the dev pillar environment it works as expected, but when I add
    that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:
    users:
    dev-test-user:
    fullname: ss testing
    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to the Google
    Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to salt-users+...@googlegroups.com
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Chappelle at Sep 30, 2014 at 9:24 am
    Genius, that works, thank you very much :)


    On Monday, 29 September 2014 22:37:00 UTC+1, alex-solidfire wrote:

    Try separating everything so that every pillar folder has a unique top
    file and the same for the environment roots. You shouldn't need to include
    both paths when you define the dev pillar. All pillars that match your
    minion-id in the top files should be available.

    You can have states with the same name in different environments that
    include eachother, they also should have their own top files.

    # Example base state to be included by devops
    /saltfs/base/nginx/init.sls
    base-nginx-pkg:
    cmd.run:
    - name: echo 'installing nginx...'
    pkg:
    - installed
    - pkgs:
    - nginx


    # Example devops state that includes base state
    /saltfs/devops/nginx/init.sls
    include:
    - base: nginx
    devops-nginx-done:
    cmd.run:
    - name: echo 'nginx finished installing...'
    - require:
    - pkg: base-nginx-pkg


    On Monday, September 29, 2014 2:34:31 PM UTC-6, Dave Chappelle wrote:

    Was hoping to be able to reuse formula's and also apply global (base)
    aswell as additional environment settings.

    I tried copying the users formula folder to the dev environment and
    amending the paths but got the same error, I thought from the docs that it
    would prioritise the one found in the first root path in the list for the
    environment and only if it doesn't find it use the next one in the list, it
    seems like it's combining all the file / pillar roots.
    On Monday, 29 September 2014 21:11:26 UTC+1, Arnold Bechtoldt wrote:

    Without further testing I guess you

    1) should not use the base env for states at all when you have non-base
    envs
    2) should not reuse the same directory in more than one env


    Fixing these may resolve your issue (or may not, sorry).


    --
    Arnold Bechtoldt

    Karlsruhe, Germany
    On 29.09.14 21:48, Dave Chappelle wrote:
    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple
    environments
    without getting this error:

    Detectedconflicting IDs,SLS IDsneed to be globally unique.
    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    -/srv/salt
    dev:
    -/srv/salt/env/dev
    -/srv/salt

    pillar_roots:
    base:
    -/srv/salt/pillar
    dev:
    -/srv/salt/pillar/env/dev
    -/srv/salt/pillar

    # /srv/salt/top.sls
    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users

    I'm trying to reuse the users formula
    (https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this
    case the dev environment). Without that final line ("formula.users")
    under the dev pillar environment it works as expected, but when I add
    that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:
    users:
    dev-test-user:
    fullname: ss testing
    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to the Google
    Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to salt-users+...@googlegroups.com
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Alex Artigues at Sep 30, 2014 at 12:55 pm
    cool. now if you can run a highstate from an environment please let me know
    how you did it, i can only highstate from base.
    On Sep 30, 2014 3:24 AM, "Dave Chappelle" wrote:

    Genius, that works, thank you very much :)


    On Monday, 29 September 2014 22:37:00 UTC+1, alex-solidfire wrote:

    Try separating everything so that every pillar folder has a unique top
    file and the same for the environment roots. You shouldn't need to include
    both paths when you define the dev pillar. All pillars that match your
    minion-id in the top files should be available.

    You can have states with the same name in different environments that
    include eachother, they also should have their own top files.

    # Example base state to be included by devops
    /saltfs/base/nginx/init.sls
    base-nginx-pkg:
    cmd.run:
    - name: echo 'installing nginx...'
    pkg:
    - installed
    - pkgs:
    - nginx


    # Example devops state that includes base state
    /saltfs/devops/nginx/init.sls
    include:
    - base: nginx
    devops-nginx-done:
    cmd.run:
    - name: echo 'nginx finished installing...'
    - require:
    - pkg: base-nginx-pkg


    On Monday, September 29, 2014 2:34:31 PM UTC-6, Dave Chappelle wrote:

    Was hoping to be able to reuse formula's and also apply global (base)
    aswell as additional environment settings.

    I tried copying the users formula folder to the dev environment and
    amending the paths but got the same error, I thought from the docs that it
    would prioritise the one found in the first root path in the list for the
    environment and only if it doesn't find it use the next one in the list, it
    seems like it's combining all the file / pillar roots.
    On Monday, 29 September 2014 21:11:26 UTC+1, Arnold Bechtoldt wrote:

    Without further testing I guess you

    1) should not use the base env for states at all when you have non-base
    envs
    2) should not reuse the same directory in more than one env


    Fixing these may resolve your issue (or may not, sorry).


    --
    Arnold Bechtoldt

    Karlsruhe, Germany
    On 29.09.14 21:48, Dave Chappelle wrote:
    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple
    environments
    without getting this error:

    Detectedconflicting IDs,SLS IDsneed to be globally unique.
    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    -/srv/salt
    dev:
    -/srv/salt/env/dev
    -/srv/salt

    pillar_roots:
    base:
    -/srv/salt/pillar
    dev:
    -/srv/salt/pillar/env/dev
    -/srv/salt/pillar

    # /srv/salt/top.sls
    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users

    I'm trying to reuse the users formula
    (https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this
    case the dev environment). Without that final line ("formula.users")
    under the dev pillar environment it works as expected, but when I add
    that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:
    users:
    dev-test-user:
    fullname: ss testing
    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to the Google
    Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to salt-users+...@googlegroups.com
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Chappelle at Sep 30, 2014 at 2:59 pm
    Hi Alex,

    When I last replied saying it worked, I left the base file and pillar roots
    for dev in the master config. It works but is confusing and am trying to
    work around it, e.g. if I uncomment the include: base: -users it still
    works but is confusing if you're trying to debug. When I run the high state
    I am just running : salt '*' salt.highstate (still testing so not in
    production yet).

    Now I'm seperating out the dev environment as in removing the base roots
    but am having trouble, seems like salt is caching old states from gitfs /
    gitfs_remotes so I'm going to pull down the files to the file system
    instead and re-test.

    Am probably causing more confusion than need be, let me sort out the gitfs
    stuff, re-test and get back to you.

    Dave
    On Tuesday, 30 September 2014 13:55:48 UTC+1, alex-solidfire wrote:

    cool. now if you can run a highstate from an environment please let me
    know how you did it, i can only highstate from base.
    On Sep 30, 2014 3:24 AM, "Dave Chappelle" <linh...@gmail.com <javascript:>>
    wrote:
    Genius, that works, thank you very much :)


    On Monday, 29 September 2014 22:37:00 UTC+1, alex-solidfire wrote:

    Try separating everything so that every pillar folder has a unique top
    file and the same for the environment roots. You shouldn't need to include
    both paths when you define the dev pillar. All pillars that match your
    minion-id in the top files should be available.

    You can have states with the same name in different environments that
    include eachother, they also should have their own top files.

    # Example base state to be included by devops
    /saltfs/base/nginx/init.sls
    base-nginx-pkg:
    cmd.run:
    - name: echo 'installing nginx...'
    pkg:
    - installed
    - pkgs:
    - nginx


    # Example devops state that includes base state
    /saltfs/devops/nginx/init.sls
    include:
    - base: nginx
    devops-nginx-done:
    cmd.run:
    - name: echo 'nginx finished installing...'
    - require:
    - pkg: base-nginx-pkg


    On Monday, September 29, 2014 2:34:31 PM UTC-6, Dave Chappelle wrote:

    Was hoping to be able to reuse formula's and also apply global (base)
    aswell as additional environment settings.

    I tried copying the users formula folder to the dev environment and
    amending the paths but got the same error, I thought from the docs that it
    would prioritise the one found in the first root path in the list for the
    environment and only if it doesn't find it use the next one in the list, it
    seems like it's combining all the file / pillar roots.
    On Monday, 29 September 2014 21:11:26 UTC+1, Arnold Bechtoldt wrote:

    Without further testing I guess you

    1) should not use the base env for states at all when you have
    non-base envs
    2) should not reuse the same directory in more than one env


    Fixing these may resolve your issue (or may not, sorry).


    --
    Arnold Bechtoldt

    Karlsruhe, Germany
    On 29.09.14 21:48, Dave Chappelle wrote:
    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple
    environments
    without getting this error:

    Detectedconflicting IDs,SLS IDsneed to be globally unique.
    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    -/srv/salt
    dev:
    -/srv/salt/env/dev
    -/srv/salt

    pillar_roots:
    base:
    -/srv/salt/pillar
    dev:
    -/srv/salt/pillar/env/dev
    -/srv/salt/pillar

    # /srv/salt/top.sls
    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users

    I'm trying to reuse the users formula
    (https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this
    case the dev environment). Without that final line ("formula.users")
    under the dev pillar environment it works as expected, but when I add
    that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:
    users:
    dev-test-user:
    fullname: ss testing
    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to the Google
    Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to salt-users+...@googlegroups.com
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Alex Graham at Oct 1, 2014 at 4:25 pm
    You can specify "env=[environment]" when invoking a state.

    For example:
    salt '[minion_id]' state.sls [state_name] env=[environment] [test=True]

    -a different Alex
    On Tuesday, September 30, 2014 5:55:48 AM UTC-7, alex-solidfire wrote:

    cool. now if you can run a highstate from an environment please let me
    know how you did it, i can only highstate from base.
    On Sep 30, 2014 3:24 AM, "Dave Chappelle" <linh...@gmail.com <javascript:>>
    wrote:
    Genius, that works, thank you very much :)


    On Monday, 29 September 2014 22:37:00 UTC+1, alex-solidfire wrote:

    Try separating everything so that every pillar folder has a unique top
    file and the same for the environment roots. You shouldn't need to include
    both paths when you define the dev pillar. All pillars that match your
    minion-id in the top files should be available.

    You can have states with the same name in different environments that
    include eachother, they also should have their own top files.

    # Example base state to be included by devops
    /saltfs/base/nginx/init.sls
    base-nginx-pkg:
    cmd.run:
    - name: echo 'installing nginx...'
    pkg:
    - installed
    - pkgs:
    - nginx


    # Example devops state that includes base state
    /saltfs/devops/nginx/init.sls
    include:
    - base: nginx
    devops-nginx-done:
    cmd.run:
    - name: echo 'nginx finished installing...'
    - require:
    - pkg: base-nginx-pkg


    On Monday, September 29, 2014 2:34:31 PM UTC-6, Dave Chappelle wrote:

    Was hoping to be able to reuse formula's and also apply global (base)
    aswell as additional environment settings.

    I tried copying the users formula folder to the dev environment and
    amending the paths but got the same error, I thought from the docs that it
    would prioritise the one found in the first root path in the list for the
    environment and only if it doesn't find it use the next one in the list, it
    seems like it's combining all the file / pillar roots.
    On Monday, 29 September 2014 21:11:26 UTC+1, Arnold Bechtoldt wrote:

    Without further testing I guess you

    1) should not use the base env for states at all when you have
    non-base envs
    2) should not reuse the same directory in more than one env


    Fixing these may resolve your issue (or may not, sorry).


    --
    Arnold Bechtoldt

    Karlsruhe, Germany
    On 29.09.14 21:48, Dave Chappelle wrote:
    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple
    environments
    without getting this error:

    Detectedconflicting IDs,SLS IDsneed to be globally unique.
    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    -/srv/salt
    dev:
    -/srv/salt/env/dev
    -/srv/salt

    pillar_roots:
    base:
    -/srv/salt/pillar
    dev:
    -/srv/salt/pillar/env/dev
    -/srv/salt/pillar

    # /srv/salt/top.sls
    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users

    I'm trying to reuse the users formula
    (https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this
    case the dev environment). Without that final line ("formula.users")
    under the dev pillar environment it works as expected, but when I add
    that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:
    users:
    dev-test-user:
    fullname: ss testing
    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to the Google
    Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to salt-users+...@googlegroups.com
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Chappelle at Oct 3, 2014 at 9:46 am
    Hi Guys,

    I've setup isolated environments (file and pillar roots) and hard coded the
    environment on the minion.

    Using the 'include' technique I can re-use formula's from another
    environment - provided I have the correct pillar data in the same format as
    the originating environment and in the same relative location - thank you :)

    Regarding pillar data, I don't seem to be able to pull in the base pillar
    data using the same technique:

    e.g. for the isolated env:


    include:
       - base: users

    dev:
       '*':
         - users

         Rendering Top file OrderedDict([('base', 'users')]) failed, render
    error:
    sequence item 1: expected string, OrderedDict found

    Guessing the syntax is wrong or isn't supported?


    On Monday, 29 September 2014 20:48:09 UTC+1, Dave Chappelle wrote:

    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple environments
    without getting this error:

    Detected conflicting IDs, SLS IDs need to be globally unique.

    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    - /srv/salt
    dev:
    - /srv/salt/env/dev
    - /srv/salt

    pillar_roots:
    base:
    - /srv/salt/pillar
    dev:
    - /srv/salt/pillar/env/dev
    - /srv/salt/pillar


    # /srv/salt/top.sls

    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users


    I'm trying to reuse the users formula (
    https://github.com/saltstack-formulas/users-formula) which allows me to
    list users in the pillar, the goal is to apply the base users to all
    machines and then add additional users for each environment (in this case
    the dev environment). Without that final line ("formula.users") under the
    dev pillar environment it works as expected, but when I add that line I was
    hoping it would read the file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:

    users:
    dev-test-user:
    fullname: ss testing

    But I get the error mentioned earlier.

    Any ideas?

    Thanks

    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Alex Artigues at Oct 3, 2014 at 1:25 pm
    your base pillar should be available without including anything.

    Make sure your base pillar top file is matching on * so all minions should
    get it. if setup right you can just run pillar.items on your minion and
    your values should be present.

    we make our base pillar global for all minions and filter the environment
    pillars based on minion name.
      On Oct 3, 2014 3:46 AM, "Dave Chappelle" wrote:

    Hi Guys,

    I've setup isolated environments (file and pillar roots) and hard coded
    the environment on the minion.

    Using the 'include' technique I can re-use formula's from another
    environment - provided I have the correct pillar data in the same format as
    the originating environment and in the same relative location - thank you :)

    Regarding pillar data, I don't seem to be able to pull in the base pillar
    data using the same technique:

    e.g. for the isolated env:


    include:
    - base: users

    dev:
    '*':
    - users

    Rendering Top file OrderedDict([('base', 'users')]) failed, render
    error:
    sequence item 1: expected string, OrderedDict found

    Guessing the syntax is wrong or isn't supported?


    On Monday, 29 September 2014 20:48:09 UTC+1, Dave Chappelle wrote:

    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple environments
    without getting this error:

    Detected conflicting IDs, SLS IDs need to be globally unique.

    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    - /srv/salt
    dev:
    - /srv/salt/env/dev
    - /srv/salt

    pillar_roots:
    base:
    - /srv/salt/pillar
    dev:
    - /srv/salt/pillar/env/dev
    - /srv/salt/pillar


    # /srv/salt/top.sls

    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users


    I'm trying to reuse the users formula (https://github.com/saltstack-
    formulas/users-formula) which allows me to list users in the pillar, the
    goal is to apply the base users to all machines and then add additional
    users for each environment (in this case the dev environment). Without that
    final line ("formula.users") under the dev pillar environment it works as
    expected, but when I add that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:

    users:
    dev-test-user:
    fullname: ss testing

    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Chappelle at Oct 3, 2014 at 1:35 pm
    Hi Alex,

    Base pillar data is available if I do as you suggested but can't do so in
    an isolated environment (where each environment has it's own top file).

    I'm kind of stuck in between two methods:

    1) Isolated environments (top per file and pillar root)
    - can include base states
    - can't include base pillar data

    2) single environment - top file determines which minions are in which
    environments
    -base, '*' apply to all easily
    -downside, if using a formula in base which uses pillar data, pillar data
    will get combined with other environments (depending on node, e.g.
    dev+base), so in the scenario where I'm using the users-formula it would
    combine the data from base+pillar, so e.g. admins and dev users get added,
    but makes reading dev environment settings confusing as the base
    user-formula added the users from the dev pillar users.sls, hope this makes
    sense

    Am looking into external pillars, might be cleaner to use that as a generic
    way to import base settings in isolated environments.
    On Friday, 3 October 2014 14:25:14 UTC+1, alex-solidfire wrote:

    your base pillar should be available without including anything.

    Make sure your base pillar top file is matching on * so all minions should
    get it. if setup right you can just run pillar.items on your minion and
    your values should be present.

    we make our base pillar global for all minions and filter the environment
    pillars based on minion name.
    On Oct 3, 2014 3:46 AM, "Dave Chappelle" <linh...@gmail.com <javascript:>>
    wrote:
    Hi Guys,

    I've setup isolated environments (file and pillar roots) and hard coded
    the environment on the minion.

    Using the 'include' technique I can re-use formula's from another
    environment - provided I have the correct pillar data in the same format as
    the originating environment and in the same relative location - thank you :)

    Regarding pillar data, I don't seem to be able to pull in the base pillar
    data using the same technique:

    e.g. for the isolated env:


    include:
    - base: users

    dev:
    '*':
    - users

    Rendering Top file OrderedDict([('base', 'users')]) failed, render
    error:
    sequence item 1: expected string, OrderedDict found

    Guessing the syntax is wrong or isn't supported?


    On Monday, 29 September 2014 20:48:09 UTC+1, Dave Chappelle wrote:

    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple environments
    without getting this error:

    Detected conflicting IDs, SLS IDs need to be globally unique.

    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    - /srv/salt
    dev:
    - /srv/salt/env/dev
    - /srv/salt

    pillar_roots:
    base:
    - /srv/salt/pillar
    dev:
    - /srv/salt/pillar/env/dev
    - /srv/salt/pillar


    # /srv/salt/top.sls

    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users


    I'm trying to reuse the users formula (https://github.com/saltstack-
    formulas/users-formula) which allows me to list users in the pillar,
    the goal is to apply the base users to all machines and then add additional
    users for each environment (in this case the dev environment). Without that
    final line ("formula.users") under the dev pillar environment it works as
    expected, but when I add that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:

    users:
    dev-test-user:
    fullname: ss testing

    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Alex Artigues at Oct 3, 2014 at 1:55 pm
    that's strange, my pillar data always loads regardless of which environment
    i am calling.

    the only way i can keep pillar data out of particular environments is with
    matching in the top files. it doesn't matter what saltenv is set to.

    Maybe try 2014.7?
      On Oct 3, 2014 7:35 AM, "Dave Chappelle" wrote:

    Hi Alex,

    Base pillar data is available if I do as you suggested but can't do so in
    an isolated environment (where each environment has it's own top file).

    I'm kind of stuck in between two methods:

    1) Isolated environments (top per file and pillar root)
    - can include base states
    - can't include base pillar data

    2) single environment - top file determines which minions are in which
    environments
    -base, '*' apply to all easily
    -downside, if using a formula in base which uses pillar data, pillar data
    will get combined with other environments (depending on node, e.g.
    dev+base), so in the scenario where I'm using the users-formula it would
    combine the data from base+pillar, so e.g. admins and dev users get added,
    but makes reading dev environment settings confusing as the base
    user-formula added the users from the dev pillar users.sls, hope this makes
    sense

    Am looking into external pillars, might be cleaner to use that as a
    generic way to import base settings in isolated environments.
    On Friday, 3 October 2014 14:25:14 UTC+1, alex-solidfire wrote:

    your base pillar should be available without including anything.

    Make sure your base pillar top file is matching on * so all minions
    should get it. if setup right you can just run pillar.items on your minion
    and your values should be present.

    we make our base pillar global for all minions and filter the environment
    pillars based on minion name.
    On Oct 3, 2014 3:46 AM, "Dave Chappelle" wrote:

    Hi Guys,

    I've setup isolated environments (file and pillar roots) and hard coded
    the environment on the minion.

    Using the 'include' technique I can re-use formula's from another
    environment - provided I have the correct pillar data in the same format as
    the originating environment and in the same relative location - thank you :)

    Regarding pillar data, I don't seem to be able to pull in the base
    pillar data using the same technique:

    e.g. for the isolated env:


    include:
    - base: users

    dev:
    '*':
    - users

    Rendering Top file OrderedDict([('base', 'users')]) failed, render
    error:
    sequence item 1: expected string, OrderedDict found

    Guessing the syntax is wrong or isn't supported?


    On Monday, 29 September 2014 20:48:09 UTC+1, Dave Chappelle wrote:

    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm taking
    the wrong approach is to try to reuse formula's in multiple environments
    without getting this error:

    Detected conflicting IDs, SLS IDs need to be globally unique.

    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    - /srv/salt
    dev:
    - /srv/salt/env/dev
    - /srv/salt

    pillar_roots:
    base:
    - /srv/salt/pillar
    dev:
    - /srv/salt/pillar/env/dev
    - /srv/salt/pillar


    # /srv/salt/top.sls

    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users


    I'm trying to reuse the users formula (https://github.com/saltstack-
    formulas/users-formula) which allows me to list users in the pillar,
    the goal is to apply the base users to all machines and then add additional
    users for each environment (in this case the dev environment). Without that
    final line ("formula.users") under the dev pillar environment it works as
    expected, but when I add that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:

    users:
    dev-test-user:
    fullname: ss testing

    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/
    topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+...@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Yusuf (Linh Tran) at Oct 3, 2014 at 3:34 pm
    np Alex, still playing and learning.

    With regards to the pillar data for isolated environments, I think
    because it's the same file (relative to the environment root), the
    environment version wins and ignores the base version, but for non
    isolated environments it combines.
    On 03/10/2014, Alex Artigues wrote:
    that's strange, my pillar data always loads regardless of which environment
    i am calling.

    the only way i can keep pillar data out of particular environments is with
    matching in the top files. it doesn't matter what saltenv is set to.

    Maybe try 2014.7?
    On Oct 3, 2014 7:35 AM, "Dave Chappelle" wrote:

    Hi Alex,

    Base pillar data is available if I do as you suggested but can't do so in
    an isolated environment (where each environment has it's own top file).

    I'm kind of stuck in between two methods:

    1) Isolated environments (top per file and pillar root)
    - can include base states
    - can't include base pillar data

    2) single environment - top file determines which minions are in which
    environments
    -base, '*' apply to all easily
    -downside, if using a formula in base which uses pillar data, pillar data
    will get combined with other environments (depending on node, e.g.
    dev+base), so in the scenario where I'm using the users-formula it would
    combine the data from base+pillar, so e.g. admins and dev users get
    added,
    but makes reading dev environment settings confusing as the base
    user-formula added the users from the dev pillar users.sls, hope this
    makes
    sense

    Am looking into external pillars, might be cleaner to use that as a
    generic way to import base settings in isolated environments.
    On Friday, 3 October 2014 14:25:14 UTC+1, alex-solidfire wrote:

    your base pillar should be available without including anything.

    Make sure your base pillar top file is matching on * so all minions
    should get it. if setup right you can just run pillar.items on your
    minion
    and your values should be present.

    we make our base pillar global for all minions and filter the
    environment
    pillars based on minion name.
    On Oct 3, 2014 3:46 AM, "Dave Chappelle" wrote:

    Hi Guys,

    I've setup isolated environments (file and pillar roots) and hard coded
    the environment on the minion.

    Using the 'include' technique I can re-use formula's from another
    environment - provided I have the correct pillar data in the same format
    as
    the originating environment and in the same relative location - thank
    you :)

    Regarding pillar data, I don't seem to be able to pull in the base
    pillar data using the same technique:

    e.g. for the isolated env:


    include:
    - base: users

    dev:
    '*':
    - users

    Rendering Top file OrderedDict([('base', 'users')]) failed, render
    error:
    sequence item 1: expected string, OrderedDict found

    Guessing the syntax is wrong or isn't supported?


    On Monday, 29 September 2014 20:48:09 UTC+1, Dave Chappelle wrote:

    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm
    taking
    the wrong approach is to try to reuse formula's in multiple
    environments
    without getting this error:

    Detected conflicting IDs, SLS IDs need to be globally unique.

    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    - /srv/salt
    dev:
    - /srv/salt/env/dev
    - /srv/salt

    pillar_roots:
    base:
    - /srv/salt/pillar
    dev:
    - /srv/salt/pillar/env/dev
    - /srv/salt/pillar


    # /srv/salt/top.sls

    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users


    I'm trying to reuse the users formula (https://github.com/saltstack-
    formulas/users-formula) which allows me to list users in the pillar,
    the goal is to apply the base users to all machines and then add
    additional
    users for each environment (in this case the dev environment). Without
    that
    final line ("formula.users") under the dev pillar environment it works
    as
    expected, but when I add that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:

    users:
    dev-test-user:
    fullname: ss testing

    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/
    topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+...@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Alex Artigues at Oct 3, 2014 at 3:51 pm
    our pillars combine in a convenient way using a separate top file for each
    pillar. this works no matter which environment is called because the
    minions are defined in each pillar root top file.

    To clarify, i didn't mean to suggest this is unexpected behavior. i just
    assumed (wrongly) when i started that the saltenv var would lock to the
    corresponding pillar root as it does for the state root.
      On Oct 3, 2014 9:34 AM, "Yusuf (Linh Tran)" wrote:

    np Alex, still playing and learning.

    With regards to the pillar data for isolated environments, I think
    because it's the same file (relative to the environment root), the
    environment version wins and ignores the base version, but for non
    isolated environments it combines.
    On 03/10/2014, Alex Artigues wrote:
    that's strange, my pillar data always loads regardless of which
    environment
    i am calling.

    the only way i can keep pillar data out of particular environments is with
    matching in the top files. it doesn't matter what saltenv is set to.

    Maybe try 2014.7?
    On Oct 3, 2014 7:35 AM, "Dave Chappelle" wrote:

    Hi Alex,

    Base pillar data is available if I do as you suggested but can't do so
    in
    an isolated environment (where each environment has it's own top file).

    I'm kind of stuck in between two methods:

    1) Isolated environments (top per file and pillar root)
    - can include base states
    - can't include base pillar data

    2) single environment - top file determines which minions are in which
    environments
    -base, '*' apply to all easily
    -downside, if using a formula in base which uses pillar data, pillar
    data
    will get combined with other environments (depending on node, e.g.
    dev+base), so in the scenario where I'm using the users-formula it would
    combine the data from base+pillar, so e.g. admins and dev users get
    added,
    but makes reading dev environment settings confusing as the base
    user-formula added the users from the dev pillar users.sls, hope this
    makes
    sense

    Am looking into external pillars, might be cleaner to use that as a
    generic way to import base settings in isolated environments.
    On Friday, 3 October 2014 14:25:14 UTC+1, alex-solidfire wrote:

    your base pillar should be available without including anything.

    Make sure your base pillar top file is matching on * so all minions
    should get it. if setup right you can just run pillar.items on your
    minion
    and your values should be present.

    we make our base pillar global for all minions and filter the
    environment
    pillars based on minion name.
    On Oct 3, 2014 3:46 AM, "Dave Chappelle" wrote:

    Hi Guys,

    I've setup isolated environments (file and pillar roots) and hard
    coded
    the environment on the minion.

    Using the 'include' technique I can re-use formula's from another
    environment - provided I have the correct pillar data in the same
    format
    as
    the originating environment and in the same relative location - thank
    you :)

    Regarding pillar data, I don't seem to be able to pull in the base
    pillar data using the same technique:

    e.g. for the isolated env:


    include:
    - base: users

    dev:
    '*':
    - users

    Rendering Top file OrderedDict([('base', 'users')]) failed, render
    error:
    sequence item 1: expected string, OrderedDict found

    Guessing the syntax is wrong or isn't supported?


    On Monday, 29 September 2014 20:48:09 UTC+1, Dave Chappelle wrote:

    Hi Guys,

    After weeks of reading I'm finally putting it all together!

    One issue I'm stumped on and not sure if it's possible or if I'm
    taking
    the wrong approach is to try to reuse formula's in multiple
    environments
    without getting this error:

    Detected conflicting IDs, SLS IDs need to be globally unique.

    Snippet of my config:

    # /etc/salt/master:
    file_roots:
    base:
    - /srv/salt
    dev:
    - /srv/salt/env/dev
    - /srv/salt

    pillar_roots:
    base:
    - /srv/salt/pillar
    dev:
    - /srv/salt/pillar/env/dev
    - /srv/salt/pillar


    # /srv/salt/top.sls

    base:
    '*':
    - base.groups
    - formula.users

    dev:
    '*-dev':
    - env.dev
    - env.dev.groups
    - formula.users


    I'm trying to reuse the users formula (https://github.com/saltstack-
    formulas/users-formula) which allows me to list users in the pillar,
    the goal is to apply the base users to all machines and then add
    additional
    users for each environment (in this case the dev environment).
    Without
    that
    final line ("formula.users") under the dev pillar environment it
    works
    as
    expected, but when I add that line I was hoping it would read the
    file: /srv/salt/pillar/env/dev/users/init.sls

    # /srv/salt/pillar/env/dev/users/init.sls:

    users:
    dev-test-user:
    fullname: ss testing

    But I get the error mentioned earlier.

    Any ideas?

    Thanks


    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/
    topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+...@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/hfCM_wHoglc/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedSep 29, '14 at 7:48p
activeOct 3, '14 at 3:51p
posts15
users4

People

Translate

site design / logo © 2022 Grokbase