Skip to content

Instantly share code, notes, and snippets.

@btorch
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save btorch/7d880c661fa8ac54bc8a to your computer and use it in GitHub Desktop.

Select an option

Save btorch/7d880c661fa8ac54bc8a to your computer and use it in GitHub Desktop.

Revisions

  1. btorch revised this gist Aug 29, 2014. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion saltstack_tips_and_quickies
    Original file line number Diff line number Diff line change
    @@ -32,4 +32,13 @@ $ salt -t 15 -G 'stype:data' --out=txt grains.item roles
    ========================================
    - Compound with grains (G)
    ===============================================
    $ salt -t 10 -C "G@roles:account and G@stype:synnex" <
    $ salt -t 10 -C "G@roles:account and G@stype:synnex"



    ==============================================
    - Move roles grain from minion to grains file
    ==============================================
    sudo salt '*' --out=txt grains.append roles nada
    sudo salt '*' cmd.run "sed -i -e '/roles/,+10d' /etc/salt/minion"
    sudo salt '*' --out=txt grains.remove roles nada
  2. btorch revised this gist Jul 3, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions saltstack_tips_and_quickies
    Original file line number Diff line number Diff line change
    @@ -22,14 +22,14 @@ Useful salt CLI Flags
    * Depending what I'm retrieving from several minions I sometimes use --out=txt so I can get one liners back that can be compared


    ========================================
    ===============================================
    - Using Grain target & grains execution module

    sudo salt -t 15 -G 'stype:data' --out=txt grains.item roles
    ===============================================
    $ salt -t 15 -G 'stype:data' --out=txt grains.item roles



    ========================================
    - Compound with grains (G)

    ===============================================
    $ salt -t 10 -C "G@roles:account and G@stype:synnex" <
  3. btorch revised this gist Jul 3, 2014. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions saltstack_tips_and_quickies
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,14 @@ Useful salt CLI Flags

    * Depending what I'm retrieving from several minions I sometimes use --out=txt so I can get one liners back that can be compared


    ========================================
    - Using Grain target & grains execution module

    sudo salt -t 15 -G 'stype:data' --out=txt grains.item roles



    ========================================
    - Compound with grains (G)

  4. btorch revised this gist Jul 3, 2014. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions saltstack_tips_and_quickies
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,15 @@ builtin state modules:
    Those are normally used when writing/creating a state file


    ========================================
    Useful salt CLI Flags
    ========================================
    -t TIMEOUT, --timeout=
    -b BATCH, --batch=BATCH, --batch-size=BATCH
    --out=OUTPUT, --output=OUTPUT

    * Depending what I'm retrieving from several minions I sometimes use --out=txt so I can get one liners back that can be compared

    ========================================
    - Compound with grains (G)

  5. btorch revised this gist Jul 3, 2014. 1 changed file with 16 additions and 1 deletion.
    17 changes: 16 additions & 1 deletion saltstack_tips_and_quickies
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,18 @@
    - Using Compound with grains (G)
    Helpful Referecens that I use all the time

    - http://salt.readthedocs.org/en/v0.17.5/ref/modules/all/ (builtin execution modules)
    - http://salt.readthedocs.org/en/v0.17.5/ref/states/all/ (builtin state modules)

    Note: Change the version above on the URL accordingly

    builtin execution modules:
    Those I normally used when executing a salt cli command such as the examples below

    builtin state modules:
    Those are normally used when writing/creating a state file


    ========================================
    - Compound with grains (G)

    $ salt -t 10 -C "G@roles:account and G@stype:synnex" <
  6. btorch created this gist Jul 3, 2014.
    3 changes: 3 additions & 0 deletions saltstack_tips_and_quickies
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    - Using Compound with grains (G)

    $ salt -t 10 -C "G@roles:account and G@stype:synnex" <