Hello to everyone. I have a big problem. I need to add a line text to environment file on Ubuntu. Here is the file content:
PATH=“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games”
and I want to insert the following lines at the end but in the same line
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin
/usr/lib/jvm/java-8-openjdk-amd64/bin
So it should look like this
PATH=“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin”
Please any help with this will be awesome hehehehe.
name: adding extra path
shell: PATH=$PATH:{{item}}
with_items:
- /usr/lib/jvm/java-8-openjdk-amd64/jre/bin
- /usr/lib/jvm/java-8-openjdk-amd64/bin
missed export
name: adding extra path
shell: PATH=$PATH:{{item}} && export PATH
with_items:
- /usr/lib/jvm/java-8-openjdk-amd64/jre/bin
- /usr/lib/jvm/java-8-openjdk-amd64/bin
I already played it but it doesn’t do anything.
Here is the out from the prompt
TASK [ansible-integro-vistualizacion : adding extra path] ************************************************************************************
changed: [192.168.14.96] => (item=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin)
changed: [192.168.14.96] => (item=/usr/lib/jvm/java-8-openjdk-amd64/bin)