Skip to content

sh

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version historical.

Synopsis

  • This shell plugin is the one you want to use on most Unix systems, it is the most compatible and widely installed shell.

Parameters

Parameter Defaults / Choices Comments
admin_users
list / elements=string
Default: ['root', 'toor']
list of users to be expected to have admin privileges. This is used by the controller to determine how to share temporary files between the remote user and the become user.
Env: ANSIBLE_ADMIN_USERS
async_dir Default: ~/.ansible_async
Directory in which ansible will keep async job information.
Env: ANSIBLE_ASYNC_DIR
common_remote_group Checked when Ansible needs to execute a module as a different user.
If setfacl and chown both fail and do not let the different user access the module's files, they will be chgrp'd to this group.
In order for this to work, the remote_user and become_user must share a common group and this setting must be set to that group.
Env: ANSIBLE_COMMON_REMOTE_GROUP
Version Added: 2.10
remote_tmp Default: ~/.ansible/tmp
Temporary directory to use on targets when executing tasks.
Env: ANSIBLE_REMOTE_TEMP
Env: ANSIBLE_REMOTE_TMP
system_tmpdirs
list / elements=string
Default: ['/var/tmp', '/tmp']
List of valid system temporary directories on the managed machine for Ansible to validate O(remote_tmp) against, when specific permissions are needed. These must be world readable, writable, and executable. This list should only contain directories which the system administrator has pre-created with the proper ownership and permissions otherwise security issues can arise.
When O(remote_tmp) is required to be a system temp dir and it does not match any in the list, the first one from the list will be used instead.
Env: ANSIBLE_SYSTEM_TMPDIRS
world_readable_temp
boolean
This makes the temporary files created on the machine world-readable and will issue a warning instead of failing the task.
It is useful when becoming an unprivileged user.
Env: ANSIBLE_SHELL_ALLOW_WORLD_READABLE_TEMP
Version Added: 2.10