Skip to content

module.run documentation issues #43130

@boltronics

Description

@boltronics

Description of Issue/Question

According to https://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html#module-salt.states.module the new module.run syntax is:

fetch_out_of_band:
  module.run:
    git.fetch:
      - cwd: /path/to/my/repo
      - user: myuser
      - opts: '--all'

This example is incorrect. It should read:

fetch_out_of_band:
  module.run:
    - git.fetch:
      - cwd: /path/to/my/repo
      - user: myuser
      - opts: '--all'

All the other examples on that page also have the same error, which I found quite confusing.

That entire section doesn't read very well, as the old and new syntax formats are mixed together. It would be clearer if it was broken into sections with separate headings such as "The new way" and "The old way (supported until Oxygen)". It would also allow anyone new to module.run to simply skip the section on the old format.

Finally, I'd like to see a more complicated example. eg.

Remove appserver server from HAProxy host:
  module.run:
    - publish.publish:
      - tgt: 'rproxy*'
      - fun: haproxy_cmds.disable_server
      - arg: >-
          [
          'server=appserver',
          'backend=bk_appservers'
          ]
    - require_in:
      - git: Deploy code
    - onchanges_in:
      - module: Add appserver server to HAProxy host

I tried experimenting with a YAML list for arg, but it didn't work. This might save someone time.

Setup

N/A

Steps to Reproduce Issue

N/A

Versions Report

Applicable to the documentation in 2017.7.0+.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions