mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixed wrong example of 'environment' for setting PATH
This commit is contained in:
parent
bad554d517
commit
87dde862bd
1 changed files with 9 additions and 7 deletions
|
@ -3,15 +3,17 @@ Frequently Asked Questions
|
|||
|
||||
Here are some commonly-asked questions and their answers.
|
||||
|
||||
.. _users_and_ports:
|
||||
.. _set_environment:
|
||||
|
||||
If you are looking to set environment variables remotely for your project (in a task, not locally for Ansible)
|
||||
The keyword is simply `environment`
|
||||
How can I set the PATH or any other environment variable for a task or entire playbook?
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
Setting environment variables can be done with the `environment` keyword. It can be used at task or playbook level::
|
||||
|
||||
environment:
|
||||
PATH: {{ ansible_env.PATH }}:/thingy/bin
|
||||
SOME: value
|
||||
|
||||
```
|
||||
environment:
|
||||
PATH:$PATH:/thingy/bin
|
||||
```
|
||||
|
||||
|
||||
How do I handle different machines needing different user accounts or ports to log in with?
|
||||
|
|
Loading…
Reference in a new issue