Here's a quick local task to permanently set key/values on /etc/environment (which is system-wide, all users, thus become is needed):
- name: populate /etc/environment
  lineinfile:
    path: "/etc/environment"
    state: present
    regexp: "^{{ item.key }}="
    line: "{{ item.key }}={{ item.value}}"
  with_items: "{{ os_environment }}"
  become: yes
and the vars for it:
os_environment:
  - key: DJANGO_SETTINGS_MODULE 
    value : websec.prod_settings  
  - key: DJANGO_SUPER_USER 
    value : admin
and, yes, if you ssh out and back in, env shows the new environment variables.
p.s. It used to be dest as in:
    dest: "/etc/environment"
but see the comment
For the task only: inlining works, some of the time.
——————-
Note:  the stuff below is more an observation/experiment than a recommendation.
——————-
The first task is the equivalent to Michael's top voted answer.
The second doesn't work, but then again foo=1 echo $foo doesn't work in bash either (I suspect that's because echo is a builtin).
The third does work, as it does in bash, and takes very little effort.  However... when I tried doing this to set a node variable, it failed miserably until I used Michael's answer.
  tasks:
    - name: Echo my_env_var
      shell: "echo $MY_ENV_VARIABLE"
      environment:
        MY_ENV_VARIABLE: value1  
    - name: Echo my_env_var inline, doesnt work in bash either
      shell: "MY_ENV_VARIABLE=value2 echo $MY_ENV_VARIABLE"
    - name: set my_env_var inline then env
      shell: "MY_ENV_VARIABLE=value3 env | egrep MY_ENV"
output:
TASK [Echo my_env_var] *********************************************************
changed: [192.168.63.253] => changed=true 
  cmd: echo $MY_ENV_VARIABLE
  stdout: value1
TASK [Echo my_env_var inline, doesnt work in bash either] **********************
changed: [192.168.63.253] => changed=true 
  cmd: MY_ENV_VARIABLE=value2 echo $MY_ENV_VARIABLE
  stdout: ''
TASK [set my_env_var inline then env] ******************************************
changed: [192.168.63.253] => changed=true 
  cmd: MY_ENV_VARIABLE=value3 env | egrep MY_ENV
  stdout: MY_ENV_VARIABLE=value3