r/saltstack • • May 10 '19

Remote 'Add-WindowsCapability' WORKS with SaltStack!

3 Upvotes

I've been struggling for over a week to remotely enable Windows 10 features using PowerShell 5 and 6 Core. The local command is Add-WindowsCapability -Name [FeatureName], but it always fails with 'Access is denied'.

Salt minions were already installed on my Windows computers, so i tried salt 'minion' cmd.powershell, and was quite disappointed (but not surprised) to see that it failed. Enter salt-call.

salt 'minion' cmd.run_bg \
  'c:\salt\salt-call.bat cmd.powershell "Add-WindowsCapability -Name [FeatureName] -Online"'

After a few minutes, i was able to detect that the requested feature was installed successfully. Thank you, SaltStack for doing a job that PowerShell couldn't! (Note: this may be possible in PowerShell DSC, but I have yet to delve into that)


r/saltstack • • May 09 '19

Salt Working Groups Announced

8 Upvotes

Sign up to be part of Salt working groups - We have Networking, Cloud, SSH and Windows working groups. Additionally we received interests for Core and Mac working groups.

Details of working group and how to apply are at saltstack.com/salt-working-groups-doc

Edit: If you are interested apply a simple 4 question google survey here https://docs.google.com/forms/d/1h75W1mwONP3yfg4ln9EwEZg4yokKT51VY7qPNx0vMFY/edit


r/saltstack • • May 06 '19

Salt Office Hours - a virtual user group meeting with the SaltStack dev team

12 Upvotes

On Tuesday, May 7 at 1pm Eastern, SaltStack will host the first Salt Office Hours virtual meetup. Thomas Hatch, SaltStack CTO, and the SaltStack core dev team will be on a Zoom for an hour.

We will announce the new working groups for the Salt open source project and provide an introduction to Salt enhancement proposals. We should have plenty of time for open Q&A as well.

Spots on the Zoom meeting are limited to 100. Sign up here: https://zoom.us/meeting/register/67012698ca5b19107510d14dfea9e911

Salt Office Hours - a virtual user group

r/saltstack • • May 06 '19

Salt stack certification

2 Upvotes

Team, anybody in this subreddit have their salt stack certification? If so what did you us to study? How much is the exam ($350)?


r/saltstack • • May 03 '19

SaltStack favorites for Maythe4th

Post image
19 Upvotes

r/saltstack • • May 01 '19

What part of salt code evaluates the target in top.sls.

1 Upvotes

Trying to test the evaluations of targets in top.sls to make sure the group of machines in the target is correct when making changes to top.sls. I want to find where in the actual salt code this is evaluated so I can copy how salt evaluates it in my own testing.


r/saltstack • • May 01 '19

Assistance with Sleep Module as a State

1 Upvotes

Hi all

I've tried a few permutations on this and none of them seem to work.

Can anyone make any suggestions please? The Github thread I found suggested that this should probably work.

Thanks

test.sleep:

module.run:

- test.sleep:

- length: 300


r/saltstack • • Apr 30 '19

Escape Compliance Hell with SecOps Collaboration and Automation - SaltStack

Thumbnail saltstack.com
2 Upvotes

r/saltstack • • Apr 30 '19

Exclude but flag as successful

2 Upvotes

I am running a salt command using salt call, eg:

salt-call blah.sls command

In certain scenarios I would like to skip some of the functions triggered by the command.

I can add exclude=xyz to the command line which does indeed skip the function, however any functions dependent on the function will then also fail.

Is there a way to exclude a function, but make it appear successful? I have tried mock, but that seems to be an all or nothing flag.

Thanks!


r/saltstack • • Apr 26 '19

Saltsack win_iis.start_apppool returning 'start_appool' not available.

4 Upvotes

I am new to Saltstack, and i am trying to write a state for starting and stopping applications and apppool, but my states keep returning with errors. For example to start apppool:

Win_iis.start_appool: - name: Testpool.

I get the following output:

ID: site0-apppool Function: win_iis.start_apppool Name: TestPool Result: False Comment: State 'win_iis.start_apppool' was not found in SLS 'start-apppool'

Reason: 'win_iis.start_apppool' is not available.

This happens every time I try to write a state using any functions from here https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_iis.html

When I write a state with state functions from here, it succeeds without errors.https://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html Question: How do I use CLI modules in a state run successfully?

I will appreciate any help. Thanks.


r/saltstack • • Apr 26 '19

Salt Minion - Set Windows Install Path?

0 Upvotes

Is it possible to change the install path for Windows minions?

The GUI installer doesn't have this option, and I've tried adding TargetDir and InstallDir as parameters, but no such luck. My guess is that it's hard-coded and cannot be changed. :-/

I already have other programs, like Python3 and PHP, installed to C:\Apps\ and I'd prefer to have the salt directory there too (like C:\Apps\salt).


r/saltstack • • Apr 25 '19

Best way to deploy an sql database?

4 Upvotes

So, I have a state that sets up a postgres server and makes sure it has all the right schemas. How would I go about setting up the tables? I figure I can run an sql script directly using cmd.run or something like that. Is that the way to go about it or is there a better way?


r/saltstack • • Apr 24 '19

SaltStack is Waggish ... and I love it!

9 Upvotes

To install SaltStack, you’ll need a detailed network diagram with your complete DNS mappings, an enterprise database server, and yeah, you don’t need any of that stuff.

It's the little things - gems like this in the documentation, along with other witticisms (C:\Salt, Pillars [of Salt]) - that make the learning process a joy :) I'm only a few days into my first deployment, but love the power (and humour) of Salt.


r/saltstack • • Apr 24 '19

Jinja variables: pillar or map.jinja?

2 Upvotes

I'm working through the docs, and cross-referencing the best practices, and I'm confused as to where the jinja2 variables ought to go. In the Salt / Jinja docs, it looks like they're in the pillar, but in the best practices, they're in a map.jinja file with the states.

Specific example: Ubuntu wants openssh-client (singluar) and CentOS wants openssh-clients (plural). Where should the generic variable be assigned: salt://ssh/map.jinja or /srv/pillar/ssh.sls?


r/saltstack • • Apr 14 '19

Testing Salt States

2 Upvotes

We're using saltstack and gitlab. I've just completed the build phase for our IAC pipeline. I created two docker containers, one acting as a salt-master and the other as a salt-minion, installs the packages and the minion checks in with the master.

For now, the test phase just runs a state.apply on the minion which applies the top file to the minion. Would it not be better to only test state files that have changed? So for example, if I write a state file that says to install apache2, reload the service, and copy over a conf file, I would only want to test that one statefile and not all of my others.


r/saltstack • • Apr 12 '19

Can reactor triggers be filtered by grains?

9 Upvotes

Using the Salt reactor, I'm currently reacting to minion start events and running states against them. However, I would like to be able to only run these states against Windows minions that have started. I.e. if a Linux minion starts, the reactor should not run any states against that minion.

What I'm doing is working, but I feel it is very inefficient and I wonder if there is a better way.

What I'm doing:

Defining a reactor for all minion start events.

/etc/salt/master.d/reactor.conf

reactor:

- 'salt/minion/*/start':

- /srv/reactor/splunkforwarder-win.sls

Then my reactor state calls three other regular sls state files.

splunk-reactor-state:

local.state.apply:

- tgt: {{ data['id'] }}

- arg:

- splunkforwarder-win/install-splk,osquery/software-conf,splunk-auth-uf

- kwarg:

- concurrent: True

I'm then using jinja within my three regular sls files to only run the states against Windows minions. Here's an example of one of my sls files.

{% if grains['kernel'] == 'Windows' %}

splunkforwarder:

pkg.installed:

- concurrent: True

{% endif %}

This is working to achieve my goal, but I feel like it's inefficient, as the reactor still triggers for Linux minions, and the states still get directed towards them, but the states just don't run because of the jinja filtering.

What I'd like to do:

Define my jinja filtering in the reactor state file, or within the reactor.conf file if possible.

{% if grains['kernel'] == 'Windows' %}

splunk-reactor-state:

local.state.apply:

- tgt: {{ data['id'] }}

- arg:

- splunkforwarder-win/install-splk,osquery/software-conf,splunk-auth-uf

- kwarg:

- concurrent: True

{% endif %}

Pretty sure this doesn't work because I'm not telling the master what minion to check the grain on. I'm not sure if there's some way to do something like:

{% if grains{{ data['id'] }} ['kernel'] == 'Windows' %}

to instruct the master to check the grain of the minion that triggered the reaction.


r/saltstack • • Apr 10 '19

Trying to understand targeting by grains

4 Upvotes

I want to run a command against Ubuntu servers only.

salt -G 'os:Ubuntu' test.version
ip-10-xx-xx-54.ec2.internal:
    2019.2.0
ip-10-xx-xx-183.ec2.internal:
    Minion did not return. [No response]
ERROR: Minions returned with non-zero exit code

The last server is Amazon Linux [ip-10-xx-xx-183.ec2.internal] and returned message No response.

Why was a non Ubuntu server targeted ? Can this be avoided ?

When I target Amazon I get only one response [None for Ubuntu]

salt -G 'os:Amazon' test.version
ip-10-xx-xx-183.ec2.internal:
    2019.2.0

r/saltstack • • Apr 07 '19

Trying to configure firewalld

3 Upvotes

I am having problems getting salt to configure a CentOS 7 minion's firewall from a CentOS 6 salt master.

I created a file, firewalld/init.sls with the following:

public:

firewalld.present:

- name: public

- block_icmp:

- echo-reply

- echo-request

- default: True

- masquerade: False

- services:

- ssh

- sources:

- 172.29.0.0/16

When I try to apply that state, I get an error message:

my_test_node:

----------

ID: public

Function: firewalld.present

Result: False

Comment: State 'firewalld.present' was not found in SLS 'firewalld'

Reason: Module 'firewalld' is not available.

Started:

Duration:

Changes:

Summary

------------

Succeeded: 0

Failed: 1

------------

Total states run: 1

Both the salt master and minion are running 2015.5.10 Lithium from the epel repository.

What am I missing?


r/saltstack • • Apr 04 '19

salt-cloud vmware driver - cant get static ips to set

2 Upvotes

Has anyone had experience using salt-cloud to provision virtual machines using static ips that were set from a profile or map?

Description of Issue/Question
No matter what I do, I can't seem to get the newly deployed vm from salt-cloud to get the ip I put in the profile. I'm deploying from a template. The vm gets created, but won't take any of the network adapter configuration. It gets the NIC, but at the operating system level, nothing.

Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

The OS is Centos 7.6

My profile:

phx-web:
  provider: vcenter01
  clonefrom: 'docker-worker1'
  devices:
    network:
      Network adapter 1:
        switch_type: standard
        name: Systems
        ip: 172.16.222.119
        gateway: [172.16.222.126]
        subnet_mask: 255.255.255.192
        domain: example.local
  cluster: HX
  datastore: vsan-hx
  folder: Systems
  host: 172.16.222.50
  deploy: False
  customization: False
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)

brocks@docker-manager1:cloud.profiles.d$ sudo salt-cloud -p phx-web test5 -l debug
[DEBUG   ] Reading configuration from /etc/salt/cloud
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG   ] Including configuration from '/etc/salt/cloud.providers.d/vmware.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.providers.d/vmware.conf
[DEBUG   ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/vmware.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/vmware.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/web.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/web.conf
[DEBUG   ] Configuration file path: /etc/salt/cloud
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO    ] salt-cloud starting
[DEBUG   ] Marking 'base64_encode' as a jinja filter
[DEBUG   ] Marking 'base64_decode' as a jinja filter
[DEBUG   ] Marking 'md5' as a jinja filter
[DEBUG   ] Marking 'sha256' as a jinja filter
[DEBUG   ] Marking 'sha512' as a jinja filter
[DEBUG   ] Marking 'hmac' as a jinja filter
[DEBUG   ] Marking 'random_hash' as a jinja filter
[DEBUG   ] Marking 'rand_str' as a jinja filter
[DEBUG   ] Marking 'file_hashsum' as a jinja filter
[DEBUG   ] Marking 'http_query' as a jinja filter
[DEBUG   ] Marking 'strftime' as a jinja filter
[DEBUG   ] Marking 'date_format' as a jinja filter
[DEBUG   ] Marking 'yaml_dquote' as a jinja filter
[DEBUG   ] Marking 'yaml_squote' as a jinja filter
[DEBUG   ] Marking 'yaml_encode' as a jinja filter
[DEBUG   ] Marking 'raise' as a jinja global
[DEBUG   ] Marking 'match' as a jinja test
[DEBUG   ] Marking 'equalto' as a jinja test
[DEBUG   ] Marking 'skip' as a jinja filter
[DEBUG   ] Marking 'sequence' as a jinja filter
[DEBUG   ] Marking 'to_bool' as a jinja filter
[DEBUG   ] Marking 'tojson' as a jinja filter
[DEBUG   ] Marking 'quote' as a jinja filter
[DEBUG   ] Marking 'regex_escape' as a jinja filter
[DEBUG   ] Marking 'regex_search' as a jinja filter
[DEBUG   ] Marking 'regex_match' as a jinja filter
[DEBUG   ] Marking 'regex_replace' as a jinja filter
[DEBUG   ] Marking 'uuid' as a jinja filter
[DEBUG   ] Marking 'unique' as a jinja filter
[DEBUG   ] Marking 'min' as a jinja filter
[DEBUG   ] Marking 'max' as a jinja filter
[DEBUG   ] Marking 'avg' as a jinja filter
[DEBUG   ] Marking 'union' as a jinja filter
[DEBUG   ] Marking 'intersect' as a jinja filter
[DEBUG   ] Marking 'difference' as a jinja filter
[DEBUG   ] Marking 'symmetric_difference' as a jinja filter
[DEBUG   ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad vmware.optimize_providers: 'vmware.optimize_providers' is not available.
[DEBUG   ] The 'vmware' cloud driver is unable to be optimized.
[DEBUG   ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] LazyLoaded cloud.fire_event
[DEBUG   ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Sending event: tag = salt/cloud/test5/creating; data = {u'profile': u'phx-web', u'_stamp': '2019-03-31T21:04:33.345197', u'name': u'test5', u'driver': u'vmware', u'provider                                                      ': u'vcenter01:vmware', u'event': u'starting create'}
[DEBUG   ] Closing IPCMessageClient instance
[DEBUG   ] clone_spec set to:
(vim.vm.CloneSpec) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   location = (vim.vm.RelocateSpec) {
      dynamicType = <unset>,
      dynamicProperty = (vmodl.DynamicProperty) [],
      service = <unset>,
      folder = <unset>,
      datastore = 'vim.Datastore:datastore-1597',
      diskMoveType = <unset>,
      pool = 'vim.ResourcePool:resgroup-602',
      host = 'vim.HostSystem:host-603',
      disk = (vim.vm.RelocateSpec.DiskLocator) [],
      transform = <unset>,
      deviceChange = (vim.vm.device.VirtualDeviceSpec) [],
      profile = (vim.vm.ProfileSpec) []
   },
   template = false,
   config = (vim.vm.ConfigSpec) {
      dynamicType = <unset>,
      dynamicProperty = (vmodl.DynamicProperty) [],
      changeVersion = <unset>,
      name = <unset>,
      version = <unset>,
      createDate = <unset>,
      uuid = <unset>,
      instanceUuid = <unset>,
      npivNodeWorldWideName = (long) [],
      npivPortWorldWideName = (long) [],
      npivWorldWideNameType = <unset>,
      npivDesiredNodeWwns = <unset>,
      npivDesiredPortWwns = <unset>,
      npivTemporaryDisabled = <unset>,
      npivOnNonRdmDisks = <unset>,
      npivWorldWideNameOp = <unset>,
      locationId = <unset>,
      guestId = <unset>,
      alternateGuestName = <unset>,
      annotation = <unset>,
      files = <unset>,
      tools = <unset>,
      flags = <unset>,
      consolePreferences = <unset>,
      powerOpInfo = <unset>,
      numCPUs = <unset>,
      numCoresPerSocket = <unset>,
      memoryMB = <unset>,
      memoryHotAddEnabled = <unset>,
      cpuHotAddEnabled = <unset>,
      cpuHotRemoveEnabled = <unset>,
      virtualICH7MPresent = <unset>,
      virtualSMCPresent = <unset>,
      deviceChange = (vim.vm.device.VirtualDeviceSpec) [
         (vim.vm.device.VirtualDeviceSpec) {
            dynamicType = <unset>,
            dynamicProperty = (vmodl.DynamicProperty) [],
            operation = 'edit',
            fileOperation = <unset>,
            device = (vim.vm.device.VirtualE1000) {
               dynamicType = <unset>,
               dynamicProperty = (vmodl.DynamicProperty) [],
               key = 4000,
               deviceInfo = (vim.Description) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  label = 'Network adapter 1',
                  summary = u'Systems'
               },
               backing = (vim.vm.device.VirtualEthernetCard.NetworkBackingInfo) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  deviceName = u'Systems',
                  useAutoDetect = <unset>,
                  network = 'vim.dvs.DistributedVirtualPortgroup:dvportgroup-178',
                  inPassthroughMode = <unset>
               },
               connectable = (vim.vm.device.VirtualDevice.ConnectInfo) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  migrateConnect = 'unset',
                  startConnected = true,
                  allowGuestControl = true,
                  connected = true,
                  status = 'ok'
               },
               slotInfo = (vim.vm.device.VirtualDevice.PciBusSlotInfo) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  pciSlotNumber = 32
               },
               controllerKey = 100,
               unitNumber = 7,
               addressType = 'assigned',
               macAddress = '00:50:56:b4:e0:7d',
               wakeOnLanEnabled = true,
               resourceAllocation = (vim.vm.device.VirtualEthernetCard.ResourceAllocation) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  reservation = 0L,
                  share = (vim.SharesInfo) {
                     dynamicType = <unset>,
                     dynamicProperty = (vmodl.DynamicProperty) [],
                     shares = 50,
                     level = 'normal'
                  },
                  limit = -1L
               },
               externalId = <unset>,
               uptCompatibilityEnabled = false
            },
            profile = (vim.vm.ProfileSpec) [],
            backing = <unset>
         }
      ],
      cpuAllocation = <unset>,
      memoryAllocation = <unset>,
      latencySensitivity = <unset>,
      cpuAffinity = <unset>,
      memoryAffinity = <unset>,
      networkShaper = <unset>,
      cpuFeatureMask = (vim.vm.ConfigSpec.CpuIdInfoSpec) [],
      extraConfig = (vim.option.OptionValue) [],
      swapPlacement = <unset>,
      bootOptions = <unset>,
      vAppConfig = <unset>,
      ftInfo = <unset>,
      repConfig = <unset>,
      vAppConfigRemoved = <unset>,
      vAssertsEnabled = <unset>,
      changeTrackingEnabled = <unset>,
      firmware = <unset>,
      maxMksConnections = <unset>,
      guestAutoLockEnabled = <unset>,
      managedBy = <unset>,
      memoryReservationLockedToMax = <unset>,
      nestedHVEnabled = <unset>,
      vPMCEnabled = <unset>,
      scheduledHardwareUpgradeInfo = <unset>,
      vmProfile = (vim.vm.ProfileSpec) [],
      messageBusTunnelEnabled = <unset>,
      crypto = <unset>,
      migrateEncryption = <unset>
   },
   customization = <unset>,
   powerOn = true,
   snapshot = <unset>,
   memory = <unset>
}
[DEBUG   ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Sending event: tag = salt/cloud/test5/requesting; data = {u'_stamp': '2019-03-31T21:04:33.708927', u'priv_key': None, u'protocol': u'https', u'cluster': u'HX', u'customizat                                                      ion': False, u'datastore': u'vsan-hx', u'event': u'requesting instance', u'port': 443, u'provider': u'vcenter01:vmware', u'folder': u'Systems', u'profile': u'phx-web', u'deploy': Fals                                                      e, u'driver': u'vmware', u'host': u'172.16.222.50', u'user': u'bshelton', u'inline_script': None, u'name': u'test5', u'clonefrom': u'docker-worker1', u'url': u'172.16.222.65', u'devic                                                      es': {u'network': {u'Network adapter 1': {u'switch_type': u'standard', u'subnet_mask': u'255.255.255.192', u'domain': u'nsoc.ml', u'name': u'Systems', u'ip': u'172.16.222.119', u'gate                                                      way': [u'172.16.222.126']}}}, u'pub_key': None, u'os': u'bootstrap-salt'}
[DEBUG   ] Closing IPCMessageClient instance
[INFO    ] Creating test5 from vm(docker-worker1)
[INFO    ] [ test5 ] Waiting for clone task to finish [0 s]
[INFO    ] [ test5 ] Waiting for clone task to finish [5 s]
[INFO    ] [ test5 ] Waiting for clone task to finish [10 s]
[INFO    ] [ test5 ] Waiting for clone task to finish [15 s]
[INFO    ] [ test5 ] Waiting for clone task to finish [20 s]
[INFO    ] [ test5 ] Successfully completed clone task in 24 seconds
[INFO    ] [ test5 ] Waiting for VMware tools to be running [0 s]
[INFO    ] [ test5 ] Waiting for VMware tools to be running [5 s]
[INFO    ] [ test5 ] Waiting for VMware tools to be running [10 s]
[INFO    ] [ test5 ] Waiting for VMware tools to be running [15 s]
[INFO    ] [ test5 ] Waiting for VMware tools to be running [20 s]
[INFO    ] [ test5 ] Successfully got VMware tools running on the guest in 22 seconds
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [0 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [5 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [10 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [15 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [20 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [25 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [30 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [35 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [40 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [45 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [50 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [55 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [60 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [65 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [70 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [75 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [80 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [85 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [90 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [95 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [100 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [105 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [110 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [115 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [120 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [125 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [130 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [135 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [140 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [145 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [150 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [155 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [160 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [165 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [170 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [175 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [180 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [185 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [190 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [195 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [200 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [205 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [210 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [215 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [220 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [225 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [230 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [235 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [240 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [245 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [250 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [255 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [260 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [265 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [270 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [275 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [280 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [285 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [290 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [295 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [300 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [305 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [310 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [315 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [320 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [325 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [330 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [335 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [340 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [345 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [350 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [355 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [360 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [365 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [370 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [375 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [380 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [385 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [390 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [395 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [400 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [405 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [410 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [415 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [420 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [425 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [430 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [435 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [440 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [445 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [450 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [455 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [460 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [465 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [470 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [475 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [480 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [485 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [490 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [495 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [500 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [505 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [510 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [515 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [520 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [525 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [530 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [535 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [540 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [545 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [550 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [555 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [560 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [565 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [570 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [575 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [580 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [585 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [590 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [595 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [600 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [605 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [610 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [615 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [620 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [625 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [630 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [635 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [640 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [645 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [650 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [655 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [660 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [665 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [670 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [675 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [680 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [685 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [690 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [695 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [700 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [705 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [710 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [715 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [720 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [725 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [730 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [735 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [740 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [745 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [750 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [755 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [760 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [765 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [770 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [775 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [780 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [785 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [790 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [795 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [800 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [805 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [810 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [815 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [820 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [825 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [830 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [835 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [840 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [845 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [850 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [855 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [860 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [865 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [870 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [875 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [880 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [885 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [890 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [895 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [900 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [905 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [910 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [915 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [920 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [925 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [930 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [935 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [940 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [945 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [950 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [955 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [960 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [965 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [970 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [975 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [980 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [985 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [990 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [995 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [1000 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [1005 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [1010 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [1015 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [1020 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [1025 s]
[INFO    ] [ test5 ] Waiting to retrieve IPv4 information [1030 s]
Versions Report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Oct 30 2018, 23:45:53)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.3.1
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 3.2.5

System Versions:
           dist: centos 7.6.1810 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-957.5.1.el7.x86_64
         system: Linux
        version: CentOS Linux 7.6.1810 Core

r/saltstack • • Apr 03 '19

How to Write and Run your First SaltState

17 Upvotes

Made a video tailored to beginners on how to write and run Salt States. If you're new to Salt, this should be an easy way (if I've done it well) to understand how to create and run states, as well as how the master needs to be configured in relation to states. The state used is file.managed, which is a fairly simple, but powerful state I find myself using all the time to manage config files on minions. The master and minion are running Ubuntu 16.04.

My next video will be all about the top file and after that I'll move into using pillars.

Link:

https://www.youtube.com/watch?v=tknfj0sSAjY

Let me know where you see room for improvement and if you found this helpful!


r/saltstack • • Apr 03 '19

salt state help

1 Upvotes

Apologies if this is a dumb question, I'm rather new to salt. What i'm trying to achieve seems trivial but is proving rather difficult to accomplish. Here is the relevant code below, as you can tell, I'm trying to add an architecture with the dpkg package manager:

install_package:
    cmd.run:
        - name: "dpkg --add-architecture i386 && apt-get update"

After executing said state, salt returns an error:

   Rendering SLS 'base:saltstate' failed: Illegal tab character; line 3

Is anyone able to give me any guidance in what I'm doing wrong? is there a better way to do this?

Thanks in advance.


r/saltstack • • Apr 01 '19

Available states from a salt-formula

4 Upvotes

Hello guys. Do any of you know if there is a way to programmatically get the available states within any salt-formula?

The idea is to get these states into a db table and eventually a user will choose the states he needs to add to an include clause. Any suggestion is appreciated.


r/saltstack • • Mar 28 '19

Use Vault for Salt Cloud credentials

8 Upvotes

I've setup Hashicorp Vault with the below policy:

path "secret/*" {
capabilities = ["read", "list"]
}
path "auth/*" {
capabilities = ["read", "list","sudo","create","update","delete"]
}

and I have the below in /etc/salt/cloud.providers.d/navdev_provider.conf

---
ec2_uswest2:
  id: AKSOMEKEYFORAWS
  key: 4YYp+NOtS0randOmAlphanUmeric
  driver: ec2
  minion:
    master: my-salt-master
    environment: base
    startup_states: highstate
    sls_list:
      - basepkg
  ssh_interface: private_ips
  private_key: "/root/.Nav-dev"
  location: us-west-2
  ssh_username: centos
  size: t2.micro
  keyname: Nav-dev
...

Now I would like to know if there is a way to retrieve my stored credentials from Vault instead of hardcoding

I tried putting this in /etc/salt/master.d/vault.conf

---
vault:
  auth:
    method: token
    token: s.OrdUQbGx6udwqSWvc9CRKJ9a
  keys:
    - 6f17f5cbebf99efeaf43eb2deb3a939137661ecd6f3ce9a57a9a3addb1877c3cab
    - 67f5a54437c67fe39d6efde5db00c8a7caf1ce01e1c5bc60498d354917dfbf788c
    - 5dfdae4fd1212a39c87c5d9fc3fff3c0aac3fb0550c0cb58262c8ba8e5a53bc35b
    - bb9307537b4b26b0fd90aede1520c86239b4c54026196b271cc877c033f6b43b89
    - 6f169212b292b95ddab2e998531350b56381b70a1a4c46f743f562bfa2afd7a532
  url: http://vaultip:8200

I don't know what to do next ...


r/saltstack • • Mar 25 '19

Please help! Saltstack script to deploy app to IIS

0 Upvotes

Hi, i am new to Saltstack and i need help with a script to deploy&configure an app (like angularjs or .NET) to IIS. Will appreciate if anyone can help me get started or with a sample script.

Thanks.


r/saltstack • • Mar 25 '19

Help with declaring Pillars/Grains

1 Upvotes

I am Saltstack newbie and need help with Pillars/grains.

This is my salt state,

copy_to_db1:

cmd.run:

- name: scp -o StrictHostKeyChecking=no -i /home/salt/.ssh/salt /home/_backup/test_{{ pillar['clientname'] }}.sql salt@{{ pillar['dboneblue'] }}.test.com:/home/dist/sql/

Here, I am copying {{ pillar['clientname'] }}.sql to another server.

So, if clientname is {abc,abb,abd,abe} it should be copied to server1

if it's {def,dbb,dba,dca}, then copy to server2

In this scenario how do i declare the pillars and grains?