Ansible: From Beginner to Abandonment (Twenty-Seven)
Setting Environment Variables for Managed Nodes in Ansible Ansible Playbook sets variables for managed hosts through <span>environment</span>. – name: test environment hosts: all become: true gather_facts: true environment: test_path: testpath PATH: "/usr/local/custon_software/bin/:{{ ansible_env.PATH }}" tasks: – name: get env ansible.builtin.shell: /bin/env register: shell_result – name: print env ansible.builtin.debug: var: shell_result.stdout_lines In this example, Ansible adds … Read more