I need to set the variables like JAVA_HOME and update PATH. There are a number of ways of doing this. One way is to update the /etc/environm
JAVA_HOME
PATH
/etc/environm
Update to the lineinfile approach. The JAVA_HOME value should not include the bin directory. The following worked for centos:
- name: Set JAVA_HOME lineinfile: dest: /etc/environment state: present regexp: '^JAVA_HOME' line: 'JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk'