If you integrated SaltStack Config with vRealize Automation Cloud, you can install the minions on virtual machines in your deployments and use the SaltStack Config capabilities to perform additional management operations on the machines.

You can deploy minions as a part of your cloud templates or add one to machines as a day 2 action. You can also specify the state files as part of the template or as a day 2 action. The instructions for deploying in a cloud template are provided here. For more about the day 2 action, see Apply Salt Configuration in What actions can I run on Cloud Assembly deployments.

Minions are nodes that run the salt-minion service. The service listens to commands from a Salt master and performs the requested tasks.

At present, you can use the cloud template to install the minion on Linux machines.

What to do first

  • Verify that you installed SaltStack Config and configured the integration. See Create a SaltStack Config integration in vRealize Automation Cloud.
  • To familiarize yourself with how SaltStack Config works, including the key concepts of minions, see Minions.
  • In SaltStack Config, verify that the FQDN name resolution from minion to master is working. To verify the FQDN on the Salt master in SaltStack Config, select Minions > All Minons, and filter the Minion ID column for the value saltmaster. Click saltmaster to see the details. Verify that the FQDN value is correct.
  • Verify that the images in vSphere that you intend to deploy with a Salt minion have SSH capabilities enabled. SSH is used to remotely access the machine and deploy the minion.
  • Verify that you can assign IP addresses to the machines you deploy. SaltStack Config requires the machines to have IP addresses. Use the IP addresses for the public IP CIDR range for the SDDC (software-defined datacenter) where your Salt master is located.
  • Verify that the cloud template that you are adding the minion to is deployable before you add the saltConfiguration properties.

Add the minion to the cloud template

As a cloud template developer, you can add properties to the YAML that install the SaltStack Config minion when you deploy the template.

The core properties that you add to the template include remote access and some saltConfiguration properties. The procedure includes only selected properties. The YAML includes other saltConfiguration properties that are not used in this example. For more information, review the schema.

Although this example shows how to add the username and password for the remote access properties, you can configure a secret property and add the property to the template. For an example, see Secret Cloud Assembly properties.

Procedure

  1. In Cloud Assembly, select Design > Cloud Templates.
  2. Open an existing template.
  3. In the code pane, add any saltConfiguration properties to the machine resources.

    You are not required to include all of the possible properties. The values used in this example are explained in the table.

     saltConfiguration:
            masterId: saltstack_enterprise_installer
            minionId: '${input.minionID}'
            saltEnvironment: sse
            stateFiles:
              - /doe.sls
            variables: 
              user: joe

    Description of the saltConfiguration properties used in this example.

    Property Description
    masterID The saltstack_enterprise_installer value is the default masterID. You might have master IDs defined in SaltStack Config in the Administration > Master Keys.
    minionID The minion ID is assigned by SaltStack Config if you do no provide it. The default ID is the machine address. You cannot configure it to use the machine hostname.

    The current value in the sample YAML, '${input.minionID}', is a variable. This procedure includes the steps for adding an input value so that you can name it and test it. However, allowing users to define the minionID is not a common practice.

    saltEnvironment The sse value is the default file location for the state files. You might have your state files in other file server locations in SaltStack Config in Config > File Server.
    stateFiles The doe.sls value is a default state file provided in the file server directory specified as the saltEnvironment.
    variables The variables are the values that the state file uses. In this example, the doe.sls accepts a user value.
  4. Add the remoteAccess properties that SaltStack Config uses to communicate with the minion.

    The value for the authentication key must be usernamePassword or generatedPublicPrivateKey. publicPrivateKey is unsupported.

     remoteAccess:
            authentication: usernamePassword
            username: adminUser
            password: adminPassword
  5. Add Inputs so that the deploying user can specify the minionID.
    inputs:
      minionID:
        type: string
        title: Minion ID
  6. Verify that your YAML includes the properties similar to the following sample.
    inputs:
      minionID:
        type: string
        title: Minion ID
    resources:
      Cloud_vSphere_Machine_1:
        type: Cloud.vSphere.Machine
        properties:
          image: centos
          flavor: small
          saltConfiguration:
            masterId: saltstack_enterprise_installer
            minionId: '${input.minionID}'
            saltEnvironment: sse
            stateFiles:
              - /doe.sls
            variables:
              user: sylvia
          remoteAccess:
            authentication: usernamePassword
            username: adminUser
            password: adminPassword
  7. Test and deploy the cloud template.
  8. Verify the Salt Configuration properties for the deployed machine.
    1. Select Deployments > Deployments and open the deployment details.
    2. On the Topology tab, click the machine and expand the properties in the right-hand pane.

      Screenshot of the Topology tab with the Salt Configuration properties expanded in the right pane. The properties include the Master ID, Minion ID, Salt environment, and State files.

Verify the minion in SaltStack Config

After you install the minion on the virtual machine, locate the minion and run any jobs or commands on the resource.

Procedure

  1. To open SaltStack Config, click the applications menu in the upper right corner and click Cloud Services Console.
  2. Click the SaltStack Config service tile.
  3. In SaltStack Config, expand Minion Keys and click Accepted.
  4. In the Minion ID column, click the filter icon and enter the name of the minion.
    The minion name is the string that entered with when you deployed the cloud template in Cloud Assembly. In this example the minion ID is MinionID-0001.
    Screenshot of the Accepted minion keys in SaltStack Config.
  5. To view the details, click the minion name.
    You can run jobs or commands on the minion. For example, Sample Disk Usage. This job returns disk usage statistics for a minion.
    Screenshot of the details page for the sample minion ID.

What to do next

To use the SaltStack Config capabilities to manage your resources, see the SaltStack Config documentation.