Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Execute Play

This playbook should really be run through AWX, but below are some CLI examples. This play does require to be run with select tags applied as it’s intended to provide varying services based on them.

Variables

  • command - The desired shell command. Designed to be used within AWX as a drop down survey of options.
  • chefsvr - Specific server or Chef server group from your inventory from which to act on.
  • chef_node - Specific space delineated nodes that match your Chef catalog.
  • vault_name - Desired vault bag name.
  • vault_item - Desired vault item.
  • search_criteria - Specific search criteria used to determine what nodes are allowed access to the vault item.

Commands

ansible-playbook chef_commands.yml -e "command='knife status' chefsvr=<chef_server> chef_node='<server1> <server2>'" --tags chef_node

Create a vault and a new blank item:

ansible-playbook chef_commands.yml -e "chefsvr=<chef_server> vault_name='<vault_bag>' vault_item='<vault_item>' search_criteria=<vault_search_query>" --tags chef_vault_create

Update existing vault item’s search query:

ansible-playbook chef_commands.yml -e "chefsvr=<chef_server> vault_name='<vault_bag>' vault_item='<vault_item>' search_criteria=<vault_search_query>" --tags chef_vault_set_search

Update existing vault item’s admin list:

ansible-playbook chef_commands.yml -e "chefsvr=<chef_server> vault_name='<vault_bag>' vault_item='<vault_item>'" --tags chef_vault_set_admins