SaltStack: normalize Package nameSaltStack virt module and LVMsSaltStack: schedule highstate in batchAssign...

How can I find an Adventure or Adventure Path I need that meets certain criteria?

How to visualize a Cayley graph in this style?

Closure of presentable objects under finite limits

Make me a metasequence

Sometimes a banana is just a banana

Which aircraft had such a luxurious-looking navigator's station?

Why proton concentration is divided by 10⁻⁷?

I am on the US no-fly list. What can I do in order to be allowed on flights which go through US airspace?

What can I substitute for soda pop in a sweet pork recipe?

As a new poet, where can I find help from a professional to judge my work?

Linear regression when Y is bounded and discrete

Find the next monthly expiration date

Difference between hypovolemic shock and heart arrest caused by hypovolemia?

Skis versus snow shoes - when to choose which for travelling the backcountry?

Hacker Rank: Array left rotation

Where is this triangular-shaped space station from?

Auto Insert date into Notepad

Why zero tolerance on nudity in space?

How can I be pwned if I'm not registered on that site?

How to count occurrences of Friday 13th

multiple definition of

What am I? I am in theaters and computer programs

Multiplication via squaring and addition

Why might Google Analytics report a sudden, but persistent, drop in bounce rate (70% to 12%)



SaltStack: normalize Package name


SaltStack virt module and LVMsSaltStack: schedule highstate in batchAssign IP address using saltstackChange SSH Port Using SaltstackSaltstack rpm package install failsManaging IPtables efficiently with SaltstackSaltStack: Reason why postgres_user.absent fails?SaltStack: Stop on first errorSaltStack: Requisite not foundsaltstack equivalent of puppet last_run_summary.yaml













0















I would like to have less conditions in my saltstack sls files.



Up to now it looks like this:



foo_package:
pkg.installed:
- pkgs:
{% if grains.os_family == 'Debian' %}
- foo_BAR
{% else %}
- foo-bar
{% endif %}


I would like to have it like this:



foo_package:
pkg.installed:
- pkgs:
- {{ foo_BAR | normalize_package_name }}


How to implement normalize_package_name?



As soon as I can use Python I can help myself and implement this very easily: Underscores should get replaced with - and upper case characters should get lower case.



I know that I could do it in Jinja like this:



- {{ foo_BAR | replace... | replace .. }}


But this gets used several times, that's why I would like to have a custom filter.










share|improve this question



























    0















    I would like to have less conditions in my saltstack sls files.



    Up to now it looks like this:



    foo_package:
    pkg.installed:
    - pkgs:
    {% if grains.os_family == 'Debian' %}
    - foo_BAR
    {% else %}
    - foo-bar
    {% endif %}


    I would like to have it like this:



    foo_package:
    pkg.installed:
    - pkgs:
    - {{ foo_BAR | normalize_package_name }}


    How to implement normalize_package_name?



    As soon as I can use Python I can help myself and implement this very easily: Underscores should get replaced with - and upper case characters should get lower case.



    I know that I could do it in Jinja like this:



    - {{ foo_BAR | replace... | replace .. }}


    But this gets used several times, that's why I would like to have a custom filter.










    share|improve this question

























      0












      0








      0








      I would like to have less conditions in my saltstack sls files.



      Up to now it looks like this:



      foo_package:
      pkg.installed:
      - pkgs:
      {% if grains.os_family == 'Debian' %}
      - foo_BAR
      {% else %}
      - foo-bar
      {% endif %}


      I would like to have it like this:



      foo_package:
      pkg.installed:
      - pkgs:
      - {{ foo_BAR | normalize_package_name }}


      How to implement normalize_package_name?



      As soon as I can use Python I can help myself and implement this very easily: Underscores should get replaced with - and upper case characters should get lower case.



      I know that I could do it in Jinja like this:



      - {{ foo_BAR | replace... | replace .. }}


      But this gets used several times, that's why I would like to have a custom filter.










      share|improve this question














      I would like to have less conditions in my saltstack sls files.



      Up to now it looks like this:



      foo_package:
      pkg.installed:
      - pkgs:
      {% if grains.os_family == 'Debian' %}
      - foo_BAR
      {% else %}
      - foo-bar
      {% endif %}


      I would like to have it like this:



      foo_package:
      pkg.installed:
      - pkgs:
      - {{ foo_BAR | normalize_package_name }}


      How to implement normalize_package_name?



      As soon as I can use Python I can help myself and implement this very easily: Underscores should get replaced with - and upper case characters should get lower case.



      I know that I could do it in Jinja like this:



      - {{ foo_BAR | replace... | replace .. }}


      But this gets used several times, that's why I would like to have a custom filter.







      saltstack






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 5 hours ago









      guettliguettli

      37632356




      37632356






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f956658%2fsaltstack-normalize-package-name%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f956658%2fsaltstack-normalize-package-name%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...