Setting the env variable before running command or task

Setting the env variable before running command or task


Setting the remote environment in a task in Ansible

You can set the environment directly at the task level:

- hosts: all
  remote_user: root

  tasks:

    - name: Install cobbler
      ansible.builtin.package:
        name: cobbler
        state: present
      environment:
        http_proxy: http://proxy.example.com:8080


No notes link to this note

Previous Next