salt.states.ansiblegate

Execution of Ansible modules from within states

With ansible.call these states allow individual Ansible module calls to be made via states. To call an Ansible module function use a module.run state:

some_set_of_tasks:
  ansible:
    - system.ping
    - packaging.os.zypper
      - name: emacs
      - state: installed
class salt.states.ansiblegate.AnsibleState

Ansible state caller.

get_args(argset)

Get args and kwargs from the argset.

Parameters

argset --

Returns

salt.states.ansiblegate.playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=None)

Run Ansible Playbooks

Parameters
  • name -- path to playbook. This can be relative to rundir or the git repo

  • rundir -- location to run ansible-playbook from.

  • git_repo -- git repository to clone for ansible playbooks. This is cloned using the git.latest state, and is cloned to the rundir if specified, otherwise it is clone to the cache_dir

  • git_kwargs -- extra kwargs to pass to git.latest state module besides the name and target

  • ansible_kwargs -- extra kwargs to pass to ansible.playbooks execution module besides the name and target

Returns

Ansible playbook output.

run nginx install:
  ansible.playbooks:
    - name: install.yml
    - git_repo: git://github.com/gituser/playbook.git
    - git_kwargs:
        rev: master

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/states/all/salt.states.ansiblegate.html